Mon Dec 7 18:48:45 2009 UTC ()
PR/42243: Yasuoka Masahiko: Add support for "net.inet.icmp.bmcastecho" support.
Print the current status.


(christos)
diff -r1.91 -r1.92 src/usr.bin/netstat/inet.c

cvs diff -r1.91 -r1.92 src/usr.bin/netstat/inet.c (expand / switch to unified diff)

--- src/usr.bin/netstat/inet.c 2009/09/14 10:36:50 1.91
+++ src/usr.bin/netstat/inet.c 2009/12/07 18:48:45 1.92
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: inet.c,v 1.91 2009/09/14 10:36:50 degroote Exp $ */ 1/* $NetBSD: inet.c,v 1.92 2009/12/07 18:48:45 christos Exp $ */
2 2
3/* 3/*
4 * Copyright (c) 1983, 1988, 1993 4 * Copyright (c) 1983, 1988, 1993
5 * The Regents of the University of California. All rights reserved. 5 * The Regents of the University of California. All rights reserved.
6 * 6 *
7 * Redistribution and use in source and binary forms, with or without 7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions 8 * modification, are permitted provided that the following conditions
9 * are met: 9 * are met:
10 * 1. Redistributions of source code must retain the above copyright 10 * 1. Redistributions of source code must retain the above copyright
11 * notice, this list of conditions and the following disclaimer. 11 * notice, this list of conditions and the following disclaimer.
12 * 2. Redistributions in binary form must reproduce the above copyright 12 * 2. Redistributions in binary form must reproduce the above copyright
13 * notice, this list of conditions and the following disclaimer in the 13 * notice, this list of conditions and the following disclaimer in the
14 * documentation and/or other materials provided with the distribution. 14 * documentation and/or other materials provided with the distribution.
@@ -24,27 +24,27 @@ @@ -24,27 +24,27 @@
24 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 24 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
25 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 25 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
26 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 26 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
27 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 27 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
28 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 28 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
29 * SUCH DAMAGE. 29 * SUCH DAMAGE.
30 */ 30 */
31 31
32#include <sys/cdefs.h> 32#include <sys/cdefs.h>
33#ifndef lint 33#ifndef lint
34#if 0 34#if 0
35static char sccsid[] = "from: @(#)inet.c 8.4 (Berkeley) 4/20/94"; 35static char sccsid[] = "from: @(#)inet.c 8.4 (Berkeley) 4/20/94";
36#else 36#else
37__RCSID("$NetBSD: inet.c,v 1.91 2009/09/14 10:36:50 degroote Exp $"); 37__RCSID("$NetBSD: inet.c,v 1.92 2009/12/07 18:48:45 christos Exp $");
38#endif 38#endif
39#endif /* not lint */ 39#endif /* not lint */
40 40
41#define _CALLOUT_PRIVATE /* for defs in sys/callout.h */ 41#define _CALLOUT_PRIVATE /* for defs in sys/callout.h */
42 42
43#include <sys/param.h> 43#include <sys/param.h>
44#include <sys/queue.h> 44#include <sys/queue.h>
45#include <sys/socket.h> 45#include <sys/socket.h>
46#include <sys/socketvar.h> 46#include <sys/socketvar.h>
47#include <sys/mbuf.h> 47#include <sys/mbuf.h>
48#include <sys/protosw.h> 48#include <sys/protosw.h>
49#include <sys/sysctl.h> 49#include <sys/sysctl.h>
50 50
@@ -572,26 +572,28 @@ icmp_stats(u_long off, const char *name) @@ -572,26 +572,28 @@ icmp_stats(u_long off, const char *name)
572 for (first = 1, i = 0; i < ICMP_MAXTYPE + 1; i++) 572 for (first = 1, i = 0; i < ICMP_MAXTYPE + 1; i++)
573 if (icmpstat[ICMP_STAT_OUTHIST + i] != 0) { 573 if (icmpstat[ICMP_STAT_OUTHIST + i] != 0) {
574 if (first) { 574 if (first) {
575 printf("\tOutput histogram:\n"); 575 printf("\tOutput histogram:\n");
576 first = 0; 576 first = 0;
577 } 577 }
578 printf("\t\t%s: %llu\n", icmpnames[i], 578 printf("\t\t%s: %llu\n", icmpnames[i],
579 (unsigned long long)icmpstat[ICMP_STAT_OUTHIST + i]); 579 (unsigned long long)icmpstat[ICMP_STAT_OUTHIST + i]);
580 } 580 }
581 p(ICMP_STAT_BADCODE, "\t%llu message%s with bad code fields\n"); 581 p(ICMP_STAT_BADCODE, "\t%llu message%s with bad code fields\n");
582 p(ICMP_STAT_TOOSHORT, "\t%llu message%s < minimum length\n"); 582 p(ICMP_STAT_TOOSHORT, "\t%llu message%s < minimum length\n");
583 p(ICMP_STAT_CHECKSUM, "\t%llu bad checksum%s\n"); 583 p(ICMP_STAT_CHECKSUM, "\t%llu bad checksum%s\n");
584 p(ICMP_STAT_BADLEN, "\t%llu message%s with bad length\n"); 584 p(ICMP_STAT_BADLEN, "\t%llu message%s with bad length\n");
 585 p(ICMP_STAT_BMCASTECHO, "\t%llu multicast echo request%s ignored\n");
 586 p(ICMP_STAT_BMCASTTSTAMP, "\t%llu multicast timestamp request%s ignored\n");
585 for (first = 1, i = 0; i < ICMP_MAXTYPE + 1; i++) 587 for (first = 1, i = 0; i < ICMP_MAXTYPE + 1; i++)
586 if (icmpstat[ICMP_STAT_INHIST + i] != 0) { 588 if (icmpstat[ICMP_STAT_INHIST + i] != 0) {
587 if (first) { 589 if (first) {
588 printf("\tInput histogram:\n"); 590 printf("\tInput histogram:\n");
589 first = 0; 591 first = 0;
590 } 592 }
591 printf("\t\t%s: %llu\n", icmpnames[i], 593 printf("\t\t%s: %llu\n", icmpnames[i],
592 (unsigned long long)icmpstat[ICMP_STAT_INHIST + i]); 594 (unsigned long long)icmpstat[ICMP_STAT_INHIST + i]);
593 } 595 }
594 p(ICMP_STAT_REFLECT, "\t%llu message response%s generated\n"); 596 p(ICMP_STAT_REFLECT, "\t%llu message response%s generated\n");
595 p(ICMP_STAT_PMTUCHG, "\t%llu path MTU change%s\n"); 597 p(ICMP_STAT_PMTUCHG, "\t%llu path MTU change%s\n");
596#undef p 598#undef p
597} 599}