summaryrefslogtreecommitdiff
path: root/usr.bin/netstat
diff options
context:
space:
mode:
authorAngelos D. Keromytis <angelos@cvs.openbsd.org>1999-10-29 03:26:41 +0000
committerAngelos D. Keromytis <angelos@cvs.openbsd.org>1999-10-29 03:26:41 +0000
commitada8046059288501276f4440523f531e7de5f58a (patch)
tree5bd712889ff818a465619bb435a52ffe2bc43597 /usr.bin/netstat
parent7b584cbf8103cf78a8db3cbb08e378ff5a47a4b9 (diff)
etherip statistics
Diffstat (limited to 'usr.bin/netstat')
-rw-r--r--usr.bin/netstat/inet.c37
-rw-r--r--usr.bin/netstat/main.c8
-rw-r--r--usr.bin/netstat/netstat.h3
3 files changed, 43 insertions, 5 deletions
diff --git a/usr.bin/netstat/inet.c b/usr.bin/netstat/inet.c
index 53170236893..a94c5b8d0aa 100644
--- a/usr.bin/netstat/inet.c
+++ b/usr.bin/netstat/inet.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: inet.c,v 1.33 1999/04/11 19:41:40 niklas Exp $ */
+/* $OpenBSD: inet.c,v 1.34 1999/10/29 03:26:40 angelos Exp $ */
/* $NetBSD: inet.c,v 1.14 1995/10/03 21:42:37 thorpej Exp $ */
/*
@@ -38,7 +38,7 @@
#if 0
static char sccsid[] = "from: @(#)inet.c 8.4 (Berkeley) 4/20/94";
#else
-static char *rcsid = "$OpenBSD: inet.c,v 1.33 1999/04/11 19:41:40 niklas Exp $";
+static char *rcsid = "$OpenBSD: inet.c,v 1.34 1999/10/29 03:26:40 angelos Exp $";
#endif
#endif /* not lint */
@@ -72,6 +72,7 @@ static char *rcsid = "$OpenBSD: inet.c,v 1.33 1999/04/11 19:41:40 niklas Exp $";
#include <netinet/ip_ah.h>
#include <netinet/ip_esp.h>
#include <netinet/ip_ip4.h>
+#include <netinet/ip_ether.h>
#include <arpa/inet.h>
#include <limits.h>
@@ -642,6 +643,38 @@ ah_stats(off, name)
}
/*
+ * Dump etherip statistics structure.
+ */
+void
+etherip_stats(off, name)
+ u_long off;
+ char *name;
+{
+ struct etheripstat etheripstat;
+
+
+ if (off == 0)
+ return;
+ kread(off, (char *)&etheripstat, sizeof (etheripstat));
+ printf("%s:\n", name);
+
+#define p(f, m) if (etheripstat.f || sflag <= 1) \
+ printf(m, etheripstat.f, plural(etheripstat.f))
+
+
+ p(etherip_hdrops, "\t%u packet%s shorter than header shows\n");
+ p(etherip_qfull, "\t%u packet%s were dropped due to full output queue\n");
+ p(etherip_noifdrops, "\t%u packet%s were dropped because of no interface/bridge information\n");
+ p(etherip_pdrops, "\t%u packet%s dropped due to policy\n");
+ p(etherip_adrops, "\t%u packet%s dropped for other reasons\n");
+ p(etherip_ipackets, "\t%u input ethernet-in-IP packets\n");
+ p(etherip_opackets, "\t%u output ethernet-in-IP packets\n");
+ p(etherip_ibytes, "\t%qu input byte%s\n");
+ p(etherip_obytes, "\t%qu output byte%s\n");
+#undef p
+}
+
+/*
* Dump ESP statistics structure.
*/
void
diff --git a/usr.bin/netstat/main.c b/usr.bin/netstat/main.c
index 674855ba1ec..230290534c0 100644
--- a/usr.bin/netstat/main.c
+++ b/usr.bin/netstat/main.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: main.c,v 1.17 1999/03/01 01:28:13 d Exp $ */
+/* $OpenBSD: main.c,v 1.18 1999/10/29 03:26:40 angelos Exp $ */
/* $NetBSD: main.c,v 1.9 1996/05/07 02:55:02 thorpej Exp $ */
/*
@@ -44,7 +44,7 @@ char copyright[] =
#if 0
static char sccsid[] = "from: @(#)main.c 8.4 (Berkeley) 3/1/94";
#else
-static char *rcsid = "$OpenBSD: main.c,v 1.17 1999/03/01 01:28:13 d Exp $";
+static char *rcsid = "$OpenBSD: main.c,v 1.18 1999/10/29 03:26:40 angelos Exp $";
#endif
#endif /* not lint */
@@ -151,6 +151,8 @@ struct nlist nl[] = {
{ "_ddpstat"},
#define N_DDPCB 40
{ "_ddpcb"},
+#define N_ETHERIPSTAT 41
+ { "_etheripstat"},
{ ""},
};
@@ -178,6 +180,8 @@ struct protox {
esp_stats, "esp" },
{ -1, N_IP4STAT, 1, 0,
ip4_stats, "ipencap" },
+ { -1, N_ETHERIPSTAT, 1, 0,
+ etherip_stats,"etherip" },
{ -1, -1, 0, 0,
0, 0 }
};
diff --git a/usr.bin/netstat/netstat.h b/usr.bin/netstat/netstat.h
index 678f3cd0af5..4b6b18779ae 100644
--- a/usr.bin/netstat/netstat.h
+++ b/usr.bin/netstat/netstat.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: netstat.h,v 1.11 1998/02/26 10:06:11 peter Exp $ */
+/* $OpenBSD: netstat.h,v 1.12 1999/10/29 03:26:40 angelos Exp $ */
/* $NetBSD: netstat.h,v 1.6 1996/05/07 02:55:05 thorpej Exp $ */
/*
@@ -76,6 +76,7 @@ void igmp_stats __P((u_long, char *));
void ah_stats __P((u_long, char *));
void esp_stats __P((u_long, char *));
void ip4_stats __P((u_long, char *));
+void etherip_stats __P((u_long, char *));
void protopr __P((u_long, char *));
void mbpr(u_long);