ANNOUNCEMENT: Live Wireshark University & Allegro Packets online APAC Wireshark Training Session
April 17th, 2024 | 14:30-16:00 SGT (UTC+8) | Online

Wireshark-dev: Re: [Wireshark-dev] where can I find the ip src address in packet-http.c

From: Guy Harris <guy@xxxxxxxxxxxx>
Date: Mon, 6 Dec 2010 19:56:49 -0800

On Dec 6, 2010, at 7:48 PM, 刘昆 wrote:

I have solve this problem about get ip address.However there is another question,When I print the ip address I notice there are two ip addresses I get.

Yes, there are two IP addresses in every IP packet - the source address, pinfo->src, and the destination address, pinfo->dst.  pinfo->src has only one IP address, and pinfo->dot has only one IP address.

I think this because there are two kinds of packet in or out.So how to judge a packet is in or out ? 

What do you mean by "in" and "out"?  For HTTP traffic, you usually have traffic going from the client (for example, a browser) to the server, and traffic going from the server to the client.  You would have to look at whether the packet is an HTTP request (which goes from the client to the server) or an HTTP reply (which goes from the server to the client) to determine in which direction the packet is going.