Wireshark-dev: [Wireshark-dev] Access to IP header from higher-layer dissector in C

Date: Wed, 27 Apr 2022 12:59:49 +0200
Hi,

I'm really having a hard time finding a definitive answer to my
question, so I'm asking it here, hoping that someone knowledgeable
will shine some light.

I'm writing a dissector in C for a protocol that uses UDP packets as its
transport mechanism.  Nevertheless, some of the contents of the fields
in the protocol header make sense only when paired with information
from the IP header, such as the DSCP, which is not kept in any field
of pinfo.

I'm looking for a way to access these lower-layer header fields from
my dissector, but it looks like this information is entirely kept out
of my reach.  Is there a way to access, say, ip.dsfield.dscp, from the
dissector that is attached to a specific udp.port?

Thanks in advance for your help.

Ignacy