Ethereal-dev: Re: [ethereal-dev] Dissector for the Session Announcement Protocol (SAP)

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

From: Guy Harris <guy@xxxxxxxxxx>
Date: Tue, 16 Nov 1999 15:53:07 -0800 (PST)
> Now the worries. Is there a clean way to access the IP header 
> information from the UDP dissector?

The IP header in its entirety?  No, at least not at present.  However...

> Dissecting a packet as a SAP 
> packet is only meaningful if the packet was sent to a multicast IP 
> address. Currently my dissector does not (can not?) check the 
> destination IP address

...if all you care about is the destination IP address, you can check
"pi.dst", which is an object of type "address".  It's a structure, with
members "type", "len", and "data":

	"type" is the type of address, which would be AT_IPv4 for IPv4
	addresses and AT_IPv6 for IPv6 addresses;

	"len" is the length of the address (which, for some address
	types, isn't fixed);

	"data" is a pointer to the actual address data.