Ethereal-dev: Re: [Ethereal-dev] dissector - need help

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

From: "Martin Regner" <martin.regner@xxxxxxxxx>
Date: Tue, 28 Dec 2004 21:05:03 +0100
Nina Pham wrote:
> I have the file under epan/dissectors and add it to DISSECTOR_SRC in 
> Makefile.common.  I think my problem is that even when I send the packet 
> through port 771, but it is a tcp packet, so ethereal will display as it 
> is a tcp protocal packet, not myprot packet. Am I right? I'm not sure if 
> I can do like ethereal captures a tcp packet though a specify port and 
> displays it  as  a new protocal, or display different than a usual tcp 
> packet.
> 

In order to dissect packets on tcp port number 771 as your protocol you should use
something like the following in the reg_handoff:

 dissector_add("tcp.port", 771, PROTOABBREV_handle);

Note: "tcp.port", and not "my.port"