Wireshark-dev: Re: [Wireshark-dev] I want to print the string tvb->real_data on the ubuntu term
From: Guy Harris <guy@xxxxxxxxxxxx>
Date: Mon, 25 Oct 2010 23:13:27 -0700
On Oct 25, 2010, at 8:46 PM, 刘昆 wrote:

> In fact ,all I need to print is just the URL or IP address in the 
> payload.I think the URL or IP address should be printable?

The URL should be printable.

The IP address, if you mean the IP address in the IP header, is *NOT* printable; in an IP datagram, it's encoded as 4 octets for an IPv4 address and 16 octets for an IPv6 address.  If, instead, you mean the host name in the URL or in the Host: header, that is printable.

> So can I fetch  the URL to print? And how?

What *exactly* is it that you're trying to do?  You might be able to do what you want with TShark and the "-e" option - the URI in a request is the field named "http.request.uri".  The IP source address is the field named "ip.src" or "ipv6.src", and the IP destination address is the field named "ip.dst" or "ipv6.dst".  The host name in the "Host:" header is the field named "http.host" (*IF* the packet has a "Host:" header).