--- ping.c Mon Sep 23 08:21:55 2002 +++ bling.c Mon Sep 23 08:32:00 2002 @@ -40,14 +40,14 @@ The Regents of the University of California. All rights reserved.\n"; #endif /* not lint */ #ifndef lint #if 0 -static char sccsid[] = "@(#)ping.c 8.1 (Berkeley) 6/5/93"; +static char sccsid[] = "@(#)bling.c 8.1 (Berkeley) 6/5/93"; #endif static const char rcsid[] = - "$FreeBSD: src/sbin/ping/ping.c,v 1.52.2.12 2002/09/17 15:33:49 nectar Exp $"; + "$FreeBSD: src/sbin/bling/bling.c,v 1.52.2.12 2002/09/17 15:33:49 nectar Exp $"; #endif /* not lint */ /* - * P I N G . C + * B L I N G . C * + /* bling bling beyotches, sween */ @@ -116,11 +116,11 @@ /* various options */ int options; #define F_FLOOD 0x0001 #define F_INTERVAL 0x0002 #define F_NUMERIC 0x0004 -#define F_PINGFILLED 0x0008 +#define F_BLINGFILLED 0x0008 #define F_QUIET 0x0010 #define F_RROUTE 0x0020 #define F_SO_DEBUG 0x0040 #define F_SO_DONTROUTE 0x0080 #define F_VERBOSE 0x0100 @@ -144,11 +144,11 @@ */ #define MAX_DUP_CHK (8 * 128) int mx_dup_ck = MAX_DUP_CHK; char rcvd_tbl[MAX_DUP_CHK / 8]; -struct sockaddr_in whereto; /* who to ping */ +struct sockaddr_in whereto; /* who to bling */ int datalen = DEFDATALEN; 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 */ @@ -179,11 +179,11 @@ static void fill(char *, char *); static u_short in_cksum(u_short *, int); static void check_status(void); static void finish(void) __dead2; -static void pinger(void); +static void blinger(void); static char *pr_addr(struct in_addr); static void pr_icmph(struct icmp *); static void pr_iph(struct ip *); static void pr_pack(char *, int, struct sockaddr_in *, struct timeval *); static void pr_retip(struct ip *); @@ -318,11 +318,11 @@ break; case 'n': options |= F_NUMERIC; break; case 'p': /* fill buffer with user pattern */ - options |= F_PINGFILLED; + options |= F_BLINGFILLED; fill((char *)datap, optarg); break; case 'Q': options |= F_QUIET2; break; @@ -455,11 +455,11 @@ timing = 1; packlen = datalen + MAXIPLEN + MAXICMPLEN; if (!(packet = (u_char *)malloc((size_t)packlen))) err(EX_UNAVAILABLE, "malloc"); - if (!(options & F_PINGFILLED)) + if (!(options & F_BLINGFILLED)) for (i = PHDR_LEN; i < datalen; ++i) *datap++ = i; ident = getpid() & 0xFFFF; @@ -550,15 +550,15 @@ err(EX_OSERR, "setsockopt SO_TIMESTAMP"); } #endif /* - * When pinging the broadcast address, you can get a lot of answers. + * When blinging the broadcast address, you can get a lot of answers. * Doing something so evil is useful if you are trying to stress the * ethernet, or just want to fill the arp cache to get some stuff for * /etc/ethers. But beware: RFC 1122 allows hosts to ignore broadcast - * or multicast pings if they wish. + * or multicast blings if they wish. */ hold = 48 * 1024; (void)setsockopt(s, SOL_SOCKET, SO_RCVBUF, (char *)&hold, sizeof(hold)); @@ -566,17 +566,17 @@ (void)setsockopt(s, SOL_SOCKET, SO_SNDBUF, (char *)&hold, sizeof(hold)); } if (to->sin_family == AF_INET) { - (void)printf("PING %s (%s)", hostname, + (void)printf("BLING %s (%s)", hostname, inet_ntoa(to->sin_addr)); if (source) (void)printf(" from %s", shostname); (void)printf(": %d data bytes\n", datalen); } else - (void)printf("PING %s: %d data bytes\n", hostname, datalen); + (void)printf("BLING %s: %d data bytes\n", hostname, datalen); /* * Use sigaction() instead of signal() to get unambiguous semantics, * in particular with SA_RESTART not set. */ @@ -615,16 +615,16 @@ ts.c_lflag |= NOKERNINFO; tcsetattr(STDOUT_FILENO, TCSANOW, &ts); } if (preload == 0) - pinger(); /* send the first ping */ + blinger(); /* send the first bling */ else { if (npackets != 0 && preload > npackets) preload = npackets; while (preload--) /* fire off them quickies */ - pinger(); + blinger(); } (void)gettimeofday(&last, NULL); if (options & F_FLOOD) { intvl.tv_sec = 0; @@ -692,11 +692,11 @@ if (npackets && nreceived >= npackets) break; } if (n == 0 || options & F_FLOOD) { if (!npackets || ntransmitted < npackets) - pinger(); + blinger(); else { if (almost_done) break; almost_done = 1; intvl.tv_usec = 0; @@ -734,19 +734,19 @@ finish_up = 1; } /* - * pinger -- + * blinger -- * Compose and transmit an ICMP ECHO REQUEST packet. The IP packet * will be added on by the kernel. The ID field is our UNIX process ID, * and the sequence number is an ascending integer. The first 8 bytes * of the data portion are used to hold a UNIX "timeval" struct in host * byte-order, to compute the round-trip time. */ static void -pinger(void) +blinger(void) { struct icmp *icp; int cc, i; icp = (struct icmp *)outpack; @@ -1131,11 +1131,11 @@ (void)signal(SIGINT, SIG_IGN); (void)signal(SIGALRM, SIG_IGN); (void)putchar('\n'); (void)fflush(stdout); - (void)printf("--- %s ping statistics ---\n", hostname); + (void)printf("--- %s bling statistics ---\n", hostname); (void)printf("%ld packets transmitted, ", ntransmitted); (void)printf("%ld packets received, ", nreceived); if (nrepeats) (void)printf("+%ld duplicates, ", nrepeats); if (ntransmitted) { @@ -1442,11 +1442,11 @@ static void usage() { (void)fprintf(stderr, "%s\n%s\n%s\n", -"usage: ping [-AQRadfnqrv] [-c count] [-i wait] [-l preload] [-m ttl]", +"usage: bling [-AQRadfnqrv] [-c count] [-i wait] [-l preload] [-m ttl]", " [-p pattern] " #ifdef IPSEC #ifdef IPSEC_POLICY_IPSEC "[-P policy] " #endif