ping: add -H option for enabling reverse DNS lookup
This is the reverse of the -n flag. Submitted by: Ján Sučan <sucanjan@gmail.com> Sponsored by: Google LLC (Google Summer of Code 2019) Differential Revision: https://reviews.freebsd.org/D21356
This commit is contained in:
parent
71a2818142
commit
99f13ae12c
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=351354
@ -28,7 +28,7 @@
|
|||||||
.\" @(#)ping.8 8.2 (Berkeley) 12/11/93
|
.\" @(#)ping.8 8.2 (Berkeley) 12/11/93
|
||||||
.\" $FreeBSD$
|
.\" $FreeBSD$
|
||||||
.\"
|
.\"
|
||||||
.Dd March 11, 2016
|
.Dd August 21, 2019
|
||||||
.Dt PING 8
|
.Dt PING 8
|
||||||
.Os
|
.Os
|
||||||
.Sh NAME
|
.Sh NAME
|
||||||
@ -38,7 +38,7 @@
|
|||||||
packets to network hosts
|
packets to network hosts
|
||||||
.Sh SYNOPSIS
|
.Sh SYNOPSIS
|
||||||
.Nm
|
.Nm
|
||||||
.Op Fl AaDdfnoQqRrv
|
.Op Fl AaDdfHnoQqRrv
|
||||||
.Op Fl c Ar count
|
.Op Fl c Ar count
|
||||||
.Op Fl G Ar sweepmaxsize
|
.Op Fl G Ar sweepmaxsize
|
||||||
.Op Fl g Ar sweepminsize
|
.Op Fl g Ar sweepminsize
|
||||||
@ -56,7 +56,7 @@ packets to network hosts
|
|||||||
.Op Fl z Ar tos
|
.Op Fl z Ar tos
|
||||||
.Ar host
|
.Ar host
|
||||||
.Nm
|
.Nm
|
||||||
.Op Fl AaDdfLnoQqRrv
|
.Op Fl AaDdfHLnoQqRrv
|
||||||
.Op Fl c Ar count
|
.Op Fl c Ar count
|
||||||
.Op Fl I Ar iface
|
.Op Fl I Ar iface
|
||||||
.Op Fl i Ar wait
|
.Op Fl i Ar wait
|
||||||
@ -157,6 +157,14 @@ Specify the size of
|
|||||||
.Tn ICMP
|
.Tn ICMP
|
||||||
payload to start with when sending sweeping pings.
|
payload to start with when sending sweeping pings.
|
||||||
The default value is 0.
|
The default value is 0.
|
||||||
|
.It Fl H
|
||||||
|
Hostname output.
|
||||||
|
Try to do a reverse DNS lookup when displaying addresses.
|
||||||
|
This is the opposite of
|
||||||
|
.Fl n ,
|
||||||
|
and it is the default behavior.
|
||||||
|
.Nm
|
||||||
|
utility tries reverse-lookup by default.
|
||||||
.It Fl h Ar sweepincrsize
|
.It Fl h Ar sweepincrsize
|
||||||
Specify the number of bytes to increment the size of
|
Specify the number of bytes to increment the size of
|
||||||
.Tn ICMP
|
.Tn ICMP
|
||||||
|
@ -297,7 +297,7 @@ main(int argc, char *const *argv)
|
|||||||
|
|
||||||
outpack = outpackhdr + sizeof(struct ip);
|
outpack = outpackhdr + sizeof(struct ip);
|
||||||
while ((ch = getopt(argc, argv,
|
while ((ch = getopt(argc, argv,
|
||||||
"Aac:DdfG:g:h:I:i:Ll:M:m:nop:QqRrS:s:T:t:vW:z:"
|
"Aac:DdfG:g:Hh:I:i:Ll:M:m:nop:QqRrS:s:T:t:vW:z:"
|
||||||
#ifdef IPSEC
|
#ifdef IPSEC
|
||||||
#ifdef IPSEC_POLICY_IPSEC
|
#ifdef IPSEC_POLICY_IPSEC
|
||||||
"P:"
|
"P:"
|
||||||
@ -363,6 +363,9 @@ main(int argc, char *const *argv)
|
|||||||
options |= F_SWEEP;
|
options |= F_SWEEP;
|
||||||
sweepmin = ltmp;
|
sweepmin = ltmp;
|
||||||
break;
|
break;
|
||||||
|
case 'H':
|
||||||
|
options &= ~F_NUMERIC;
|
||||||
|
break;
|
||||||
case 'h': /* Packet size increment for ping sweep */
|
case 'h': /* Packet size increment for ping sweep */
|
||||||
ltmp = strtol(optarg, &ep, 0);
|
ltmp = strtol(optarg, &ep, 0);
|
||||||
if (*ep || ep == optarg || ltmp < 1)
|
if (*ep || ep == optarg || ltmp < 1)
|
||||||
@ -1743,11 +1746,11 @@ usage(void)
|
|||||||
{
|
{
|
||||||
|
|
||||||
(void)fprintf(stderr, "%s\n%s\n%s\n%s\n%s\n%s\n%s\n%s\n",
|
(void)fprintf(stderr, "%s\n%s\n%s\n%s\n%s\n%s\n%s\n%s\n",
|
||||||
"usage: ping [-AaDdfnoQqRrv] [-c count] [-G sweepmaxsize] [-g sweepminsize]",
|
"usage: ping [-AaDdfHnoQqRrv] [-c count] [-G sweepmaxsize] [-g sweepminsize]",
|
||||||
" [-h sweepincrsize] [-i wait] [-l preload] [-M mask | time] [-m ttl]",
|
" [-h sweepincrsize] [-i wait] [-l preload] [-M mask | time] [-m ttl]",
|
||||||
" " SECOPT " [-p pattern] [-S src_addr] [-s packetsize] [-t timeout]",
|
" " SECOPT " [-p pattern] [-S src_addr] [-s packetsize] [-t timeout]",
|
||||||
" [-W waittime] [-z tos] host",
|
" [-W waittime] [-z tos] host",
|
||||||
" ping [-AaDdfLnoQqRrv] [-c count] [-I iface] [-i wait] [-l preload]",
|
" ping [-AaDdfHLnoQqRrv] [-c count] [-I iface] [-i wait] [-l preload]",
|
||||||
" [-M mask | time] [-m ttl]" SECOPT " [-p pattern] [-S src_addr]",
|
" [-M mask | time] [-m ttl]" SECOPT " [-p pattern] [-S src_addr]",
|
||||||
" [-s packetsize] [-T ttl] [-t timeout] [-W waittime]",
|
" [-s packetsize] [-T ttl] [-t timeout] [-W waittime]",
|
||||||
" [-z tos] mcast-group");
|
" [-z tos] mcast-group");
|
||||||
|
Loading…
Reference in New Issue
Block a user