summaryrefslogtreecommitdiffstats
path: root/usr.bin/netstat/route.c
diff options
context:
space:
mode:
authorjulian <julian@FreeBSD.org>1996-06-08 00:20:42 +0000
committerjulian <julian@FreeBSD.org>1996-06-08 00:20:42 +0000
commit989c61cbbb3c500504ffb558fb497e4b70ff59b1 (patch)
tree45ed63a14729366d63c6bb7dcff00c650f3bcd8e /usr.bin/netstat/route.c
parent996a2d831474ffd06649ca53d5c694a5e78ace35 (diff)
downloadFreeBSD-src-989c61cbbb3c500504ffb558fb497e4b70ff59b1.zip
FreeBSD-src-989c61cbbb3c500504ffb558fb497e4b70ff59b1.tar.gz
patches to allow netstat to monitor appletalk sockets openned using the
/sys/netatalk protocol stack more cleanups and fixes are likely
Diffstat (limited to 'usr.bin/netstat/route.c')
-rw-r--r--usr.bin/netstat/route.c48
1 files changed, 46 insertions, 2 deletions
diff --git a/usr.bin/netstat/route.c b/usr.bin/netstat/route.c
index 856e553..8c0f688 100644
--- a/usr.bin/netstat/route.c
+++ b/usr.bin/netstat/route.c
@@ -36,7 +36,7 @@
static char sccsid[] = "From: @(#)route.c 8.6 (Berkeley) 4/28/95";
#endif
static const char rcsid[] =
- "$Id: route.c,v 1.12 1996/02/16 15:42:14 wollman Exp $";
+ "$Id: route.c,v 1.13 1996/06/02 23:19:11 alex Exp $";
#endif /* not lint */
#include <sys/param.h>
@@ -50,9 +50,10 @@ static const char rcsid[] =
#define KERNEL
#include <net/route.h>
#undef KERNEL
-#include <netinet/in.h>
+#include <netinet/in.h>
#include <netipx/ipx.h>
+#include <netatalk/at.h>
#ifdef NS
#include <netns/ns.h>
@@ -184,6 +185,9 @@ pr_family(af)
case AF_ISO:
afname = "ISO";
break;
+ case AF_APPLETALK:
+ afname = "ATALK";
+ break;
case AF_CCITT:
afname = "X.25";
break;
@@ -410,6 +414,11 @@ p_sockaddr(sa, mask, flags, width)
cp = ipx_print(sa);
break;
}
+ case AF_APPLETALK:
+ {
+ cp = atalk_print(sa);
+ break;
+ }
#ifdef NS
case AF_NS:
@@ -705,6 +714,41 @@ rt_stats(off)
rtstat.rts_wildcard, plural(rtstat.rts_wildcard));
}
+char *
+at_addr_print(ata)
+ struct at_addr *ata;
+{
+static char mybuf[50];
+
+ sprintf(mybuf,"[%hd.%d]",ntohs(ata->s_net),(unsigned long)ata->s_node);
+ return mybuf;
+}
+
+char *
+atalk_print(sa)
+ register struct sockaddr *sa;
+{
+ struct sockaddr_at *sat = (struct sockaddr_at *)sa;
+static char mybuf[50];
+
+ strcpy(mybuf,at_addr_print(&sat->sat_addr));
+ sprintf(mybuf+strlen(mybuf),":%d",sat->sat_port);
+#if 0
+ switch(sat->sat_hints.type) {
+ case SATHINT_NONE:
+ sprintf(mybuf,"[no type]");
+ break;
+ case SATHINT_CONFIG:
+ case SATHINT_IFACE:
+ sprintf(mybuf,"[too hard for now]");
+ break;
+ default:
+ sprintf(mybuf,"[unknown type]");
+ }
+#endif
+ return mybuf;
+}
+
char *
ipx_print(sa)
register struct sockaddr *sa;
OpenPOWER on IntegriCloud