Ethereal-dev: Re: [Ethereal-dev] referencing specific tcp protocol data

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: Thu, 28 Mar 2002 12:34:04 -0800
On Fri, Mar 29, 2002 at 03:48:24AM +1030, Richard Sharpe wrote:
> A long time ago when I first started working on Ethereal, Guy suggested 
> that what we really needed for an underlying data structure is an 
> attribute-value tree. 

That *is* the data structure we have.  The tree is a GLib N-ary tree:

	http://developer.gnome.org/doc/API/glib/glib-n-ary-trees.html

with the node data being a "proto_node" as defined in <epan/proto.h>.

A "proto_node" contains a "field_info" pointer; a "field_info", as
defined in <epan/proto.h>, contains:

	a "header_field_info" pointer;

	an "fvalue_t" pointer;

	a bunch of other information.

The "header_field_info" structure points to a structure that represents
an attribute; the "fvalue_t" pointer points to a structure that
represents a value.

The only problem is that the attributes are identified by
"header_field_info" pointers rather than by name.  If we provided
routines to look up "header_field_info" structures by name, that
probably wouldn't be a problem.