summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--arping.c9
-rw-r--r--doc/arping.xml6
2 files changed, 13 insertions, 2 deletions
diff --git a/arping.c b/arping.c
index 3998d97..80acad0 100644
--- a/arping.c
+++ b/arping.c
@@ -79,6 +79,7 @@ int dad, unsolicited, advert;
int quiet;
int count = -1;
int timeout;
+unsigned int interval = 1;
int unicasting;
int socketfd;
int broadcast_only;
@@ -125,6 +126,7 @@ void usage(void)
" -V print version and exit\n"
" -c <count> how many packets to send\n"
" -w <timeout> how long to wait for a reply\n"
+ " -i <interval> set interval between packets (default: 1 second)\n"
" -I <device> which ethernet device to use"
#ifdef DEFAULT_DEVICE_STR
"(" DEFAULT_DEVICE_STR ")"
@@ -382,7 +384,7 @@ void catcher(void)
* unsolicited mode */
finish();
}
- alarm(1);
+ alarm(interval);
}
void print_hex(unsigned char *p, int len)
@@ -1004,7 +1006,7 @@ main(int argc, char **argv)
disable_capability_raw();
- while ((ch = getopt(argc, argv, "h?bfDUAqc:w:s:I:V")) != EOF) {
+ while ((ch = getopt(argc, argv, "h?bfDUAqc:w:i:s:I:V")) != EOF) {
switch(ch) {
case 'b':
broadcast_only=1;
@@ -1029,6 +1031,9 @@ main(int argc, char **argv)
case 'w':
timeout = atoi(optarg);
break;
+ case 'i':
+ interval = (unsigned int)atoi(optarg);
+ break;
case 'I':
device.name = optarg;
break;
diff --git a/doc/arping.xml b/doc/arping.xml
index a20e3be..0c7db21 100644
--- a/doc/arping.xml
+++ b/doc/arping.xml
@@ -23,6 +23,7 @@
<arg choice='opt'>-AbDfhqUV </arg>
<arg choice='opt'>-c <replaceable>count</replaceable></arg>
<arg choice='opt'>-w <replaceable>deadline</replaceable></arg>
+ <arg choice='opt'>-i <replaceable>interval</replaceable></arg>
<arg choice='opt'>-s <replaceable>source</replaceable></arg>
<arg choice='opt'>-I <replaceable>interface</replaceable></arg>
<arg choice='plain'><replaceable>destination</replaceable></arg>
@@ -133,6 +134,11 @@ expire or until
probes are answered.</para>
</listitem>
</varlistentry>
+ <varlistentry>
+ <term><option>-i </option><emphasis remap='I'>interval</emphasis></term>
+ <listitem><para>Specify an interval, in seconds, between packets.</para>
+ </listitem>
+ </varlistentry>
</variablelist>
</refsect1>