Ethereal-dev: Re: [ethereal-dev] Want to add stuff to frame_data

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

From: Richard Sharpe <sharpe@xxxxxxxxxx>
Date: Sat, 29 Jan 2000 02:33:30 +1000
At 08:40 PM 1/28/00 -0800, Guy Harris wrote:
>> So, the approach I was thinking of is as follows:
>> However, it seems that multiple layers may want to stash frame info for
>> their own use,
>
>Definitely.

[Deleted some stuff ...]

>> so it seems that what I want is a hash and routines like:
>> 
>>   void set_frame_info(frame_data *fd, gchar *protocol, void *proto_info);
>> 
>> and
>> 
>>   void *get_frame_info(frame_data *fd, gchar *protocol);
>
>Yes.  You might, however, want the "protocol" argument to be the
>integral "proto_XXX" value returned when the protocol registered itself
>with "proto_register_protocol()", rather than a string - it might make
>the hash-table searching faster (no string comparisons, hashing a
>fixed-length integral value rather than a string).

Ahhh, yes, indeed ... That's the way to do it!


Regards
-------
Richard Sharpe, sharpe@xxxxxxxxxx, Master Linux Administrator :-),
Samba (Team member, www.samba.org), Ethereal (Team member, www.zing.org)
Co-author, SAMS Teach Yourself Samba in 24 Hours
Author: First Australian 5-day, intensive, hands-on Linux SysAdmin course