Ethereal-dev: [ethereal-dev] New header_field_info

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

From: Gilbert Ramirez <gram@xxxxxxxxxx>
Date: Tue, 12 Oct 1999 02:04:44 -0500
I just checked in the code for the new header_field_info
structs. Laurent -- I know you're on a mission to convert
protocols to be filterable, so you'll have to add a couple
of fields to the header_field_info structs you create. You'll
see that it's pretty easy to do so --- I converted all
the existing hfinfo's w/o problem, but that's because I
didn't try to go back and re-work the bitfield stuff in
the dissector (except a little bit in token-ring).

The new method:
	1. Allows you to dissect bitfields and add them
		to the proto_tree more easily.
	2. Allows users to filter on the value of a field,
		even if that field comes from a bitfield
		where its value is shifted over a few bits.
	3. Allows value_strings to have keys which represent
		the true values of the bitfield fields, not
		their shifted values.
	4. Lets you print in hexadecimal w/o reverting to
		proto_tree_add_item_format().

I have tried to document the new structure in doc/proto_tree.
packet-sna.c, which I also checked in, is full of examples
of how to use bitfields with the new hfinfo structs.

At http://ethereal.zing.org/~gram/sample.html I have
the file I sent out on ethereal-dev the other week,
sna1.trc.gz. You can use it to see what the SNA dissector
looks like. The SNA dissector is not complete yet; I have
to put in a few more TH types (FID's >= 4).


--gilbert