summaryrefslogtreecommitdiffstats
path: root/contrib/traceroute/traceroute.c
diff options
context:
space:
mode:
authorsef <sef@FreeBSD.org>1996-10-08 02:44:26 +0000
committersef <sef@FreeBSD.org>1996-10-08 02:44:26 +0000
commitc3ba3806b824423e48af6f0ad513c4be0efd1499 (patch)
tree8040d9462a885487d34f88a1af1349740bed81c3 /contrib/traceroute/traceroute.c
parenta7a5567c4d28c051575a2ac6d6e9513c2dccf5bb (diff)
downloadFreeBSD-src-c3ba3806b824423e48af6f0ad513c4be0efd1499.zip
FreeBSD-src-c3ba3806b824423e48af6f0ad513c4be0efd1499.tar.gz
Paul objected to my previous change. This adds the same functionality
(implemented better, admittedly) with a new option, '-S'. If the maintainers of traceroute (Van?) add a -S option, we will then be in conflict. Also added a too-brief description of the option in the man page. Someone with a better command of English than I at the moment should probably look over it and rephrase it. Reviewed by: pst, jkh
Diffstat (limited to 'contrib/traceroute/traceroute.c')
-rw-r--r--contrib/traceroute/traceroute.c12
1 files changed, 9 insertions, 3 deletions
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))
OpenPOWER on IntegriCloud