summaryrefslogtreecommitdiffstats
path: root/usr.bin/netstat/ipx.c
diff options
context:
space:
mode:
authorjhay <jhay@FreeBSD.org>1997-05-10 10:03:43 +0000
committerjhay <jhay@FreeBSD.org>1997-05-10 10:03:43 +0000
commitc6d99f375062113c7077c48641b12703e3315eb8 (patch)
treed964ceaff31099de7b6049047e852e53c946a0bc /usr.bin/netstat/ipx.c
parent4f2a5d896ef4c868add74c88150f6cc2bbe07aae (diff)
downloadFreeBSD-src-c6d99f375062113c7077c48641b12703e3315eb8.zip
FreeBSD-src-c6d99f375062113c7077c48641b12703e3315eb8.tar.gz
Add the new ipx statistics variables.
Remove the dns lookup code in the ipx functions. That is bogus and slows things like netstat -r(f ipx) down, without gaining anything. Remove the ipx error protocol statistics.
Diffstat (limited to 'usr.bin/netstat/ipx.c')
-rw-r--r--usr.bin/netstat/ipx.c25
1 files changed, 19 insertions, 6 deletions
diff --git a/usr.bin/netstat/ipx.c b/usr.bin/netstat/ipx.c
index 654d2e6..0e8d34f 100644
--- a/usr.bin/netstat/ipx.c
+++ b/usr.bin/netstat/ipx.c
@@ -36,7 +36,7 @@
static char sccsid[] = "@(#)ns.c 8.1 (Berkeley) 6/6/93";
*/
static const char rcsid[] =
- "$Id$";
+ "$Id: ipx.c,v 1.7 1997/02/22 19:56:22 peter Exp $";
#endif /* not lint */
#include <sys/param.h>
@@ -52,7 +52,9 @@ static const char rcsid[] =
#include <netipx/ipx.h>
#include <netipx/ipx_pcb.h>
#include <netipx/ipx_var.h>
+#ifdef IPXERRORMSGS
#include <netipx/ipx_error.h>
+#endif
#include <netipx/spx.h>
#include <netipx/spx_timer.h>
#include <netipx/spx_var.h>
@@ -150,8 +152,8 @@ ipxprotopr(off, name)
prev = next;
}
}
-#define ANY(x,y,z) \
- ((x) ? printf("\t%ld %s%s%s -- %s\n",(long)x,y,plural(x),z,"x") : 0)
+
+#define ANY(x,y,z) (printf("\t%u %s%s%s\n",x,y,plural(x),z))
/*
* Dump SPX statistics structure.
@@ -228,8 +230,9 @@ spx_stats(off, name)
ANY(spxstat.spxs_rcvackbyte, "byte", " acked by rcvd acks");
ANY(spxstat.spxs_rcvwinupd, "rcvd window update packet", "");
}
+
#undef ANY
-#define ANY(x,y,z) ((x) ? printf("\t%d %s%s%s\n",x,y,plural(x),z) : 0)
+#define ANY(x,y,z) (printf("\t%u %s%s%s\n",x,y,plural(x),z))
/*
* Dump IPX statistics structure.
@@ -245,9 +248,17 @@ ipx_stats(off, name)
return;
kread(off, (char *)&ipxstat, sizeof (ipxstat));
printf("%s:\n", name);
- ANY(ipxstat.ipxs_toosmall, "packet", " smaller than a header");
- ANY(ipxstat.ipxs_tooshort, "packet", " smaller than advertised");
+ ANY(ipxstat.ipxs_total, "total packet", " received");
ANY(ipxstat.ipxs_badsum, "packet", " with bad checksums");
+ ANY(ipxstat.ipxs_tooshort, "packet", " smaller than advertised");
+ ANY(ipxstat.ipxs_toosmall, "packet", " smaller than a header");
+ ANY(ipxstat.ipxs_forward, "packet", " forwarded");
+ ANY(ipxstat.ipxs_cantforward, "packet", " not forwardable");
+ ANY(ipxstat.ipxs_delivered, "packet", " for this host");
+ ANY(ipxstat.ipxs_localout, "packet", " sent from this host");
+ ANY(ipxstat.ipxs_odropped, "packet", " dropped due to no bufs, etc.");
+ ANY(ipxstat.ipxs_noroute, "packet", " discarded due to no route");
+ ANY(ipxstat.ipxs_mtutoosmall, "packet", " too big");
}
static struct {
@@ -266,6 +277,7 @@ static struct {
{-1, 0, 0},
};
+#ifdef IPXERRORMSGS
/*
* Dump IPX Error statistics structure.
*/
@@ -337,6 +349,7 @@ ipx_erputil(z, c)
where = ipx_errnames[j].where;
ANY(z, name, where);
}
+#endif /* IPXERRORMSGS */
static struct sockaddr_ipx ssipx = {AF_IPX};
OpenPOWER on IntegriCloud