diff options
author | alfred <alfred@FreeBSD.org> | 2003-12-23 13:24:03 +0000 |
---|---|---|
committer | alfred <alfred@FreeBSD.org> | 2003-12-23 13:24:03 +0000 |
commit | abd1027a01880a215e2c2f5c955c21a22e7424bd (patch) | |
tree | 5fe04b13890d4637e842156dc35025c641bdfc1f /usr.bin/netstat/main.c | |
parent | fe692735bff0c4124372fb220744c13ca13657f2 (diff) | |
download | FreeBSD-src-abd1027a01880a215e2c2f5c955c21a22e7424bd.zip FreeBSD-src-abd1027a01880a215e2c2f5c955c21a22e7424bd.tar.gz |
Restore old netstat -m output.
A new flag '-c' can be used to ask for the cache stats.
Diffstat (limited to 'usr.bin/netstat/main.c')
-rw-r--r-- | usr.bin/netstat/main.c | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/usr.bin/netstat/main.c b/usr.bin/netstat/main.c index 145f740..6d70371 100644 --- a/usr.bin/netstat/main.c +++ b/usr.bin/netstat/main.c @@ -256,6 +256,7 @@ static char *nlistf = NULL, *memf = NULL; int Aflag; /* show addresses of protocol control block */ int aflag; /* show all sockets (including servers) */ int bflag; /* show i/f total bytes in/out */ +int cflag; /* show mbuf cache information */ int dflag; /* show i/f dropped packets */ int gflag; /* show group (multicast) routing or stats */ int iflag; /* show interfaces */ @@ -285,7 +286,7 @@ main(int argc, char *argv[]) af = AF_UNSPEC; - while ((ch = getopt(argc, argv, "Aabdf:gI:iLlM:mN:np:rSstuWw:z")) != -1) + while ((ch = getopt(argc, argv, "Aabcdf:gI:iLlM:mN:np:rSstuWw:z")) != -1) switch(ch) { case 'A': Aflag = 1; @@ -296,6 +297,9 @@ main(int argc, char *argv[]) case 'b': bflag = 1; break; + case 'c': + cflag = 1; + break; case 'd': dflag = 1; break; @@ -421,6 +425,10 @@ main(int argc, char *argv[]) if (nlistf != NULL || memf != NULL) setgid(getgid()); + if (cflag && !mflag) { + (void)fprintf(stderr, "-c only valid with -m\n"); + usage(); + } if (mflag) { if (memf != NULL) { if (kread(0, 0, 0) == 0) @@ -686,8 +694,8 @@ usage(void) " netstat -s [-s] [-z] [-f protocol_family | -p protocol] [-M core]", " netstat -i | -I interface -s [-f protocol_family | -p protocol]\n" " [-M core] [-N system]", -" netstat -m [-M core] [-N system]", -" netstat -r [-AanW] [-f address_family] [-M core] [-N system]", +" netstat -m [-c] [-M core] [-N system]", +" netstat -r [-AenW] [-f address_family] [-M core] [-N system]", " netstat -rs [-s] [-M core] [-N system]", " netstat -g [-W] [-f address_family] [-M core] [-N system]", " netstat -gs [-s] [-f address_family] [-M core] [-N system]"); |