Ethereal-dev: Re: [Ethereal-dev] access to previous packet data

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, 21 Mar 2006 10:20:17 -0800 (PST)
rotfuchs@xxxxxxxxxxxxxxxxxxxxx wrote:

> is it possible to access data from a previous
> per_packet_data_structure? I tried it with      "prev_frame_data =
> p_get_proto_data(pinfo->fd->prev, proto_iec);"
>
> Should this work

I'd expect it to work *IF*

    1) there *is* a previous frame (i.e., pinfo->fd->prev is not null)

and

    2) that frame has a per-packet data structure for the IEC protocol
associated with it.

Note that pinfo->fd->prev refers to the previous packet in the capture,
not the previous packet with a proto_iec item in it.

> or am i barking up the wrong tree?

You might be - you might, for example, want to do whatever you're doing
with a per-conversation data structure plus per-packet data structures. 
What is it you're trying to do?