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.
This commit is contained in:
parent
4f2a5d896e
commit
c6d99f3750
@ -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};
|
||||
|
||||
|
@ -131,15 +131,13 @@ struct nlist nl[] = {
|
||||
{ "_ipxstat"},
|
||||
#define N_SPXSTAT 33
|
||||
{ "_spx_istat"},
|
||||
#define N_IPXERR 34
|
||||
{ "_ipx_errstat"},
|
||||
#define N_DDPSTAT 35
|
||||
#define N_DDPSTAT 34
|
||||
{ "_ddpstat"},
|
||||
#define N_DDPCB 36
|
||||
#define N_DDPCB 35
|
||||
{ "_ddpcb"},
|
||||
#define N_DIVPCB 37
|
||||
#define N_DIVPCB 36
|
||||
{ "_divcb"},
|
||||
#define N_DIVSTAT 38
|
||||
#define N_DIVSTAT 37
|
||||
{ "_divstat"},
|
||||
{ "" },
|
||||
};
|
||||
@ -180,8 +178,6 @@ struct protox ipxprotox[] = {
|
||||
ipx_stats, "ipx" },
|
||||
{ N_IPX, N_SPXSTAT, 1, ipxprotopr,
|
||||
spx_stats, "spx" },
|
||||
{ -1, N_IPXERR, 1, 0,
|
||||
ipxerr_stats, "ipx_err" },
|
||||
{ -1, -1, 0, 0,
|
||||
0, 0 }
|
||||
};
|
||||
|
@ -36,7 +36,7 @@
|
||||
static char sccsid[] = "From: @(#)route.c 8.6 (Berkeley) 4/28/95";
|
||||
#endif
|
||||
static const char rcsid[] =
|
||||
"$Id$";
|
||||
"$Id: route.c,v 1.25 1997/02/22 19:56:23 peter Exp $";
|
||||
#endif /* not lint */
|
||||
|
||||
#include <sys/param.h>
|
||||
@ -730,8 +730,6 @@ ipx_print(sa)
|
||||
static char mybuf[50];
|
||||
char cport[10], chost[15], cnet[15];
|
||||
|
||||
if(!nflag)
|
||||
sp = getservbyport(work.x_port, "ipx");
|
||||
port = ntohs(work.x_port);
|
||||
|
||||
if (ipx_nullnet(work) && ipx_nullhost(work)) {
|
||||
@ -745,9 +743,7 @@ static char mybuf[50];
|
||||
return (mybuf);
|
||||
}
|
||||
|
||||
if (!nflag && (np = getnetbyaddr(*(u_long *)&work.x_net, AF_IPX)))
|
||||
net = np->n_name;
|
||||
else if (ipx_wildnet(work))
|
||||
if (ipx_wildnet(work))
|
||||
net = "any";
|
||||
else if (ipx_nullnet(work))
|
||||
net = "*";
|
||||
@ -760,9 +756,7 @@ static char mybuf[50];
|
||||
net = p;
|
||||
}
|
||||
|
||||
if (!nflag && (hp = gethostbyaddr((char *)&work.x_host, 6, AF_IPX)))
|
||||
host = hp->h_name;
|
||||
else if (ipx_wildhost(work))
|
||||
if (ipx_wildhost(work))
|
||||
host = "any";
|
||||
else if (ipx_nullhost(work))
|
||||
host = "*";
|
||||
@ -800,9 +794,6 @@ static union ipx_net ipx_zeronet;
|
||||
work = *sipx;
|
||||
in = work.sipx_addr;
|
||||
|
||||
hp = gethostbyaddr((char *)&in, sizeof(struct ipx_addr), AF_IPX);
|
||||
if (hp) return (hp->h_name);
|
||||
|
||||
work.sipx_addr.x_port = 0;
|
||||
work.sipx_addr.x_net = ipx_zeronet;
|
||||
p = ipx_print((struct sockaddr *)&work);
|
||||
|
Loading…
Reference in New Issue
Block a user