Ethereal-dev: Re: [Ethereal-dev] new dissector: BACnet/IP

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

From: Guy Harris <gharris@xxxxxxxxxxxx>
Date: Sat, 31 Mar 2001 02:21:03 -0800
On Fri, Mar 30, 2001 at 02:34:34PM +0200, Hartmut Mueller wrote:
> I wrote three dissectors for the Building Automation and Control Network 
> protocol.

Checked in.

Some cleanups I made:

	I made the "next_tvb" variables local to the dissectors rather
	than global (they're not used outside the dissectors);

	I made the dissectors static (as they're not called outside the
	file in which they're defined), and removed the header files
	that declared them (as the header files are then not exporting
	anything);

	I got rid of the "CHECK_DISPLAY_AS_DATA()" calls (for any
	dissector registered in a dissector table, or registered with
	"register_dissector()" and called only through a handle, the
	check is done in the code that handles dissector tables or
	handles; the dissector doesn't have to do the check itself);

	I moved the code to set "pinfo->current_proto", and to set the
	Protocol and Info columns, before any field in the packet is
	referred to (so that they're set before any exception is
	thrown);

	I changed a number of calls to "proto_tree_add_XXX()", for
	various values of "XXX", to "proto_tree_add_item()" (if the
	field value in a "proto_tree_add_XXX()" call isn't a variable
	that's used elsewhere, or a value other than what's fetched from
	the packet, you might as well use "proto_tree_add_item()" and
	let "proto_tree_add_item()" fetch the value for you;

	I passed -1, in some cases, as the "reported length" argument to
	"tvb_new_subset()" - that lets "tvb_new_subset()" calculate the
	reported length for you (which should be based on the reported
	length of the frame, which may be greater than the amount of
	data in the frame, if the capture was done with a snapshot
	length less than the actual length of the frame).

> There are other data link layer protocols than BVLL to be implemented as 
> dissectors because it is also possible to communicate over MS/TP (EIA-485), 
> LonTalk (tm) and ARCNET. BACnet/IP was just a good starting point for me.

Hmm.

NetBSD, at least, supports ARCNET, and its libpcap and tcpdump support
ARCNET, I think; we may want to make Ethereal support it.

> I would be very happy about a Win32 version of Ethereal with BACnet included 
> because I don't have any Win32 compiler around.

The next Ethereal release will include your BACNET code.