diff options
Diffstat (limited to 'contrib')
-rw-r--r-- | contrib/traceroute/traceroute.8 | 6 | ||||
-rw-r--r-- | contrib/traceroute/traceroute.c | 12 |
2 files changed, 13 insertions, 5 deletions
diff --git a/contrib/traceroute/traceroute.8 b/contrib/traceroute/traceroute.8 index 031ca47..fa3484e 100644 --- a/contrib/traceroute/traceroute.8 +++ b/contrib/traceroute/traceroute.8 @@ -13,7 +13,7 @@ .\" IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED .\" WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. .\" -.\" $Header: traceroute.8,v 1.7 96/09/27 20:02:41 leres Exp $ +.\" $Header: /home/ncvs/src/contrib/traceroute/traceroute.8,v 1.1.1.1 1996/09/30 19:09:55 fenner Exp $ .\" .TH TRACEROUTE 8 "27 September 1996" .UC 6 @@ -24,7 +24,7 @@ traceroute \- print the route packets take to network host .na .B traceroute [ -.B \-dnrv +.B \-Sdnrv ] [ .B \-g .I gw_host @@ -75,6 +75,8 @@ name. .PP Other options are: .TP +.B \-S +Print a summary of how many probes were not answered for each hop. .B \-g Specify a loose source route gateway (8 maximum). .TP diff --git a/contrib/traceroute/traceroute.c b/contrib/traceroute/traceroute.c index 3d37b3f..a214352 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.2 1996/09/30 19:39:25 fenner Exp $ (LBL)"; + "@(#)$Header: /home/ncvs/src/contrib/traceroute/traceroute.c,v 1.3 1996/10/05 01:43:13 sef Exp $ (LBL)"; #endif /* @@ -313,6 +313,7 @@ main(int argc, char **argv) register int tos = 0; register int lsrr = 0; register int optlen = 0; + int sump = 0; int sockerrno; /* @@ -337,9 +338,12 @@ main(int argc, char **argv) prog = argv[0]; opterr = 0; - while ((op = getopt(argc, argv, "dnrvg:m:p:q:s:t:w:")) != EOF) + while ((op = getopt(argc, argv, "Sdnrvg:m:p:q:s:t:w:")) != EOF) switch (op) { + case 'S': + sump = 1; + break; case 'd': options |= SO_DEBUG; break; @@ -701,7 +705,9 @@ main(int argc, char **argv) } (void)fflush(stdout); } - Printf(" (%d%% loss)", (int)(((float)loss / nprobes) * 100)); + if (sump) { + Printf(" (%d%% loss)", (lost * 100) / nprobes); + } putchar('\n'); if (got_there || (unreachable > 0 && unreachable >= nprobes - 1)) |