At 10:44 PM 1/28/00 -0600, Gilbert Ramirez wrote:
>On Sat, Jan 29, 2000 at 01:33:39AM +1000, Richard Sharpe wrote:
>> Hi,
>>
>> I want to add a void *per_frame_info field to frame_data along with routins
>> to set and retrieve this info so I can support stashing info along with a
>> frame.
>>
>> This will make many things better with protocols where you have to remember
>> state between frames.
>>
>> Since we do the summary pane all in one go, we get to see each frame, and
>> we can stash things in an association, but this screws up when users are
>> randomly selecting frames and going back and forth ...
>>
>> So, the approach I was thinking of is as follows:
>>
>> On any pass over a frame, we check to see if there is frame info stashed
>> there, and if so, use that if we need to remember things about the frame,
>> but if not, look in any association we have set up.
>>
>> However, it seems that multiple layers may want to stash frame info for
>> their own use, 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);
>>
>> What say ye, oh assembled multitude?
>
>Or perhaps a linked list of these frame state structs. The number of
>protocols that need to store state is few, and I doubt there would
>be many protocols doing so in a single frame, so the cost of looking
>through a linked list would be negligible.
OK, a linked list will be good ... But I should add an initialize call, and
the space should all be allocated using one of the glib calls so it can all
be freed when we reinitialize, as we don't want memory leaks when someone
loads a new capture file ...
This suggests that the structures we allocate should be allocated carefully
as well.
>--gilbert
>
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