Ethereal-dev: Re: [Ethereal-dev] more leap stuff

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

From: Guy Harris <gharris@xxxxxxxxx>
Date: Tue, 19 Mar 2002 03:58:09 -0800
On Tue, Mar 19, 2002 at 12:56:35AM -0800, Guy Harris wrote:
> Haven't had time to figure what the global variables in it are doing,
> and whether the are really necessary.

Global variables cannot work as inter-packet communication mechanisms,
as there is no guarantee that, after the first pass through the capture
file, packets will be processed in any particular order.  The user can
randomly click on packets if they choose.

Instead, you'd need to associate the LEAP state with the packet using
the "p_add_proto_data()" routine, and get it with "p_get_proto_data()".

You should probably create conversations for LEAP messages - do it the
same way the SMB dissector does, as SMB can also run atop TCP/IP or atop
a raw link layer.  Attach a LEAP state to the conversation when you
create it, and, on the first pass through the capture (when
"pinfo->fd->flags.visited" is false), update that state, and use it to
figure out what various fields mean.

Also, attach to the packet, using "proto_eap" as the protocol key, an
indication of the LEAP state in effect for that packet.

If "pinfo->fd->flags.visited" is true, use the LEAP state information
attached to the packet to determine what the fields mean.