From owner-freebsd-bugs Fri May 21 4:20: 5 1999 Delivered-To: freebsd-bugs@freebsd.org Received: from freefall.freebsd.org (freefall.FreeBSD.ORG [204.216.27.21]) by hub.freebsd.org (Postfix) with ESMTP id B260F1591C for ; Fri, 21 May 1999 04:20:02 -0700 (PDT) (envelope-from gnats@FreeBSD.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.9.3/8.9.2) id EAA60767; Fri, 21 May 1999 04:20:01 -0700 (PDT) (envelope-from gnats@FreeBSD.org) Received: from ns.destek.net (ns.Destek.Net [192.156.97.193]) by hub.freebsd.org (Postfix) with ESMTP id DE09D14E67 for ; Fri, 21 May 1999 04:13:05 -0700 (PDT) (envelope-from marc@ns.destek.net) Received: (from marc@localhost) by ns.destek.net (8.9.3/8.9.1a) id HAA23277; Fri, 21 May 1999 07:13:04 -0400 (EDT) Message-Id: <199905211113.HAA23277@ns.destek.net> Date: Fri, 21 May 1999 07:13:04 -0400 (EDT) From: marc@destek.net Reply-To: marc@destek.net To: FreeBSD-gnats-submit@freebsd.org X-Send-Pr-Version: 3.2 Subject: bin/11818: Enhancement, ping(8) Sender: owner-freebsd-bugs@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org >Number: 11818 >Category: bin >Synopsis: Added a feature to ping(8) >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: change-request >Submitter-Id: current-users >Arrival-Date: Fri May 21 04:20:00 PDT 1999 >Closed-Date: >Last-Modified: >Originator: Marc Evans >Release: FreeBSD 2.2.8-STABLE i386 >Organization: The Destek Group, Inc. >Environment: Any platform that uses FreeBSD derived ping(8) sources. >Description: I have added a feature to ping(8) which is effectively the inverse of the -a option. I use the -A flag on the command line. Both the man page and the source code have been updated in the attached patch. >How-To-Repeat: Patch the sources using the attached patch. Compile, install and then run "ping -A {addr/name}". >Fix: *** ping.c Thu May 20 17:15:47 1999 --- ping.c.old Thu Feb 25 10:50:37 1999 *************** *** 124,130 **** #define F_MTTL 0x0800 #define F_MIF 0x1000 #define F_AUDIBLE 0x2000 - #define F_MISSED 0x4000 /* * MAX_DUP_CHK is the number of bits in received table, i.e. the maximum --- 124,129 ---- *************** *** 140,146 **** int s; /* socket file descriptor */ u_char outpack[MAXPACKET]; char BSPACE = '\b'; /* characters written for flood */ - char BBELL = '\a'; /* characters written for MISSED and AUDIBLE */ char DOT = '.'; char *hostname; int ident; /* process id to identify our packets */ --- 139,144 ---- *************** *** 219,229 **** preload = 0; datap = &outpack[8 + PHDR_LEN]; ! while ((ch = getopt(argc, argv, "AI:LQRT:c:adfi:l:np:qrs:v")) != -1) { switch(ch) { - case 'A': - options |= F_MISSED; - break; case 'a': options |= F_AUDIBLE; break; --- 217,224 ---- preload = 0; datap = &outpack[8 + PHDR_LEN]; ! while ((ch = getopt(argc, argv, "I:LQRT:c:adfi:l:np:qrs:v")) != -1) { switch(ch) { case 'a': options |= F_AUDIBLE; break; *************** *** 558,566 **** intvl.tv_sec = MAXWAIT; } (void)gettimeofday(&last, NULL); - - if (ntransmitted != nreceived+1 && options & F_MISSED) - (void)write(STDOUT_FILENO, &BBELL, 1); } } finish(); --- 553,558 ---- *************** *** 721,727 **** if (dupflag) (void)printf(" (DUP!)"); if (options & F_AUDIBLE) ! (void)write(STDOUT_FILENO, &BBELL, 1); /* check the data */ cp = (u_char*)&icp->icmp_data[PHDR_LEN]; dp = &outpack[8 + PHDR_LEN]; --- 713,719 ---- if (dupflag) (void)printf(" (DUP!)"); if (options & F_AUDIBLE) ! (void)printf("\a"); /* check the data */ cp = (u_char*)&icp->icmp_data[PHDR_LEN]; dp = &outpack[8 + PHDR_LEN]; *** ping.8 Thu May 20 17:20:20 1999 --- ping.8.old Thu May 20 17:17:17 1999 *************** *** 42,48 **** packets to network hosts .Sh SYNOPSIS .Nm ping ! .Op Fl AQRadfnqrv .Op Fl c Ar count .Op Fl i Ar wait .Op Fl l Ar preload --- 42,48 ---- packets to network hosts .Sh SYNOPSIS .Nm ping ! .Op Fl QRadfnqrv .Op Fl c Ar count .Op Fl i Ar wait .Op Fl l Ar preload *************** *** 75,87 **** .Dq pad bytes used to fill out the packet. The options are as follows: .Bl -tag -width indent - .It Fl A - Audible missed packet. Include a bell - .Pq ASCII 0x07 - character in the output when any packet is not received before the next packet - is transmitted. .It Fl a ! Audible received packet. Include a bell .Pq ASCII 0x07 character in the output when any packet is received. This option is ignored if other format options are present. --- 75,82 ---- .Dq pad bytes used to fill out the packet. The options are as follows: .Bl -tag -width indent .It Fl a ! Audible. Include a bell .Pq ASCII 0x07 character in the output when any packet is received. This option is ignored if other format options are present. >Release-Note: >Audit-Trail: >Unformatted: To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-bugs" in the body of the message