From d494babace1c51efd0d2c4582515a1e1ae5fa9d2 Mon Sep 17 00:00:00 2001 From: glebius Date: Fri, 14 Mar 2014 02:58:48 +0000 Subject: Remove IPX support. IPX was a network transport protocol in Novell's NetWare network operating system from late 80s and then 90s. The NetWare itself switched to TCP/IP as default transport in 1998. Later, in this century the Novell Open Enterprise Server became successor of Novell NetWare. The last release that claimed to still support IPX was OES 2 in 2007. Routing equipment vendors (e.g. Cisco) discontinued support for IPX in 2011. Thus, IPX won't be supported in FreeBSD 11.0-RELEASE. --- usr.bin/kdump/kdump.c | 17 --- usr.bin/netstat/Makefile | 7 - usr.bin/netstat/if.c | 18 --- usr.bin/netstat/ipx.c | 350 ---------------------------------------------- usr.bin/netstat/main.c | 117 ++++++---------- usr.bin/netstat/netstat.1 | 6 - usr.bin/netstat/netstat.h | 10 -- usr.bin/netstat/route.c | 119 ---------------- 8 files changed, 44 insertions(+), 600 deletions(-) delete mode 100644 usr.bin/netstat/ipx.c (limited to 'usr.bin') diff --git a/usr.bin/kdump/kdump.c b/usr.bin/kdump/kdump.c index cf05f24..9e85f3a 100644 --- a/usr.bin/kdump/kdump.c +++ b/usr.bin/kdump/kdump.c @@ -60,10 +60,6 @@ extern int errno; #include #include #include -#ifdef IPX -#include -#include -#endif #ifdef NETATALK #include #endif @@ -1686,19 +1682,6 @@ ktrsockaddr(struct sockaddr *sa) printf("[%s]:%u", addr, htons(sa_in6.sin6_port)); break; } -#ifdef IPX - case AF_IPX: { - struct sockaddr_ipx sa_ipx; - - memset(&sa_ipx, 0, sizeof(sa_ipx)); - memcpy(&sa_ipx, sa, sa->sa_len); - check_sockaddr_len(ipx); - /* XXX wish we had ipx_ntop */ - printf("%s", ipx_ntoa(sa_ipx.sipx_addr)); - free(sa_ipx); - break; - } -#endif case AF_UNIX: { struct sockaddr_un sa_un; diff --git a/usr.bin/netstat/Makefile b/usr.bin/netstat/Makefile index 2432cfb..b9af87a 100644 --- a/usr.bin/netstat/Makefile +++ b/usr.bin/netstat/Makefile @@ -43,11 +43,4 @@ LDADD+= -lnetgraph CFLAGS+=-DNETGRAPH .endif -.if ${MK_IPX_SUPPORT} != "no" -SRCS+= ipx.c -DPADD+= ${LIBIPX} -LDADD+= -lipx -CFLAGS+=-DIPX -.endif - .include diff --git a/usr.bin/netstat/if.c b/usr.bin/netstat/if.c index a87d68b..aeb59091 100644 --- a/usr.bin/netstat/if.c +++ b/usr.bin/netstat/if.c @@ -51,8 +51,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include -#include #include #ifdef PF #include @@ -325,22 +323,6 @@ intpr(int interval, void (*pfunc)(char *), int af) break; } #endif /* INET6 */ - case AF_IPX: - { - struct sockaddr_ipx *sipx; - u_long net; - char netnum[10]; - - sipx = (struct sockaddr_ipx *)ifa->ifa_addr; - *(union ipx_net *) &net = sipx->sipx_addr.x_net; - - sprintf(netnum, "%lx", (u_long)ntohl(net)); - printf("ipx:%-8s ", netnum); - printf("%-17s ", ipx_phost((struct sockaddr *)sipx)); - - network = 1; - break; - } case AF_APPLETALK: printf("atalk:%-12.12s ", atalk_print(ifa->ifa_addr, 0x10)); diff --git a/usr.bin/netstat/ipx.c b/usr.bin/netstat/ipx.c deleted file mode 100644 index aa3dd40..0000000 --- a/usr.bin/netstat/ipx.c +++ /dev/null @@ -1,350 +0,0 @@ -/*- - * Copyright (c) 2004, Robert N. M. Watson - * Copyright (c) 1983, 1988, 1993 - * The Regents of the University of California. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the University of - * California, Berkeley and its contributors. - * 4. Neither the name of the University nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - */ - -#if 0 -#ifndef lint -static char sccsid[] = "@(#)ns.c 8.1 (Berkeley) 6/6/93"; -#endif /* not lint */ -#endif - -#include -__FBSDID("$FreeBSD$"); - -#include -#include -#include -#include -#include - -#include - -#define TCPSTATES -#include - -#include -#include -#include -#ifdef IPXERRORMSGS -#include -#endif -#include -#include -#include -#define SANAMES -#include - -#include -#include -#include -#include -#include -#include "netstat.h" - -static char *ipx_prpr(struct ipx_addr *); - -/* - * Print a summary of connections related to a Network Systems - * protocol. For SPX, also give state of connection. - * Listening processes (aflag) are suppressed unless the - * -a (all) flag is specified. - */ - -void -ipxprotopr(u_long off, const char *name, int af1 __unused, int proto __unused) -{ - struct ipxpcbhead cb; - struct ipxpcb *ipxp; - struct ipxpcb ipxpcb; - struct spxpcb spxpcb; - struct socket sockb; - static int first = 1; - int isspx; - - if (off == 0) - return; - - isspx = strcmp(name, "spx") == 0; - kread(off, (char *)&cb, sizeof (struct ipxpcbhead)); - ipxp = LIST_FIRST(&cb); - while (ipxp != NULL) { - u_long ppcb; - - kread((u_long)ipxp, (char *)&ipxpcb, sizeof (ipxpcb)); - ipxp = LIST_NEXT(&ipxpcb, ipxp_list); - - if (!aflag && ipx_nullhost(ipxpcb.ipxp_faddr) ) { - continue; - } - kread((u_long)ipxpcb.ipxp_socket, - (char *)&sockb, sizeof (sockb)); - ppcb = (u_long) ipxpcb.ipxp_pcb; - if (ppcb) { - if (isspx) { - kread(ppcb, (char *)&spxpcb, sizeof (spxpcb)); - } else continue; - } else - if (isspx) continue; - if (first) { - printf("Active IPX connections"); - if (aflag) - printf(" (including servers)"); - putchar('\n'); - if (Aflag) - printf("%-8.8s ", "PCB"); - printf(Aflag ? - "%-5.5s %-6.6s %-6.6s %-18.18s %-18.18s %s\n" : - "%-5.5s %-6.6s %-6.6s %-22.22s %-22.22s %s\n", - "Proto", "Recv-Q", "Send-Q", - "Local Address", "Foreign Address", "(state)"); - first = 0; - } - if (Aflag) - printf("%8lx ", ppcb); - printf("%-5.5s %6u %6u ", name, sockb.so_rcv.sb_cc, - sockb.so_snd.sb_cc); - printf(Aflag?" %-18.18s":" %-22.22s", ipx_prpr(&ipxpcb.ipxp_laddr)); - printf(Aflag?" %-18.18s":" %-22.22s", ipx_prpr(&ipxpcb.ipxp_faddr)); - if (isspx) { - if (spxpcb.s_state >= TCP_NSTATES) - printf(" %d", spxpcb.s_state); - else - printf(" %s", tcpstates[spxpcb.s_state]); - } - putchar('\n'); - } -} - -#define ANY(x,y,z) \ - if (x || sflag <= 1) printf("\t%u %s%s%s\n", x, y, plural(x), z) -#define ANYl(x,y,z) \ - if (x || sflag <= 1) printf("\t%lu %s%s%s\n", x, y, plural(x), z) - -/* - * Dump SPX statistics structure. - */ -void -spx_stats(u_long off, const char *name, int af1 __unused, int proto __unused) -{ - struct spx_istat spx_istat; -#define spxstat spx_istat.newstats - - if (off == 0) - return; - kread(off, (char *)&spx_istat, sizeof (spx_istat)); - printf("%s:\n", name); - ANY(spx_istat.nonucn, "connection", " dropped due to no new sockets "); - ANY(spx_istat.gonawy, "connection", " terminated due to our end dying"); - ANY(spx_istat.nonucn, "connection", - " dropped due to inability to connect"); - ANY(spx_istat.noconn, "connection", - " dropped due to inability to connect"); - ANY(spx_istat.notme, "connection", - " incompleted due to mismatched id's"); - ANY(spx_istat.wrncon, "connection", " dropped due to mismatched id's"); - ANY(spx_istat.bdreas, "packet", " dropped out of sequence"); - ANY(spx_istat.lstdup, "packet", " duplicating the highest packet"); - ANY(spx_istat.notyet, "packet", " refused as exceeding allocation"); - ANYl(spxstat.spxs_connattempt, "connection", " initiated"); - ANYl(spxstat.spxs_accepts, "connection", " accepted"); - ANYl(spxstat.spxs_connects, "connection", " established"); - ANYl(spxstat.spxs_drops, "connection", " dropped"); - ANYl(spxstat.spxs_conndrops, "embryonic connection", " dropped"); - ANYl(spxstat.spxs_closed, "connection", " closed (includes drops)"); - ANYl(spxstat.spxs_segstimed, "packet", " where we tried to get rtt"); - ANYl(spxstat.spxs_rttupdated, "time", " we got rtt"); - ANYl(spxstat.spxs_delack, "delayed ack", " sent"); - ANYl(spxstat.spxs_timeoutdrop, "connection", - " dropped in rxmt timeout"); - ANYl(spxstat.spxs_rexmttimeo, "retransmit timeout", ""); - ANYl(spxstat.spxs_persisttimeo, "persist timeout", ""); - ANYl(spxstat.spxs_keeptimeo, "keepalive timeout", ""); - ANYl(spxstat.spxs_keepprobe, "keepalive probe", " sent"); - ANYl(spxstat.spxs_keepdrops, "connection", " dropped in keepalive"); - ANYl(spxstat.spxs_sndtotal, "total packet", " sent"); - ANYl(spxstat.spxs_sndpack, "data packet", " sent"); - ANYl(spxstat.spxs_sndbyte, "data byte", " sent"); - ANYl(spxstat.spxs_sndrexmitpack, "data packet", " retransmitted"); - ANYl(spxstat.spxs_sndrexmitbyte, "data byte", " retransmitted"); - ANYl(spxstat.spxs_sndacks, "ack-only packet", " sent"); - ANYl(spxstat.spxs_sndprobe, "window probe", " sent"); - ANYl(spxstat.spxs_sndurg, "packet", " sent with URG only"); - ANYl(spxstat.spxs_sndwinup, "window update-only packet", " sent"); - ANYl(spxstat.spxs_sndctrl, "control (SYN|FIN|RST) packet", " sent"); - ANYl(spxstat.spxs_sndvoid, "request", " to send a non-existent packet"); - ANYl(spxstat.spxs_rcvtotal, "total packet", " received"); - ANYl(spxstat.spxs_rcvpack, "packet", " received in sequence"); - ANYl(spxstat.spxs_rcvbyte, "byte", " received in sequence"); - ANYl(spxstat.spxs_rcvbadsum, "packet", " received with ccksum errs"); - ANYl(spxstat.spxs_rcvbadoff, "packet", " received with bad offset"); - ANYl(spxstat.spxs_rcvshort, "packet", " received too short"); - ANYl(spxstat.spxs_rcvduppack, "duplicate-only packet", " received"); - ANYl(spxstat.spxs_rcvdupbyte, "duplicate-only byte", " received"); - ANYl(spxstat.spxs_rcvpartduppack, "packet", - " with some duplicate data"); - ANYl(spxstat.spxs_rcvpartdupbyte, "dup. byte", " in part-dup. packet"); - ANYl(spxstat.spxs_rcvoopack, "out-of-order packet", " received"); - ANYl(spxstat.spxs_rcvoobyte, "out-of-order byte", " received"); - ANYl(spxstat.spxs_rcvpackafterwin, "packet", " with data after window"); - ANYl(spxstat.spxs_rcvbyteafterwin, "byte", " rcvd after window"); - ANYl(spxstat.spxs_rcvafterclose, "packet", " rcvd after 'close'"); - ANYl(spxstat.spxs_rcvwinprobe, "rcvd window probe packet", ""); - ANYl(spxstat.spxs_rcvdupack, "rcvd duplicate ack", ""); - ANYl(spxstat.spxs_rcvacktoomuch, "rcvd ack", " for unsent data"); - ANYl(spxstat.spxs_rcvackpack, "rcvd ack packet", ""); - ANYl(spxstat.spxs_rcvackbyte, "byte", " acked by rcvd acks"); - ANYl(spxstat.spxs_rcvwinupd, "rcvd window update packet", ""); -} - -/* - * Dump IPX statistics structure. - */ -void -ipx_stats(u_long off, const char *name, int af1 __unused, int proto __unused) -{ - struct ipxstat ipxstat; - - if (off == 0) - return; - kread(off, (char *)&ipxstat, sizeof (ipxstat)); - printf("%s:\n", name); - ANYl(ipxstat.ipxs_total, "total packet", " received"); - ANYl(ipxstat.ipxs_badsum, "packet", " with bad checksums"); - ANYl(ipxstat.ipxs_tooshort, "packet", " smaller than advertised"); - ANYl(ipxstat.ipxs_toosmall, "packet", " smaller than a header"); - ANYl(ipxstat.ipxs_forward, "packet", " forwarded"); - ANYl(ipxstat.ipxs_cantforward, "packet", " not forwardable"); - ANYl(ipxstat.ipxs_delivered, "packet", " for this host"); - ANYl(ipxstat.ipxs_localout, "packet", " sent from this host"); - ANYl(ipxstat.ipxs_odropped, "packet", " dropped due to no bufs, etc."); - ANYl(ipxstat.ipxs_noroute, "packet", " discarded due to no route"); - ANYl(ipxstat.ipxs_mtutoosmall, "packet", " too big"); -} - -#ifdef IPXERRORMSGS -static struct { - u_short code; - char *name; - char *where; -} ipx_errnames[] = { - {0, "Unspecified Error", " at Destination"}, - {1, "Bad Checksum", " at Destination"}, - {2, "No Listener", " at Socket"}, - {3, "Packet", " Refused due to lack of space at Destination"}, - {01000, "Unspecified Error", " while gatewayed"}, - {01001, "Bad Checksum", " while gatewayed"}, - {01002, "Packet", " forwarded too many times"}, - {01003, "Packet", " too large to be forwarded"}, - {-1, 0, 0}, -}; - -/* - * Dump IPX Error statistics structure. - */ -/*ARGSUSED*/ -void -ipxerr_stats(u_long off, const char *name, int af __unused, int proto __unused) -{ - struct ipx_errstat ipx_errstat; - int j; - int histoprint = 1; - int z; - - if (off == 0) - return; - kread(off, (char *)&ipx_errstat, sizeof (ipx_errstat)); - printf("IPX error statistics:\n"); - ANY(ipx_errstat.ipx_es_error, "call", " to ipx_error"); - ANY(ipx_errstat.ipx_es_oldshort, "error", - " ignored due to insufficient addressing"); - ANY(ipx_errstat.ipx_es_oldipx_err, "error request", - " in response to error packets"); - ANY(ipx_errstat.ipx_es_tooshort, "error packet", - " received incomplete"); - ANY(ipx_errstat.ipx_es_badcode, "error packet", - " received of unknown type"); - for(j = 0; j < IPX_ERR_MAX; j ++) { - z = ipx_errstat.ipx_es_outhist[j]; - if (z && histoprint) { - printf("Output Error Histogram:\n"); - histoprint = 0; - } - ipx_erputil(z, ipx_errstat.ipx_es_codes[j]); - } - histoprint = 1; - for(j = 0; j < IPX_ERR_MAX; j ++) { - z = ipx_errstat.ipx_es_inhist[j]; - if (z && histoprint) { - printf("Input Error Histogram:\n"); - histoprint = 0; - } - ipx_erputil(z, ipx_errstat.ipx_es_codes[j]); - } -} - -static void -ipx_erputil(int z, int c) -{ - int j; - char codebuf[30]; - char *name, *where; - - for(j = 0;; j ++) { - if ((name = ipx_errnames[j].name) == 0) - break; - if (ipx_errnames[j].code == c) - break; - } - if (name == 0) { - if (c > 01000) - where = "in transit"; - else - where = "at destination"; - sprintf(codebuf, "Unknown IPX error code 0%o", c); - name = codebuf; - } else - where = ipx_errnames[j].where; - ANY(z, name, where); -} -#endif /* IPXERRORMSGS */ - -static struct sockaddr_ipx ssipx = { .sipx_family = AF_IPX }; - -static -char *ipx_prpr(struct ipx_addr *x) -{ - struct sockaddr_ipx *sipx = &ssipx; - - sipx->sipx_addr = *x; - return(ipx_print((struct sockaddr *)sipx)); -} diff --git a/usr.bin/netstat/main.c b/usr.bin/netstat/main.c index 42e7080..d928b7f 100644 --- a/usr.bin/netstat/main.c +++ b/usr.bin/netstat/main.c @@ -70,99 +70,91 @@ __FBSDID("$FreeBSD$"); #include "netstat.h" static struct nlist nl[] = { -#define N_IFNET 0 - { .n_name = "_ifnet" }, /* XXXGL: can be deleted */ -#define N_RTSTAT 1 +#define N_RTSTAT 0 { .n_name = "_rtstat" }, -#define N_RTREE 2 +#define N_RTREE 1 { .n_name = "_rt_tables"}, -#define N_MRTSTAT 3 +#define N_MRTSTAT 2 { .n_name = "_mrtstat" }, -#define N_MFCHASHTBL 4 +#define N_MFCHASHTBL 3 { .n_name = "_mfchashtbl" }, -#define N_VIFTABLE 5 +#define N_VIFTABLE 4 { .n_name = "_viftable" }, -#define N_IPX 6 - { .n_name = "_ipxpcb_list"}, -#define N_IPXSTAT 7 - { .n_name = "_ipxstat"}, -#define N_SPXSTAT 8 - { .n_name = "_spx_istat"}, -#define N_DDPSTAT 9 +#define N_DDPSTAT 5 { .n_name = "_ddpstat"}, -#define N_DDPCB 10 +#define N_DDPCB 6 { .n_name = "_ddpcb"}, -#define N_NGSOCKS 11 +#define N_NGSOCKS 7 { .n_name = "_ngsocklist"}, -#define N_IP6STAT 12 +#define N_IP6STAT 8 { .n_name = "_ip6stat" }, -#define N_ICMP6STAT 13 +#define N_ICMP6STAT 9 { .n_name = "_icmp6stat" }, -#define N_IPSECSTAT 14 +#define N_IPSECSTAT 10 { .n_name = "_ipsec4stat" }, -#define N_IPSEC6STAT 15 +#define N_IPSEC6STAT 11 { .n_name = "_ipsec6stat" }, -#define N_PIM6STAT 16 +#define N_PIM6STAT 12 { .n_name = "_pim6stat" }, -#define N_MRT6STAT 17 +#define N_MRT6STAT 13 { .n_name = "_mrt6stat" }, -#define N_MF6CTABLE 18 +#define N_MF6CTABLE 14 { .n_name = "_mf6ctable" }, -#define N_MIF6TABLE 19 +#define N_MIF6TABLE 15 { .n_name = "_mif6table" }, -#define N_PFKEYSTAT 20 +#define N_PFKEYSTAT 16 { .n_name = "_pfkeystat" }, -#define N_RTTRASH 21 +#define N_RTTRASH 17 { .n_name = "_rttrash" }, -#define N_CARPSTAT 22 +#define N_CARPSTAT 18 { .n_name = "_carpstats" }, -#define N_PFSYNCSTAT 23 +#define N_PFSYNCSTAT 19 { .n_name = "_pfsyncstats" }, -#define N_AHSTAT 24 +#define N_AHSTAT 20 { .n_name = "_ahstat" }, -#define N_ESPSTAT 25 +#define N_ESPSTAT 21 { .n_name = "_espstat" }, -#define N_IPCOMPSTAT 26 +#define N_IPCOMPSTAT 22 { .n_name = "_ipcompstat" }, -#define N_TCPSTAT 27 +#define N_TCPSTAT 23 { .n_name = "_tcpstat" }, -#define N_UDPSTAT 28 +#define N_UDPSTAT 24 { .n_name = "_udpstat" }, -#define N_IPSTAT 29 +#define N_IPSTAT 25 { .n_name = "_ipstat" }, -#define N_ICMPSTAT 30 +#define N_ICMPSTAT 26 { .n_name = "_icmpstat" }, -#define N_IGMPSTAT 31 +#define N_IGMPSTAT 27 { .n_name = "_igmpstat" }, -#define N_PIMSTAT 32 +#define N_PIMSTAT 28 { .n_name = "_pimstat" }, -#define N_TCBINFO 33 +#define N_TCBINFO 29 { .n_name = "_tcbinfo" }, -#define N_UDBINFO 34 +#define N_UDBINFO 30 { .n_name = "_udbinfo" }, -#define N_DIVCBINFO 35 +#define N_DIVCBINFO 31 { .n_name = "_divcbinfo" }, -#define N_RIPCBINFO 36 +#define N_RIPCBINFO 32 { .n_name = "_ripcbinfo" }, -#define N_UNP_COUNT 37 +#define N_UNP_COUNT 33 { .n_name = "_unp_count" }, -#define N_UNP_GENCNT 38 +#define N_UNP_GENCNT 34 { .n_name = "_unp_gencnt" }, -#define N_UNP_DHEAD 39 +#define N_UNP_DHEAD 35 { .n_name = "_unp_dhead" }, -#define N_UNP_SHEAD 40 +#define N_UNP_SHEAD 36 { .n_name = "_unp_shead" }, -#define N_RIP6STAT 41 +#define N_RIP6STAT 37 { .n_name = "_rip6stat" }, -#define N_SCTPSTAT 42 +#define N_SCTPSTAT 38 { .n_name = "_sctpstat" }, -#define N_MFCTABLESIZE 43 +#define N_MFCTABLESIZE 39 { .n_name = "_mfctablesize" }, -#define N_ARPSTAT 44 +#define N_ARPSTAT 40 { .n_name = "_arpstat" }, -#define N_UNP_SPHEAD 45 +#define N_UNP_SPHEAD 41 { .n_name = "unp_sphead" }, -#define N_SFSTAT 46 +#define N_SFSTAT 42 { .n_name = "_sfstat"}, { .n_name = NULL }, }; @@ -278,16 +270,6 @@ struct protox netgraphprotox[] = { NULL, NULL, NULL, 0, 0 } }; #endif -#ifdef IPX -struct protox ipxprotox[] = { - { N_IPX, N_IPXSTAT, 1, ipxprotopr, - ipx_stats, NULL, "ipx", 0, 0 }, - { N_IPX, N_SPXSTAT, 1, ipxprotopr, - spx_stats, NULL, "spx", 0, 0 }, - { -1, -1, 0, NULL, - NULL, NULL, 0, 0, 0 } -}; -#endif struct protox *protoprotox[] = { protox, @@ -297,9 +279,6 @@ struct protox *protoprotox[] = { #ifdef IPSEC pfkeyprotox, #endif -#ifdef IPX - ipxprotox, -#endif atalkprotox, NULL }; static void printproto(struct protox *, const char *); @@ -389,9 +368,7 @@ main(int argc, char *argv[]) errx(1, "%s: invalid fib", optarg); break; case 'f': - if (strcmp(optarg, "ipx") == 0) - af = AF_IPX; - else if (strcmp(optarg, "inet") == 0) + if (strcmp(optarg, "inet") == 0) af = AF_INET; #ifdef INET6 else if (strcmp(optarg, "inet6") == 0) @@ -618,12 +595,6 @@ main(int argc, char *argv[]) for (tp = pfkeyprotox; tp->pr_name; tp++) printproto(tp, tp->pr_name); #endif /*IPSEC*/ -#ifdef IPX - if (af == AF_IPX || af == AF_UNSPEC) { - for (tp = ipxprotox; tp->pr_name; tp++) - printproto(tp, tp->pr_name); - } -#endif /* IPX */ if (af == AF_APPLETALK || af == AF_UNSPEC) for (tp = atalkprotox; tp->pr_name; tp++) printproto(tp, tp->pr_name); diff --git a/usr.bin/netstat/netstat.1 b/usr.bin/netstat/netstat.1 index 61e21b3..575db85 100644 --- a/usr.bin/netstat/netstat.1 +++ b/usr.bin/netstat/netstat.1 @@ -354,12 +354,6 @@ The following address families and protocols are recognized: .Cm ddp .It Cm netgraph , ng Pq Dv AF_NETGRAPH .Cm ctrl , data -.It Cm ipx Pq Dv AF_IPX -.Cm ipx , spx -.\".It Cm ns Pq Dv AF_NS -.\".Cm idp , ns_err , spp -.\".It Cm iso Pq Dv AF_ISO -.\".Cm clnp , cltp , esis , tp .It Cm unix Pq Dv AF_UNIX .It Cm link Pq Dv AF_LINK .El diff --git a/usr.bin/netstat/netstat.h b/usr.bin/netstat/netstat.h index 414b4ce..5747cea 100644 --- a/usr.bin/netstat/netstat.h +++ b/usr.bin/netstat/netstat.h @@ -127,24 +127,14 @@ void pr_rthdr(int); void pr_family(int); void rt_stats(void); void flowtable_stats(void); -char *ipx_pnet(struct sockaddr *); -char *ipx_phost(struct sockaddr *); -char *ns_phost(struct sockaddr *); -void upHex(char *); char *routename(in_addr_t); char *netname(in_addr_t, in_addr_t); char *atalk_print(struct sockaddr *, int); char *atalk_print2(struct sockaddr *, struct sockaddr *, int); -char *ipx_print(struct sockaddr *); char *ns_print(struct sockaddr *); void routepr(int, int); -void ipxprotopr(u_long, const char *, int, int); -void spx_stats(u_long, const char *, int, int); -void ipx_stats(u_long, const char *, int, int); -void ipxerr_stats(u_long, const char *, int, int); - void nsprotopr(u_long, const char *, int, int); void spp_stats(u_long, const char *, int, int); void idp_stats(u_long, const char *, int, int); diff --git a/usr.bin/netstat/route.c b/usr.bin/netstat/route.c index 88fe07d..2d443a5 100644 --- a/usr.bin/netstat/route.c +++ b/usr.bin/netstat/route.c @@ -52,7 +52,6 @@ __FBSDID("$FreeBSD$"); #include #include -#include #include #include @@ -216,9 +215,6 @@ pr_family(int af1) afname = "Internet6"; break; #endif /*INET6*/ - case AF_IPX: - afname = "IPX"; - break; case AF_ISO: afname = "ISO"; break; @@ -754,15 +750,6 @@ fmt_sockaddr(struct sockaddr *sa, struct sockaddr *mask, int flags) } #endif /*INET6*/ - case AF_IPX: - { - struct ipx_addr work = ((struct sockaddr_ipx *)sa)->sipx_addr; - if (ipx_nullnet(satoipx_addr(work))) - cp = "default"; - else - cp = ipx_print(sa); - break; - } case AF_APPLETALK: { if (!(flags & RTF_HOST) && mask) @@ -1134,109 +1121,3 @@ rt_stats(void) printf("\t%u route%s not in table but not freed\n", rttrash, plural(rttrash)); } - -char * -ipx_print(struct sockaddr *sa) -{ - u_short port; - struct servent *sp = 0; - const char *net = "", *host = ""; - char *p; - u_char *q; - struct ipx_addr work = ((struct sockaddr_ipx *)sa)->sipx_addr; - static char mybuf[50]; - char cport[10], chost[15], cnet[15]; - - port = ntohs(work.x_port); - - if (ipx_nullnet(work) && ipx_nullhost(work)) { - - if (port) { - if (sp) - sprintf(mybuf, "*.%s", sp->s_name); - else - sprintf(mybuf, "*.%x", port); - } else - sprintf(mybuf, "*.*"); - - return (mybuf); - } - - if (ipx_wildnet(work)) - net = "any"; - else if (ipx_nullnet(work)) - net = "*"; - else { - q = work.x_net.c_net; - sprintf(cnet, "%02x%02x%02x%02x", - q[0], q[1], q[2], q[3]); - for (p = cnet; *p == '0' && p < cnet + 8; p++) - continue; - net = p; - } - - if (ipx_wildhost(work)) - host = "any"; - else if (ipx_nullhost(work)) - host = "*"; - else { - q = work.x_host.c_host; - sprintf(chost, "%02x%02x%02x%02x%02x%02x", - q[0], q[1], q[2], q[3], q[4], q[5]); - for (p = chost; *p == '0' && p < chost + 12; p++) - continue; - host = p; - } - - if (port) { - if (strcmp(host, "*") == 0) - host = ""; - if (sp) - snprintf(cport, sizeof(cport), - "%s%s", *host ? "." : "", sp->s_name); - else - snprintf(cport, sizeof(cport), - "%s%x", *host ? "." : "", port); - } else - *cport = 0; - - snprintf(mybuf, sizeof(mybuf), "%s.%s%s", net, host, cport); - return(mybuf); -} - -char * -ipx_phost(struct sockaddr *sa) -{ - struct sockaddr_ipx *sipx = (struct sockaddr_ipx *)sa; - struct sockaddr_ipx work; - static union ipx_net ipx_zeronet; - char *p; - - work = *sipx; - - work.sipx_addr.x_port = 0; - work.sipx_addr.x_net = ipx_zeronet; - p = ipx_print((struct sockaddr *)&work); - if (strncmp("*.", p, 2) == 0) p += 2; - - return(p); -} - -void -upHex(char *p0) -{ - char *p = p0; - - for (; *p; p++) - switch (*p) { - - case 'a': - case 'b': - case 'c': - case 'd': - case 'e': - case 'f': - *p += ('A' - 'a'); - break; - } -} -- cgit v1.1