Wireshark mailing list archives

Re: How to access lower level protocol data from a higher level dissector


From: Guy Harris <guy () alum mit edu>
Date: Fri, 30 Aug 2019 10:36:38 -0700

On Aug 30, 2019, at 10:17 AM, Richard Sharpe <realrichardsharpe () gmail com> wrote:

On Fri, Aug 30, 2019 at 10:00 AM Dylan Ulis <dylan.ulis () gmail com> wrote:

How can I get lower level protocol data in a higher level dissector? eg: I'd like to get the source/destination MAC 
address in my application layer dissector.

Isn't that info in the pinfo?

Yes, they're pinfo->dl_src and pinfo->dl_dst.

Do *NOT* assume that they are addresses of type AT_ETHER unless you can guarantee that your dissector is only called 
for packets that *have* MAC addresses (for example, if your protocol runs atop IPv4 or IPv6, you can't guarantee that).
___________________________________________________________________________
Sent via:    Wireshark-dev mailing list <wireshark-dev () wireshark org>
Archives:    https://www.wireshark.org/lists/wireshark-dev
Unsubscribe: https://www.wireshark.org/mailman/options/wireshark-dev
             mailto:wireshark-dev-request () wireshark org?subject=unsubscribe

Current thread: