From: Keith Sklower Date: Wed, 21 Aug 1991 11:31:56 +0000 (-0800) Subject: uses vector of routing trees rather than linked list X-Git-Tag: BSD-4_4-Snapshot-Development~9531 X-Git-Url: https://git.subgeniuskitty.com/unix-history/.git/commitdiff_plain/4e64fa9b5a65c0d8a9dd6757a18ad66b1a5a85be uses vector of routing trees rather than linked list SCCS-vsn: usr.bin/netstat/route.c 5.22 SCCS-vsn: usr.bin/netstat/main.c 5.25 --- diff --git a/usr/src/usr.bin/netstat/main.c b/usr/src/usr.bin/netstat/main.c index 9e4016959a..5f67cd390f 100644 --- a/usr/src/usr.bin/netstat/main.c +++ b/usr/src/usr.bin/netstat/main.c @@ -12,7 +12,7 @@ char copyright[] = #endif /* not lint */ #ifndef lint -static char sccsid[] = "@(#)main.c 5.24 (Berkeley) %G%"; +static char sccsid[] = "@(#)main.c 5.25 (Berkeley) %G%"; #endif /* not lint */ #include @@ -72,7 +72,7 @@ struct nlist nl[] = { #define N_NIMP 20 { "_nimp"}, #define N_RTREE 21 - { "_radix_node_head"}, + { "_rt_tables"}, #define N_CLTP 22 { "_cltb"}, #define N_CLTPSTAT 23 diff --git a/usr/src/usr.bin/netstat/route.c b/usr/src/usr.bin/netstat/route.c index 15aeea5dd5..3279491b5a 100644 --- a/usr/src/usr.bin/netstat/route.c +++ b/usr/src/usr.bin/netstat/route.c @@ -6,7 +6,7 @@ */ #ifndef lint -static char sccsid[] = "@(#)route.c 5.21 (Berkeley) %G%"; +static char sccsid[] = "@(#)route.c 5.22 (Berkeley) %G%"; #endif /* not lint */ #include @@ -51,6 +51,7 @@ struct bits { { RTF_XRESOLVE, 'X' }, { RTF_LLINFO, 'L' }, { RTF_REJECT, 'R' }, + { RTF_STATIC, 'S' }, { 0 } }; @@ -73,6 +74,7 @@ routepr(rtree) off_t rtree; { struct radix_node_head *rnh, head; + int i; printf("Routing tables\n"); @@ -80,19 +82,22 @@ routepr(rtree) ntreestuff(); else { if (rtree == 0) { - printf("radix_node_head: symbol not in namelist\n"); + printf("rt_tables: symbol not in namelist\n"); return; } - for (kget(rtree, rnh); rnh; rnh = head.rnh_next) { + kget(rtree, rt_tables); + for (i = 0; i <= AF_MAX; i++) { + if ((rnh = rt_tables[i]) == 0) + continue; kget(rnh, head); - if (head.rnh_af == AF_UNSPEC) { - if (Aflag) { + if (i == AF_UNSPEC) { + if (Aflag && af == 0) { printf("Netmasks:\n"); p_tree(head.rnh_treetop); } - } else if (af == AF_UNSPEC || af == head.rnh_af) { - pr_family(head.rnh_af); + } else if (af == AF_UNSPEC || af == i) { + pr_family(i); do_rtent = 1; pr_rthdr(); p_tree(head.rnh_treetop); @@ -119,6 +124,9 @@ pr_family(af) case AF_ISO: afname = "ISO"; break; + case AF_CCITT: + afname = "X.25"; + break; default: afname = NULL; break;