Ethereal-dev: Re: [Ethereal-dev] Using eth.type in proto_reg_handoff_XXX

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

From: Guy Harris <guy@xxxxxxxxxxxx>
Date: Thu, 6 Nov 2003 15:26:11 -0800

On Nov 5, 2003, at 11:48 PM, Jody Steele wrote:

I have a protocol, lets call it XXX for convenience sake.  I'm trying to write a plug-in for ethereal so I can display useful information about any XXX packets I receive.  The way I know a packet is one of "mine" is the Ethernet II Type field is 0xBADD.  Based on what I read in other packet-xxx.c files this should work, but when I try to run Ethereal I get an "Unspecified fatal error encountered, aborting." error message.
 
Line of code:
dissector_add("eth.type",0xbadd, XXX_handle);

Try

	dissector_add("ethertype", 0xbadd, XXX_handle);

instead. The table is *NOT* called "eth.type", it's called "ethertype", as it doesn't correspond only to the "eth.type" field, it also corresponds to the PID field in the SNAP header for packets with an OUI of "encapsulated Ethernet" (as used for most LANs), and to a number of other places where Ethernet types are used as protocol selectors.