diff options
author | julian <julian@FreeBSD.org> | 1999-10-21 09:06:11 +0000 |
---|---|---|
committer | julian <julian@FreeBSD.org> | 1999-10-21 09:06:11 +0000 |
commit | c5c63975d538cf48ceb99ba48c341293676d15c0 (patch) | |
tree | 722c03ee4d750dd89ed43b028c35302fbfd03bfd /usr.bin/netstat/main.c | |
parent | 028ec91c46f181b4be2318c3bba8d194b5583f87 (diff) | |
download | FreeBSD-src-c5c63975d538cf48ceb99ba48c341293676d15c0.zip FreeBSD-src-c5c63975d538cf48ceb99ba48c341293676d15c0.tar.gz |
Whistle's Netgraph link-layer (sometimes more) networking infrastructure.
Been in production for 3 years now. Gives Instant Frame relay to if_sr
and if_ar drivers, and PPPOE support soon. See:
ftp://ftp.whistle.com/pub/archie/netgraph/index.html
for on-line manual pages.
Reviewed by: Doug Rabson (dfr@freebsd.org)
Obtained from: Whistle CVS tree
Diffstat (limited to 'usr.bin/netstat/main.c')
-rw-r--r-- | usr.bin/netstat/main.c | 21 |
1 files changed, 20 insertions, 1 deletions
diff --git a/usr.bin/netstat/main.c b/usr.bin/netstat/main.c index f3c9563..1a5bc14 100644 --- a/usr.bin/netstat/main.c +++ b/usr.bin/netstat/main.c @@ -52,6 +52,8 @@ static const char rcsid[] = #include <netinet/in.h> +#include <netgraph/ng_socket.h> + #include <ctype.h> #include <err.h> #include <errno.h> @@ -121,6 +123,8 @@ static struct nlist nl[] = { { "_ddpstat"}, #define N_DDPCB 26 { "_ddpcb"}, +#define N_NGSOCKS 27 + { "_ngsocklist"}, { "" }, }; @@ -158,6 +162,15 @@ struct protox atalkprotox[] = { 0, 0 } }; +struct protox netgraphprotox[] = { + { N_NGSOCKS, -1, 1, netgraphprotopr, + NULL, "ctrl" }, + { N_NGSOCKS, -1, 1, netgraphprotopr, + NULL, "data" }, + { -1, -1, 0, 0, + 0, 0 } +}; + struct protox ipxprotox[] = { { N_IPX, N_IPXSTAT, 1, ipxprotopr, ipx_stats, "ipx", 0 }, @@ -218,7 +231,7 @@ main(argc, argv) char *argv[]; { register struct protoent *p; - register struct protox *tp; /* for printing cblocks & stats */ + register struct protox *tp = NULL; /* for printing cblocks & stats */ int ch; af = AF_UNSPEC; @@ -251,6 +264,9 @@ main(argc, argv) af = AF_UNIX; else if (strcmp(optarg, "atalk") == 0) af = AF_APPLETALK; + else if (strcmp(optarg, "ng") == 0 + || strcmp(optarg, "netgraph") == 0) + af = AF_NETGRAPH; #ifdef ISO else if (strcmp(optarg, "iso") == 0) af = AF_ISO; @@ -418,6 +434,9 @@ main(argc, argv) if (af == AF_APPLETALK || af == AF_UNSPEC) for (tp = atalkprotox; tp->pr_name; tp++) printproto(tp, tp->pr_name); + if (af == AF_NETGRAPH || af == AF_UNSPEC) + for (tp = netgraphprotox; tp->pr_name; tp++) + printproto(tp, tp->pr_name); #ifdef NS if (af == AF_NS || af == AF_UNSPEC) for (tp = nsprotox; tp->pr_name; tp++) |