mirror of
https://git.hardenedbsd.org/hardenedbsd/HardenedBSD.git
synced 2024-11-16 23:57:54 +01:00
Reviewed by: Gary Jennejohn <gj@freebsd.org>
Submitted by: Bruce Murphy <packrat@iinet.net.au> Add '-a' audible flag, so terminal will beep upon receipt of a reply packet. Useful for debugging ethernet runs, among other things.
This commit is contained in:
parent
b7a652ab84
commit
772dfa7231
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=22417
@ -42,7 +42,7 @@
|
||||
packets to network hosts
|
||||
.Sh SYNOPSIS
|
||||
.Nm ping
|
||||
.Op Fl dfnqrvLRQ
|
||||
.Op Fl adfnqrvLRQ
|
||||
.Op Fl c Ar count
|
||||
.Op Fl i Ar wait
|
||||
.Op Fl I Ar interface
|
||||
@ -70,6 +70,9 @@ and then an arbitrary number of ``pad'' bytes used to fill out the
|
||||
packet.
|
||||
The options are as follows:
|
||||
.Bl -tag -width Ds
|
||||
.It Fl a
|
||||
Audible. Include a bell (ASCII 0x07) character in the output when any packet
|
||||
is received. This option is ignored if other format options are present.
|
||||
.It Fl c Ar count
|
||||
Stop after sending (and receiving)
|
||||
.Ar count
|
||||
|
@ -109,6 +109,7 @@ int options;
|
||||
#define F_NOLOOP 0x0400
|
||||
#define F_MTTL 0x0800
|
||||
#define F_MIF 0x1000
|
||||
#define F_AUDIBLE 0x2000
|
||||
|
||||
/*
|
||||
* MAX_DUP_CHK is the number of bits in received table, i.e. the maximum
|
||||
@ -185,8 +186,11 @@ main(argc, argv)
|
||||
preload = 0;
|
||||
|
||||
datap = &outpack[8 + sizeof(struct timeval)];
|
||||
while ((ch = getopt(argc, argv, "I:LQRT:c:dfh:i:l:np:qrs:v")) != EOF)
|
||||
while ((ch = getopt(argc, argv, "I:LQRT:c:adfh:i:l:np:qrs:v")) != EOF)
|
||||
switch(ch) {
|
||||
case 'a':
|
||||
options |= F_AUDIBLE;
|
||||
break;
|
||||
case 'c':
|
||||
npackets = atoi(optarg);
|
||||
if (npackets <= 0) {
|
||||
@ -619,6 +623,8 @@ pr_pack(buf, cc, from)
|
||||
(void)printf(" time=%.3f ms", triptime);
|
||||
if (dupflag)
|
||||
(void)printf(" (DUP!)");
|
||||
if (options & F_AUDIBLE)
|
||||
(void)printf("\a");
|
||||
/* check the data */
|
||||
cp = (u_char*)&icp->icmp_data[8];
|
||||
dp = &outpack[8 + sizeof(struct timeval)];
|
||||
@ -1134,6 +1140,6 @@ fill(bp, patp)
|
||||
usage()
|
||||
{
|
||||
(void)fprintf(stderr,
|
||||
"usage: ping [-LQRdfnqrv] [-c count] [-i wait] [-I interface]\n\t[-l preload] [-p pattern] [-s packetsize] [-T ttl] host\n");
|
||||
"usage: ping [-LQRadfnqrv] [-c count] [-i wait] [-I interface]\n\t[-l preload] [-p pattern] [-s packetsize] [-T ttl] host\n");
|
||||
exit(1);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user