Huge thanks to our Platinum Members Endace and LiveAction,
and our Silver Member Veeam, for supporting the Wireshark Foundation and project.

Ethereal-dev: [Ethereal-dev] How to extract data from earlier dissectors for the same packet?

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

From: "Ronnie Sahlberg" <rsahlber@xxxxxxxxxxxxxx>
Date: Sun, 11 Mar 2001 22:02:51 +1100
Hi,

I am playing with a dissector, however, when dissecting the packets in this
protocol
it would be very convenient to have access to the data extracted by
lower-layer dissectors for
thge same packet.
Is this possible, and how would I access this data?

Assume I dissect a layer-5 protocol, would it be possible from this
dissector to access
say the ip.saddr  field of the underlying ip-dissector which has already
dissected the ip-layer?

Something like
ptr=find_value_in_packet(current_packet_id(),"ip.saddr");

---
second question,
assume I would need to reset some datastructures before a capture is started
or loaded from file,
is there a common routine where I can add calls to my "clean up previous"
and "prepare for new data"
routines?

best regards   ronnie s