Ethereal-dev: Re: [ethereal-dev] New proto_tree patch

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: Fri, 2 Jul 1999 21:53:45 -0700 (PDT)
> 1) It should not be compulsory to register each and every
> field. Complex protocols like RSVP and SMB will essentially end up
> doubling their code size or more.

It appears that "proto_register_field" fills in all the fields of
"struct header_field_info" that aren't to be specified by the protocol
dissector; an alternative might be to have a protocol dissector contain
an array of all fields for the protocol, and have a routine that takes,
as an argument, a pointer to that array and a count of elements in the
array, and registers all of them.

The amount of stuff you'd type when writing a protocol dissector
wouldn't necessarily change - you'd type in an entry in the array rather
than a call to "proto_register_field()" - but code would be replaced by
data, and the data in question would have to exist *anyway*, as, in the
old scheme, it'd have been allocated by "proto_register_field()".

> There should be a default value for
> hfindex which indicates "put this in the tree here, but I don't ever
> care about filtering on it".

Presumably "Match Selected" will use this new filtering mechanism...

...in which case, can we be certain that nobody will ever care about
filtering on a particular field?