Ethereal-dev: Re: [Ethereal-dev] 802.3

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

From: Guy Harris <gharris@xxxxxxxxx>
Date: Fri, 26 Jul 2002 00:06:37 -0700
On Fri, Jul 26, 2002 at 10:55:26AM +0400, Alex V. Boreskoff wrote:
> How to register dissector for 802.3.

What do you mean by "dissector for 802.3"?

If you mean a dissector for the IEEE 802.3 protocol, the Ethernet
dissector that already exists dissects 802.3 frames, with either a type
or a length field; there's no mechanism in Ethereal for a dissector that
*replaces* another dissector, so there's no mechanism in Ethereal to
register your own dissector for 802.3 frames.

If you mean a dissector for a protocol that runs directly on top of
802.3 packets with a type field, you'd have your dissector, in its
"reg_handoff" routine, do

	dissector_add("ethertype", {type field value}, {handle});

where "{type field value}" is the Ethernet type field value for your
protocol, and "{handle}" is a handle for your dissector, constructed
with "create_dissector_handle()" or, if you've registered your dissector
by name in its "register" routine, found with "find_dissector()".

If you mean a dissector for a protcol that runs on top of 802.2 on top
of 802.3 packets with a length field, your protocol would have a SAP
value; you'd have your dissector, in its "reg_handoff" routine, do

	dissector_add("llc.dsap", {SAP value}, {handle});

where "{SAP value} is the SAP value for your protocol and "{handle}" is
as described above.