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

From: 刘昆 <liukunmeister@xxxxxxxxx>
Date: Tue, 07 Dec 2010 11:48:06 +0800
于 2010年12月07日 10:47, Guy Harris 写道:

On Dec 6, 2010, at 6:39 PM, 刘昆 wrote:

Thank you. Now I have noticed "data" is a pointer

I add "printf("%s\n",(pinfo->src).data)"

For almost all address types, including IPv4 and IPv6 addresses, the data field does *NOT* point to a text string.  Wireshark deals with binary packet data; it does not turn everything into nice easy-to-print strings.  If you want to get the string corresponding to the address, use Wireshark's ip_to_str() routine.
___________________________________________________________________________ Sent via: Wireshark-dev mailing list <wireshark-dev@xxxxxxxxxxxxx> Archives: http://www.wireshark.org/lists/wireshark-dev Unsubscribe: https://wireshark.org/mailman/options/wireshark-dev mailto:wireshark-dev-request@xxxxxxxxxxxxx?subject=unsubscribe
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.I think this because there are two kinds of packet in or out.So how to judge a packet is in or out ?