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 18:47:42 -0800

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.