diff options
author | Thomas Habets <thomas@habets.se> | 2014-05-22 14:01:05 +0100 |
---|---|---|
committer | Thomas Habets <thomas@habets.se> | 2014-05-22 14:01:05 +0100 |
commit | c27a5d943f0af32fcaff8a476f3112b1075dc0ae (patch) | |
tree | ef4bb3929bd33ae9615e99e33f65c7978b980fe3 | |
parent | 850c5a4b81969956efef6ed30a0df47bd57afe7c (diff) | |
download | arping-c27a5d943f0af32fcaff8a476f3112b1075dc0ae.tar.gz |
Add -W <sec> option.
Just like -w but in floating point seconds instead of microseconds.
-rw-r--r-- | doc/arping.8 | 8 | ||||
-rw-r--r-- | doc/arping.yodl | 7 | ||||
-rwxr-xr-x | extra/testing.ex | 1 | ||||
-rw-r--r-- | src/arping.c | 9 |
4 files changed, 21 insertions, 4 deletions
diff --git a/doc/arping.8 b/doc/arping.8 index 9036a3f..df54d31 100644 --- a/doc/arping.8 +++ b/doc/arping.8 @@ -120,8 +120,10 @@ to update the neighbours\(cq\& ARP caches\&. $ arping \-i <interface> \-U <interface IP> .IP "\-v" Verbose output\&. Use twice for more messages\&. -.IP "\-w" +.IP "\-w \fIusec\fP" Time to wait between pings, in microseconds\&. +.IP "\-W \fIsec\fP" +Same as \-w, but in floating point seconds\&. .PP .SH "EXAMPLES" @@ -145,6 +147,10 @@ ARPING 00:11:85:4c:01:01 \-\-\- 00:11:85:4c:01:01 statistics \-\-\- 3 packets transmitted, 3 packets received, 0% unanswered .PP +# \fBarping \-C 2 \-c 10 \-r 88\&.1\&.180\&.225\fP +00:11:85:4c:01:01 +00:11:85:4c:01:01 +.PP .fi .in .PP diff --git a/doc/arping.yodl b/doc/arping.yodl index 630e93c..55e5aad 100644 --- a/doc/arping.yodl +++ b/doc/arping.yodl @@ -94,7 +94,8 @@ mancommand(.sp) mancommand(.sp) $ arping -i <interface> -U <interface IP> dit(-v) Verbose output. Use twice for more messages. - dit(-w) Time to wait between pings, in microseconds. + dit(-w em(usec)) Time to wait between pings, in microseconds. + dit(-W em(sec)) Same as -w, but in floating point seconds. enddit() @@ -119,6 +120,10 @@ mancommand(.sp) --- 00:11:85:4c:01:01 statistics --- 3 packets transmitted, 3 packets received, 0% unanswered + # bf(arping -C 2 -c 10 -r 88.1.180.225) + 00:11:85:4c:01:01 + 00:11:85:4c:01:01 + mancommand(.fi) mancommand(.in) diff --git a/extra/testing.ex b/extra/testing.ex index 38c4a49..f7d2a22 100755 --- a/extra/testing.ex +++ b/extra/testing.ex @@ -29,6 +29,7 @@ # * -u (soon) # * -v (soon) # * -w (soon) +# * -W (soon) # # Not tested here: # * -0 diff --git a/src/arping.c b/src/arping.c index a42779c..93f27c9 100644 --- a/src/arping.c +++ b/src/arping.c @@ -372,7 +372,8 @@ extended_usage() " pinging MACs.\n" " -U Send unsolicited ARP.\n" " -v Verbose output. Use twice for more messages.\n" - " -w Time to wait between pings, in microseconds.\n"); + " -w Time to wait between pings, in microseconds.\n" + " -W Same as -w, but in floating point seconds.\n"); printf("Report bugs to: thomas@habets.se\n" "Arping home page: <http://www.habets.pp.se/synscan/>\n" "Development repo: http://github.com/ThomasHabets/arping\n"); @@ -387,6 +388,7 @@ standard_usage() printf("ARPing %s, by Thomas Habets <thomas@habets.se>\n", version); printf("usage: arping [ -0aAbdDeFpqrRuUv ] [ -w <us> ] " + "[ -W <sec> ] " "[ -S <host/ip> ]\n" " " "[ -T <host/ip ] " @@ -1058,7 +1060,7 @@ int main(int argc, char **argv) memcpy(dstmac, ethxmas, ETH_ALEN); while (EOF != (c = getopt(argc, argv, - "0aAbBC:c:dDeFhi:I:pqrRs:S:t:T:uUvw:"))) { + "0aAbBC:c:dDeFhi:I:pqrRs:S:t:T:uUvw:W:"))) { switch(c) { case '0': srcip = 0; @@ -1204,6 +1206,9 @@ int main(int argc, char **argv) case 'w': packetwait = (unsigned)atoi(optarg); break; + case 'W': + packetwait = (unsigned)(1000000.0 * atof(optarg)); + break; default: usage(1); } |