@@ -14,7 +14,7 @@
<refsynopsisdiv>
<cmdsynopsis>
<command>ping</command>
-<arg choice="opt"><option>-LRUbdfnqrvVaAB</option></arg>
+<arg choice="opt"><option>-LRUbdfnqrvVaABDO</option></arg>
<arg choice="opt">-c <replaceable/count/</arg>
<arg choice="opt">-m <replaceable/mark/</arg>
<arg choice="opt">-i <replaceable/interval/</arg>
@@ -246,6 +246,14 @@
</para></listitem>
</varlistentry>
<varlistentry>
+ <term><option/-O/</term>
+ <listitem><para>
+Report outstanding ICMP ECHO reply before sending next packet.
+This is useful together with the timestamp <option>-D</option> to
+log output to a diagnostic file and search for missing answers.
+ </para></listitem>
+ </varlistentry>
+ <varlistentry>
<term><option>-p <replaceable/pattern/</option></term>
<listitem><para>
You may specify up to 16 ``pad'' bytes to fill out the packet you send.
@@ -1554,7 +1554,7 @@
void usage(void)
{
fprintf(stderr,
-"Usage: ping6 [-LUdfnqrvVaAD] [-c count] [-i interval] [-w deadline]\n"
+"Usage: ping6 [-LUdfnqrvVaADO] [-c count] [-i interval] [-w deadline]\n"
" [-p pattern] [-s packetsize] [-t ttl] [-I interface]\n"
" [-M pmtudisc-hint] [-S sndbuf] [-F flowlabel] [-Q tclass]\n"
" [[-N nodeinfo-option] ...]\n"
@@ -1232,7 +1232,7 @@
void usage(void)
{
fprintf(stderr,
-"Usage: ping [-LRUbdfnqrvVaAD] [-c count] [-i interval] [-w deadline]\n"
+"Usage: ping [-LRUbdfnqrvVaADO] [-c count] [-i interval] [-w deadline]\n"
" [-p pattern] [-s packetsize] [-t ttl] [-I interface]\n"
" [-M pmtudisc-hint] [-m mark] [-S sndbuf]\n"
" [-T tstamp-options] [-Q tos] [hop1 ...] destination\n");
@@ -172,6 +172,9 @@
exit(2);
}
break;
+ case 'O':
+ options |= F_OUTSTANDING;
+ break;
case 'S':
sndbuf = atoi(optarg);
if (sndbuf <= 0) {
@@ -349,6 +352,14 @@
tokens = ntokens - interval;
}
+ if (options & F_OUTSTANDING) {
+ if (ntransmitted > 0 && !TST(ntransmitted % mx_dup_ck)) {
+ print_timestamp();
+ printf("no answer yet for icmp_seq=%lu\n", (ntransmitted % mx_dup_ck));
+ fflush(stdout);
+ }
+ }
+
resend:
i = send_probe();
@@ -62,6 +62,7 @@
#define F_TTL 0x20000
#define F_MARK 0x40000
#define F_PTIMEOFDAY 0x80000
+#define F_OUTSTANDING 0x100000
/*
* MAX_DUP_CHK is the number of bits in received table, i.e. the maximum
@@ -121,9 +122,9 @@
case 'S': case 'n': case 'p': case 'q': \
case 'r': case 's': case 'v': case 'L': \
case 't': case 'A': case 'W': case 'B': case 'm': \
-case 'D':
+case 'D': case 'O':
-#define COMMON_OPTSTR "h?VQ:I:M:aUc:dfi:w:l:S:np:qrs:vLt:AW:Bm:D"
+#define COMMON_OPTSTR "h?VQ:I:M:aUc:dfi:w:l:S:np:qrs:vLt:AW:Bm:DO"
/*