From 1bd10ba2d9101c358cb7f02fe9a9d38424404a53 Mon Sep 17 00:00:00 2001 From: Ruslan Ermilov Date: Tue, 11 Mar 2003 20:12:39 +0000 Subject: [PATCH] Fix and sync SYNOPSIS and usage(). Prodded by: bde --- sbin/ping/ping.8 | 44 ++++++++++++++++++++++++++++++++------------ sbin/ping/ping.c | 24 ++++++++++++------------ 2 files changed, 44 insertions(+), 24 deletions(-) diff --git a/sbin/ping/ping.8 b/sbin/ping/ping.8 index 9941e2f9cb1..71fa31a8cec 100644 --- a/sbin/ping/ping.8 +++ b/sbin/ping/ping.8 @@ -42,11 +42,11 @@ packets to network hosts .Sh SYNOPSIS .Nm -.Op Fl AaDdfMnoQqRrv +.Op Fl AaDdfnoQqRrv .Op Fl c Ar count .Op Fl i Ar wait .Op Fl l Ar preload -.Op Fl M Ar mask | time +.Op Fl M Cm mask | time .Op Fl m Ar ttl .Op Fl P Ar policy .Op Fl p Ar pattern @@ -54,10 +54,22 @@ packets to network hosts .Op Fl s Ar packetsize .Op Fl t Ar timeout .Op Fl z Ar tos -.Ar host | -.Op Fl L -.Op Fl I Ar interface +.Ar host +.Nm +.Op Fl AaDdfLnoQqRrv +.Op Fl c Ar count +.Op Fl I Ar iface +.Op Fl i Ar wait +.Op Fl l Ar preload +.Op Fl M Cm mask | time +.Op Fl m Ar ttl +.Op Fl P Ar policy +.Op Fl p Ar pattern +.Op Fl S Ar src_addr +.Op Fl s Ar packetsize .Op Fl T Ar ttl +.Op Fl t Ar timeout +.Op Fl z Ar tos .Ar mcast-group .Sh DESCRIPTION The @@ -130,7 +142,7 @@ Only the super-user may use this option. .Bf -emphasis This can be very hard on a network and should be used with caution. .Ef -.It Fl I Ar interface +.It Fl I Ar iface Source multicast packets with the given interface address. This flag only applies if the ping destination is a multicast address. .It Fl i Ar wait @@ -155,14 +167,22 @@ is specified, sends that many packets as fast as possible before falling into its normal mode of behavior. Only the super-user may use this option. -.It Fl M Ar mask | time -Use ICMP_MASKREQ or ICMP_TSTAMP instead of ICMP_ECHO. For -.Ar mask , -print the netmask of the remote machine. Set the +.It Fl M Cm mask | time +Use +.Dv ICMP_MASKREQ +or +.Dv ICMP_TSTAMP +instead of +.Dv ICMP_ECHO . +For +.Cm mask , +print the netmask of the remote machine. +Set the .Va net.inet.icmp.maskrepl -MIB variable to enable ICMP_MASKREPLY. +MIB variable to enable +.Dv ICMP_MASKREPLY . For -.Ar time , +.Cm time , print the origination, reception and transmission timestamps. .It Fl m Ar ttl Set the IP Time To Live for outgoing packets. diff --git a/sbin/ping/ping.c b/sbin/ping/ping.c index 5ea9d5343dc..84129eac287 100644 --- a/sbin/ping/ping.c +++ b/sbin/ping/ping.c @@ -1579,25 +1579,25 @@ fill(bp, patp) static void usage() { - (void)fprintf(stderr, + (void)fprintf(stderr, "%s\n%s\n%s\n%s\n%s\n%s\n", + +"usage: ping [-AaDdfnoQqRrv] [-c count] [-i wait] [-l preload] [-M mask | time]", +" [-m ttl]" #ifdef IPSEC #ifdef IPSEC_POLICY_IPSEC -"%s\n%s\n%s%s\n%s\n", -#else -"%s\n%s\n%s\n%s\n", +" [-P policy]" #endif -#else -"%s\n%s\n%s\n%s\n", #endif - -"usage: ping [-AaDdfnoQqRrv] [-c count] [-i wait] [-l preload]", -" [-M mask | time] [-m ttl] [-p pattern] [-S src_addr]", -" [-s packetsize] [-t timeout] [-z tos]", +" [-p pattern] [-S src_addr] [-s packetsize]", +" [-t timeout] [-z tos] host", +" ping [-AaDdfLnoQqRrv] [-c count] [-I iface] [-i wait] [-l preload]", +" [-M mask | time] [-m ttl]" #ifdef IPSEC #ifdef IPSEC_POLICY_IPSEC -" [-P policy]", +" [-P policy]" #endif #endif -" [host | [-L] [-I iface] [-T ttl] mcast-group]"); +" [-p pattern] [-S src_addr]", +" [-s packetsize] [-T ttl] [-t timeout] [-z tos] mcast-group"); exit(EX_USAGE); } -- 2.45.2