diff options
author | sef <sef@FreeBSD.org> | 1996-10-05 01:43:13 +0000 |
---|---|---|
committer | sef <sef@FreeBSD.org> | 1996-10-05 01:43:13 +0000 |
commit | 92a8c6e3f90995888b299aaa8e32f376e143a3d9 (patch) | |
tree | d409fc78848fb84a7c1270207a2d1e3121cef027 /contrib | |
parent | 3259298288a43a63a0840204a55efcffcfe5be44 (diff) | |
download | FreeBSD-src-92a8c6e3f90995888b299aaa8e32f376e143a3d9.zip FreeBSD-src-92a8c6e3f90995888b299aaa8e32f376e143a3d9.tar.gz |
Print out a summary of the loss percentages for each hop. No manual changes
just yet, I know, evil of me.
Reviewed by: jkh
Diffstat (limited to 'contrib')
-rw-r--r-- | contrib/traceroute/traceroute.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/contrib/traceroute/traceroute.c b/contrib/traceroute/traceroute.c index b1b1b87..3d37b3f 100644 --- a/contrib/traceroute/traceroute.c +++ b/contrib/traceroute/traceroute.c @@ -24,7 +24,7 @@ static const char copyright[] = "@(#) Copyright (c) 1988, 1989, 1991, 1994, 1995, 1996\n\ The Regents of the University of California. All rights reserved.\n"; static const char rcsid[] = - "@(#)$Header: /home/ncvs/src/contrib/traceroute/traceroute.c,v 1.1.1.1 1996/09/30 19:09:55 fenner Exp $ (LBL)"; + "@(#)$Header: /home/ncvs/src/contrib/traceroute/traceroute.c,v 1.2 1996/09/30 19:39:25 fenner Exp $ (LBL)"; #endif /* @@ -603,9 +603,10 @@ main(int argc, char **argv) u_int32_t lastaddr = 0; int got_there = 0; int unreachable = 0; + int loss; Printf("%2d ", ttl); - for (probe = 0; probe < nprobes; ++probe) { + for (probe = 0, loss = 0; probe < nprobes; ++probe) { register int cc; struct timeval t1, t2; struct timezone tz; @@ -694,10 +695,13 @@ main(int argc, char **argv) } break; } - if (cc == 0) + if (cc == 0) { + loss++; Printf(" *"); + } (void)fflush(stdout); } + Printf(" (%d%% loss)", (int)(((float)loss / nprobes) * 100)); putchar('\n'); if (got_there || (unreachable > 0 && unreachable >= nprobes - 1)) |