You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
$ ping friendpaste.com
PING friendpaste.com (94.23.221.113): 56 data bytes
64 bytes from 94.23.221.113: icmp_seq=0 ttl=54 time=36.183 ms
64 bytes from 94.23.221.113: icmp_seq=1 ttl=54 time=321.526 ms
ie, how can I get the ttl ? and packet size (for the last one I guess the payload lenght is OK) .
The text was updated successfully, but these errors were encountered:
On Sat, May 19, 2012 at 02:11:41AM -0700, Benoit Chesneau wrote:
Hi, Any idea how I could return something like :
$ ping friendpaste.com
PING friendpaste.com (94.23.221.113): 56 data bytes
64 bytes from 94.23.221.113: icmp_seq=0 ttl=54 time=36.183 ms
64 bytes from 94.23.221.113: icmp_seq=1 ttl=54 time=321.526 ms
ie, how can I get the ttl ? and packet size (for the last one I guess the payload lenght is OK) .
I checked the source for BSD ping. For the packet size, it is printing
out the size of the packet with the ICMP header removed (by default,
64-8). If you calculate the length from the packet contents that are
returned to you, it won't be exactly as in your example:
The packet is 64 bytes = 8 bytes (ICMP header) + 12 bytes timestamp (3 *
sizeof(u_int32_t), the result from erlang:now()) + 44 bytes payload.
As for ttl, gen_icmp only sees the ICMP header and payload. The TTL
is in the IP header so, at the moment, there is no way to retrieve it.
You could get a value for the TTL by using tracert.
I was wrong about the TTL. The inet driver returns the whole IPv4 packet so gen_icmp can get the value. But for IPv6, only the ICMPv6 + payload is returned. Haven't decided what to do here yet (gen_icmp could do the socket handling itself, like tracert), so leaving this issue open.
Hi, Any idea how I could return something like :
$ ping friendpaste.com
PING friendpaste.com (94.23.221.113): 56 data bytes
64 bytes from 94.23.221.113: icmp_seq=0 ttl=54 time=36.183 ms
64 bytes from 94.23.221.113: icmp_seq=1 ttl=54 time=321.526 ms
ie, how can I get the ttl ? and packet size (for the last one I guess the payload lenght is OK) .
The text was updated successfully, but these errors were encountered: