Module Name: src
Committed By: ozaki-r
Date: Fri Aug 28 06:34:17 UTC 2020
Modified Files:
src/usr.bin/netstat: inet.c inet6.c
Log Message:
netstat: support new packet counters
To generate a diff of this commit:
cvs rdiff -u -r1.111 -r1.112 src/usr.bin/netstat/inet.c
cvs rdiff -u -r1.75 -r1.76 src/usr.bin/netstat/inet6.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/usr.bin/netstat/inet.c
diff -u src/usr.bin/netstat/inet.c:1.111 src/usr.bin/netstat/inet.c:1.112
--- src/usr.bin/netstat/inet.c:1.111 Thu Aug 6 07:38:54 2020
+++ src/usr.bin/netstat/inet.c Fri Aug 28 06:34:17 2020
@@ -1,4 +1,4 @@
-/* $NetBSD: inet.c,v 1.111 2020/08/06 07:38:54 knakahara Exp $ */
+/* $NetBSD: inet.c,v 1.112 2020/08/28 06:34:17 ozaki-r Exp $ */
/*
* Copyright (c) 1983, 1988, 1993
@@ -34,7 +34,7 @@
#if 0
static char sccsid[] = "from: @(#)inet.c 8.4 (Berkeley) 4/20/94";
#else
-__RCSID("$NetBSD: inet.c,v 1.111 2020/08/06 07:38:54 knakahara Exp $");
+__RCSID("$NetBSD: inet.c,v 1.112 2020/08/28 06:34:17 ozaki-r Exp $");
#endif
#endif /* not lint */
@@ -633,6 +633,13 @@ ip_stats(u_long off, const char *name)
p(IP_STAT_BADADDR, "\t%" PRIu64 " datagram%s with bad address in header\n");
p(IP_STAT_PFILDROP_IN, "\t%" PRIu64 " input packet%s dropped by pfil\n");
p(IP_STAT_PFILDROP_OUT, "\t%" PRIu64 " output packet%s dropped by pfil\n");
+ p(IP_STAT_IPSECDROP_IN, "\t%" PRIu64 " input packet%s dropped by IPsec\n");
+ p(IP_STAT_IPSECDROP_OUT, "\t%" PRIu64 " output packet%s dropped by IPsec\n");
+ p(IP_STAT_IFDROP, "\t%" PRIu64 " input packet%s dropped due to interface state\n");
+ p(IP_STAT_TIMXCEED, "\t%" PRIu64 " packet%s dropped due to TTL exceeded\n");
+ p(IP_STAT_IFNOADDR, "\t%" PRIu64 " output packet%s dropped (no IP address)\n");
+ p(IP_STAT_RTREJECT, "\t%" PRIu64 " output packet%s discarded due to reject route\n");
+ p(IP_STAT_BCASTDENIED, "\t%" PRIu64 " output packet%s dropped (broadcast prohibited)\n");
#undef ps
#undef p
}
Index: src/usr.bin/netstat/inet6.c
diff -u src/usr.bin/netstat/inet6.c:1.75 src/usr.bin/netstat/inet6.c:1.76
--- src/usr.bin/netstat/inet6.c:1.75 Thu Aug 6 07:38:54 2020
+++ src/usr.bin/netstat/inet6.c Fri Aug 28 06:34:17 2020
@@ -1,4 +1,4 @@
-/* $NetBSD: inet6.c,v 1.75 2020/08/06 07:38:54 knakahara Exp $ */
+/* $NetBSD: inet6.c,v 1.76 2020/08/28 06:34:17 ozaki-r Exp $ */
/* BSDI inet.c,v 2.3 1995/10/24 02:19:29 prb Exp */
/*
@@ -64,7 +64,7 @@
#if 0
static char sccsid[] = "@(#)inet.c 8.4 (Berkeley) 4/20/94";
#else
-__RCSID("$NetBSD: inet6.c,v 1.75 2020/08/06 07:38:54 knakahara Exp $");
+__RCSID("$NetBSD: inet6.c,v 1.76 2020/08/28 06:34:17 ozaki-r Exp $");
#endif
#endif /* not lint */
@@ -801,6 +801,13 @@ ip6_stats(u_long off, const char *name)
p1(IP6_STAT_FORWARD_CACHEMISS, "\t%llu forward cache miss\n");
p(IP6_STAT_PFILDROP_IN, "\t%llu input packet%s dropped by pfil\n");
p(IP6_STAT_PFILDROP_OUT, "\t%llu output packet%s dropped by pfil\n");
+ p(IP6_STAT_IPSECDROP_IN, "\t%llu input packet%s dropped by IPsec\n");
+ p(IP6_STAT_IPSECDROP_OUT, "\t%llu output packet%s dropped by IPsec\n");
+ p(IP6_STAT_IFDROP, "\t%llu input packet%s dropped due to interface state\n");
+ p(IP6_STAT_IDROPPED, "\t%llu input packet%s dropped due to no bufs, etc.\n");
+ p(IP6_STAT_TIMXCEED, "\t%llu packet%s dropped due to hop limit exceeded\n");
+ p(IP6_STAT_TOOBIG, "\t%llu packet%s dropped (too big)\n");
+ p(IP6_STAT_RTREJECT, "\t%llu output packet%s discarded due to reject route\n");
#undef p
#undef p1
}