summaryrefslogtreecommitdiffstats
path: root/usr.bin/netstat/if.c
diff options
context:
space:
mode:
authorjulian <julian@FreeBSD.org>1995-10-26 20:31:59 +0000
committerjulian <julian@FreeBSD.org>1995-10-26 20:31:59 +0000
commit90ae06d6ac1d2da3758389a70a20c91f3e9fd1dc (patch)
treed823a4d0efac391c6dfad3ac2e27c0e984cea732 /usr.bin/netstat/if.c
parent627b063e661d2c0187cf625f83db54c6aca0a0c1 (diff)
downloadFreeBSD-src-90ae06d6ac1d2da3758389a70a20c91f3e9fd1dc.zip
FreeBSD-src-90ae06d6ac1d2da3758389a70a20c91f3e9fd1dc.tar.gz
Reviewed by: julian and jhay@mikom.csir.co.za
Submitted by: Mike Mitchell, supervisor@alb.asctmd.com This is a bulk mport of Mike's IPX/SPX protocol stacks and all the related gunf that goes with it.. it is not guaranteed to work 100% correctly at this time but as we had several people trying to work on it I figured it would be better to get it checked in so they could all get teh same thing to work on.. Mikes been using it for a year or so but on 2.0 more changes and stuff will be merged in from other developers now that this is in. Mike Mitchell, Network Engineer AMTECH Systems Corporation, Technology and Manufacturing 8600 Jefferson Street, Albuquerque, New Mexico 87113 (505) 856-8000 supervisor@alb.asctmd.com
Diffstat (limited to 'usr.bin/netstat/if.c')
-rw-r--r--usr.bin/netstat/if.c28
1 files changed, 23 insertions, 5 deletions
diff --git a/usr.bin/netstat/if.c b/usr.bin/netstat/if.c
index adcc076..cd0a25e 100644
--- a/usr.bin/netstat/if.c
+++ b/usr.bin/netstat/if.c
@@ -43,6 +43,8 @@ static char sccsid[] = "@(#)if.c 8.2 (Berkeley) 2/21/94";
#include <net/if_dl.h>
#include <netinet/in.h>
#include <netinet/in_var.h>
+#include <netipx/ipx.h>
+#include <netipx/ipx_if.h>
#include <netns/ns.h>
#include <netns/ns_if.h>
#include <netiso/iso.h>
@@ -74,6 +76,7 @@ intpr(interval, ifnetaddr)
union {
struct ifaddr ifa;
struct in_ifaddr in;
+ struct ipx_ifaddr ipx;
struct ns_ifaddr ns;
struct iso_ifaddr iso;
} ifaddr;
@@ -91,7 +94,7 @@ intpr(interval, ifnetaddr)
}
if (kread(ifnetaddr, (char *)&ifnetaddr, sizeof ifnetaddr))
return;
- printf("%-5.5s %-5.5s %-11.11s %-15.15s %8.8s %5.5s",
+ printf("%-5.5s %-5.5s %-13.13s %-15.15s %8.8s %5.5s",
"Name", "Mtu", "Network", "Address", "Ipkts", "Ierrs");
if (bflag)
printf(" %10.10s","Ibytes");
@@ -127,7 +130,7 @@ intpr(interval, ifnetaddr)
}
printf("%-5.5s %-5d ", name, ifnet.if_mtu);
if (ifaddraddr == 0) {
- printf("%-11.11s ", "none");
+ printf("%-13.13s ", "none");
printf("%-15.15s ", "none");
} else {
if (kread(ifaddraddr, (char *)&ifaddr, sizeof ifaddr)) {
@@ -139,7 +142,7 @@ intpr(interval, ifnetaddr)
CP(&ifaddr); sa = (struct sockaddr *)cp;
switch (sa->sa_family) {
case AF_UNSPEC:
- printf("%-11.11s ", "none");
+ printf("%-13.13s ", "none");
printf("%-15.15s ", "none");
break;
case AF_INET:
@@ -160,12 +163,27 @@ intpr(interval, ifnetaddr)
printf("%-15.15s ",
routename(sin->sin_addr.s_addr));
break;
+ case AF_IPX:
+ {
+ struct sockaddr_ipx *sipx =
+ (struct sockaddr_ipx *)sa;
+ u_long net;
+ char netnum[10];
+
+ *(union ipx_net *) &net = sipx->sipx_addr.x_net;
+ sprintf(netnum, "%lx", ntohl(net));
+ printf("ipx:%-8s ", netnum);
+/* printf("ipx:%-8s ", netname(net, 0L)); */
+ printf("%-15s ",
+ ipx_phost((struct sockaddr *)sipx));
+ }
+ break;
case AF_NS:
{
struct sockaddr_ns *sns =
(struct sockaddr_ns *)sa;
u_long net;
- char netnum[8];
+ char netnum[10];
*(union ns_net *) &net = sns->sns_addr.x_net;
sprintf(netnum, "%lxH", ntohl(net));
@@ -194,7 +212,7 @@ intpr(interval, ifnetaddr)
while (--n >= 0)
m += printf("%02x%c", *cp++ & 0xff,
n > 0 ? '.' : ' ');
- m = 28 - m;
+ m = 30 - m;
while (m-- > 0)
putchar(' ');
break;
OpenPOWER on IntegriCloud