Ethereal-dev: Re: [ethereal-dev] Dissector for the Session Announcement Protocol (SAP)

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

From: Guy Harris <guy@xxxxxxxxxx>
Date: Tue, 16 Nov 1999 18:27:39 -0800 (PST)
> I have added a dissector for the Session Announcement Protocol 
> (SAP) which is responsible for bringing you the multicast session 
> advertisements that the sdr program displays.

Checked in.

> Also I'm worrying if I got all the things right in my patch and 
> the dissector file. If everything looks acceptable,

I didn't see anything obviously unacceptable; the only nits I could see
are that in the "%d byte%s" printouts

	1) the byte count is an unsigned number, so you might want to
	   print it with "%u" (but it's unlikely to be big enough to
	   make a difference);

	2) there's a "plurality()" macro in "packet.h" to let you do

		plurality(auth_len-1, "", "s")

	   to add the "s";

but, as noted, those are nits.

The patch needed some tweaking, as the statically-defined ETT_ values
are now dynamic "ett_" variables allocated at protocol registration time
(done for the benefit of the run-time-loadable protocol stuff Olivier
Abad is doing, but it also reduces the need to edit "packet.h" when
adding more stuff to a dissector); you might want to work from the CVS
tree, available by anonymous CVS (see instructions on the Ethereal Web
site), if you're doing more dissectors.

I also had to rename the Netware SAP dissector to "dissect_ipxsap()" to
eliminate a complaint about "dissect_sap()" being declared "static" in
"packet-ipx.c" and not static in "packet.h".  (We should be able to use
the stuff Olivier did for dynamically-loaded dissectors for compiled-in
dissectors, reducing the extent to which "packet.h" has to know about
every dissector, and allowing the user to specify that protocols on port
XXX should be dissected as protocol YYY.)