Ethereal-dev: Re: [Ethereal-dev] packet_info v/s frame_data

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

From: Guy Harris <gharris@xxxxxxxxxxxx>
Date: Wed, 21 Mar 2001 20:26:34 -0800
On Thu, Mar 22, 2001 at 09:33:13AM +0600, Diwakar Shetty wrote:
> There is some information which i get during first pass of dissector and
> which I have to maintain per packet.  This field will be used for later
> processing and should not be modified after first pass.

Then you should use the "p_add_proto_data()" call to attach your own
private data structure to the packet, and use the "p_get_proto_data()"
call to fetch that data.

> The following code WORKS :
> 
> if (pinfo->fd->flags.visited == 0)
>             pinfo->fd->old_len = tvb_length_remaining(tvb, offset);

"pinfo->fd" points to a "frame_data" structure.

A "frame_data" structure does not contain an "old_len" field.

So how can that code possibly work?  How can it even *compile*?