minix/usr.sbin/traceroute/mean.awk
Ben Gras 7f5f010bbd netbsd ping & traceroute
. remove minix ping
	. add support for socket(AF_INET, SOCK_RAW, {IPPROTO_ICMP,IPPROTO_UDP})
	. gives test48 a better chance of detecting network connectivity

Change-Id: Ia678546d27ac378642f1160a141e1fc33458cce2
2014-08-21 08:07:39 -04:00

14 lines
296 B
Awk

#!/bin/awk -f
# $NetBSD: mean.awk,v 1.5 1997/10/04 16:31:29 christos Exp $
/^ *[0-9]/ {
# print out the average time to each hop along a route.
tottime = 0; n = 0;
for (f = 5; f <= NF; ++f) {
if ($f == "ms") {
tottime += $(f - 1)
++n
}
}
if (n > 0)
print $1, tottime/n, median
}