Ethereal-dev: [Ethereal-dev] Can a dissector tell what protocol and port is using it?

Note: This archive is from the project's previous web site, ethereal.com. This list is no longer active.

From: Mark Atwood <mra@xxxxxxxxx>
Date: 12 Oct 2000 16:57:59 -0700
Ok. My dissector source has a "registration handoff" function as follows

void
proto_reg_handoff_iquery(void)
{
  dissector_add("tcp.port", MY_TCP_PORT1, dissect_myprotocol);
  dissector_add("tcp.port", MY_TCP_PORT2, dissect_myprotocol);
  dissector_add("udp.port", MY_UDP_PORT1, dissect_myprotocol);
  dissector_add("udp.port", MY_UDP_PORT2, dissect_myprotocol);
}

It is easy/possible for the dissect_myprotocol function to tell if the
packet came in via TCP or UDP, and/or tell which port it's on?

-- 
Mark Atwood   |
mra@xxxxxxxxx |
http://www.pobox.com/~mra