diff options
author | Henning Brauer <henning@cvs.openbsd.org> | 2007-06-04 12:20:25 +0000 |
---|---|---|
committer | Henning Brauer <henning@cvs.openbsd.org> | 2007-06-04 12:20:25 +0000 |
commit | dcce4f9ac9ec6cdd0dc3c914fe7dd39b1e659ade (patch) | |
tree | f57fc812de72f89c37e9fe0706e57d8a537a9cc8 /usr.bin | |
parent | 8b1ee59c582797bf42099bd985ac14b98422b202 (diff) |
remove IPX support, agreed by many
Diffstat (limited to 'usr.bin')
-rw-r--r-- | usr.bin/netstat/Makefile | 4 | ||||
-rw-r--r-- | usr.bin/netstat/if.c | 41 | ||||
-rw-r--r-- | usr.bin/netstat/ipx.c | 349 | ||||
-rw-r--r-- | usr.bin/netstat/main.c | 28 | ||||
-rw-r--r-- | usr.bin/netstat/netstat.1 | 5 | ||||
-rw-r--r-- | usr.bin/netstat/netstat.h | 10 | ||||
-rw-r--r-- | usr.bin/netstat/show.c | 62 |
7 files changed, 12 insertions, 487 deletions
diff --git a/usr.bin/netstat/Makefile b/usr.bin/netstat/Makefile index 37cc08f4828..c0e99be5a5c 100644 --- a/usr.bin/netstat/Makefile +++ b/usr.bin/netstat/Makefile @@ -1,7 +1,7 @@ -# $OpenBSD: Makefile,v 1.17 2006/05/27 19:16:37 claudio Exp $ +# $OpenBSD: Makefile,v 1.18 2007/06/04 12:20:24 henning Exp $ PROG= netstat -SRCS= if.c inet.c inet6.c ipx.c main.c mbuf.c mroute.c route.c \ +SRCS= if.c inet.c inet6.c main.c mbuf.c mroute.c route.c \ unix.c atalk.c mroute6.c net80211.c show.c BINGRP= kmem BINMODE=2555 diff --git a/usr.bin/netstat/if.c b/usr.bin/netstat/if.c index c08e746ef35..b5d5f216582 100644 --- a/usr.bin/netstat/if.c +++ b/usr.bin/netstat/if.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if.c,v 1.49 2006/11/17 01:11:23 itojun Exp $ */ +/* $OpenBSD: if.c,v 1.50 2007/06/04 12:20:24 henning Exp $ */ /* $NetBSD: if.c,v 1.16.4.2 1996/06/07 21:46:46 thorpej Exp $ */ /* @@ -34,7 +34,7 @@ #if 0 static char sccsid[] = "from: @(#)if.c 8.2 (Berkeley) 2/21/94"; #else -static char *rcsid = "$OpenBSD: if.c,v 1.49 2006/11/17 01:11:23 itojun Exp $"; +static char *rcsid = "$OpenBSD: if.c,v 1.50 2007/06/04 12:20:24 henning Exp $"; #endif #endif /* not lint */ @@ -48,8 +48,6 @@ static char *rcsid = "$OpenBSD: if.c,v 1.49 2006/11/17 01:11:23 itojun Exp $"; #include <netinet/in.h> #include <netinet/in_var.h> #include <netinet/if_ether.h> -#include <netipx/ipx.h> -#include <netipx/ipx_if.h> #include <arpa/inet.h> #include <limits.h> @@ -82,7 +80,6 @@ intpr(int interval, u_long ifnetaddr) #ifdef INET6 struct in6_ifaddr in6; #endif - struct ipx_ifaddr ipx; } ifaddr; u_long total, ifaddraddr; struct sockaddr *sa; @@ -273,21 +270,6 @@ intpr(int interval, u_long ifnetaddr) } break; #endif - case AF_IPX: - { - struct sockaddr_ipx *sipx = - (struct sockaddr_ipx *)sa; - u_long net; - char netnum[8]; - - *(union ipx_net *)&net = sipx->sipx_addr.ipx_net; - snprintf(netnum, sizeof netnum, "%XH", - ntohl(net)); - printf("ipx:%-8s", netnum); - printf("%-17s ", - ipx_phost((struct sockaddr *)sipx)); - } - break; case AF_APPLETALK: printf("atlk:%-12s",atalk_print(sa,0x10) ); printf("%-12s ",atalk_print(sa,0x0b) ); @@ -551,22 +533,3 @@ catchalarm(int signo) { signalled = YES; } - -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.ipx_port = 0; - work.sipx_addr.ipx_net = ipx_zeronet; - - p = ipx_print((struct sockaddr *)&work); - if (strncmp("0H.", p, 3) == 0) - p += 3; - return(p); -} - diff --git a/usr.bin/netstat/ipx.c b/usr.bin/netstat/ipx.c deleted file mode 100644 index dd622f9ff18..00000000000 --- a/usr.bin/netstat/ipx.c +++ /dev/null @@ -1,349 +0,0 @@ -/* $OpenBSD: ipx.c,v 1.19 2006/05/27 19:16:37 claudio Exp $ */ - -/* - * Copyright (c) 1996 Michael Shalayeff - * 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. 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. - */ - -#ifndef lint -#if 0 -static char sccsid[] = "from: @(#)ns.c 8.1 (Berkeley) 6/6/93"; -#else -static char *rcsid = "$OpenBSD: ipx.c,v 1.19 2006/05/27 19:16:37 claudio Exp $"; -#endif -#endif /* not lint */ - -#include <sys/param.h> -#include <sys/socket.h> -#include <sys/socketvar.h> -#include <sys/mbuf.h> -#include <sys/protosw.h> - -#include <net/route.h> -#include <net/if.h> - -#include <netinet/tcp_fsm.h> - -#include <netipx/ipx.h> -#include <netipx/ipx_pcb.h> -#include <netipx/ipx.h> -#include <netipx/ipx_var.h> -#ifdef IPXERRORMSGS -#include <netipx/ipx_error.h> -#endif /* IPXERRORMSGS */ -#include <netipx/spx.h> -#include <netipx/spx_timer.h> -#include <netipx/spx_var.h> -#define SANAMES -#include <netipx/spx_debug.h> - -#include <limits.h> -#include <errno.h> -#include <stdio.h> -#include <string.h> - -#include "netstat.h" - -struct ipxpcb ipxpcb; -struct spxpcb spxpcb; -struct socket sockb; - -static char *ipx_prpr(struct ipx_addr *); -#ifdef IPXERRORMSGS -static void ipx_erputil(int, int); -#endif - -static int first = 1; - -/* - * Print a summary of connections related to an IPX - * 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, char *name) -{ - struct ipxpcbtable table; - struct ipxpcb *head, *prev, *next; - int isspx; - - if (off == 0) - return; - isspx = strcmp(name, "spx") == 0; - kread(off, &table, sizeof (table)); - prev = head = (struct ipxpcb *) - &CIRCLEQ_FIRST(&((struct ipxpcbtable *)off)->ipxpt_queue); - next = CIRCLEQ_FIRST(&table.ipxpt_queue); - - while (next != head) { - kread((u_long)next, &ipxpcb, sizeof (ipxpcb)); - if (CIRCLEQ_PREV(&ipxpcb, ipxp_queue) != prev) { - printf("???\n"); - break; - } - prev = next; - next = CIRCLEQ_NEXT(&ipxpcb, ipxp_queue); - - if (!aflag && ipx_nullhost(ipxpcb.ipxp_faddr) ) - continue; - - kread((u_long)ipxpcb.ipxp_socket, &sockb, sizeof (sockb)); - if (isspx) { - kread((u_long)ipxpcb.ipxp_ppcb, &spxpcb, - sizeof (spxpcb)); - } - if (first) { - printf("Active Internetwork Packet Exchange connections"); - if (aflag) - printf(" (including servers)"); - putchar('\n'); - if (Aflag) - printf("%-*.*s %-5.5s %-6.6s %-6.6s %-*.*s %-*.*s %s\n", - PLEN, PLEN, "PCB", "Proto", "Recv-Q", - "Send-Q", PLEN, PLEN, "Local Address", - PLEN, PLEN, "Foreign Address", "(state)"); - else - printf("%-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("%*p ", PLEN, ipxpcb.ipxp_ppcb); - printf("%-5.5s %6ld %6ld ", name, sockb.so_rcv.sb_cc, - sockb.so_snd.sb_cc); - printf(" %-22.22s", ipx_prpr(&ipxpcb.ipxp_laddr)); - printf(" %-22.22s", ipx_prpr(&ipxpcb.ipxp_faddr)); - if (isspx) { - extern char *tcpstates[]; - 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) \ - ((x) ? printf("\t%ld %s%s%s -- %s\n",x,y,plural(x),z,"x") : 0) - -/* - * Dump SPX statistics structure. - */ -void -spx_stats(u_long off, char *name) -{ - struct spx_istat spx_istat; -#define spxstat spx_istat.newstats - - if (off == 0) - return; - kread(off, &spx_istat, sizeof (spx_istat)); - printf("%s:\n", name); - ANY((long)spx_istat.nonucn, "connection", " dropped due to no new sockets "); - ANY((long)spx_istat.gonawy, "connection", " terminated due to our end dying"); - ANY((long)spx_istat.nonucn, "connection", - " dropped due to inability to connect"); - ANY((long)spx_istat.noconn, "connection", - " dropped due to inability to connect"); - ANY((long)spx_istat.notme, "connection", - " incompleted due to mismatched id's"); - ANY((long)spx_istat.wrncon, "connection", " dropped due to mismatched id's"); - ANY((long)spx_istat.bdreas, "packet", " dropped out of sequence"); - ANY((long)spx_istat.lstdup, "packet", " duplicating the highest packet"); - ANY((long)spx_istat.notyet, "packet", " refused as exceeding allocation"); - ANY(spxstat.spxs_connattempt, "connection", " initiated"); - ANY(spxstat.spxs_accepts, "connection", " accepted"); - ANY(spxstat.spxs_connects, "connection", " established"); - ANY(spxstat.spxs_drops, "connection", " dropped"); - ANY(spxstat.spxs_conndrops, "embryonic connection", " dropped"); - ANY(spxstat.spxs_closed, "connection", " closed (includes drops)"); - ANY(spxstat.spxs_segstimed, "packet", " where we tried to get rtt"); - ANY(spxstat.spxs_rttupdated, "time", " we got rtt"); - ANY(spxstat.spxs_delack, "delayed ack", " sent"); - ANY(spxstat.spxs_timeoutdrop, "connection", " dropped in rxmt timeout"); - ANY(spxstat.spxs_rexmttimeo, "retransmit timeout", ""); - ANY(spxstat.spxs_persisttimeo, "persist timeout", ""); - ANY(spxstat.spxs_keeptimeo, "keepalive timeout", ""); - ANY(spxstat.spxs_keepprobe, "keepalive probe", " sent"); - ANY(spxstat.spxs_keepdrops, "connection", " dropped in keepalive"); - ANY(spxstat.spxs_sndtotal, "total packet", " sent"); - ANY(spxstat.spxs_sndpack, "data packet", " sent"); - ANY(spxstat.spxs_sndbyte, "data byte", " sent"); - ANY(spxstat.spxs_sndrexmitpack, "data packet", " retransmitted"); - ANY(spxstat.spxs_sndrexmitbyte, "data byte", " retransmitted"); - ANY(spxstat.spxs_sndacks, "ack-only packet", " sent"); - ANY(spxstat.spxs_sndprobe, "window probe", " sent"); - ANY(spxstat.spxs_sndurg, "packet", " sent with URG only"); - ANY(spxstat.spxs_sndwinup, "window update-only packet", " sent"); - ANY(spxstat.spxs_sndctrl, "control (SYN|FIN|RST) packet", " sent"); - ANY(spxstat.spxs_sndvoid, "request", " to send a non-existent packet"); - ANY(spxstat.spxs_rcvtotal, "total packet", " received"); - ANY(spxstat.spxs_rcvpack, "packet", " received in sequence"); - ANY(spxstat.spxs_rcvbyte, "byte", " received in sequence"); - ANY(spxstat.spxs_rcvbadsum, "packet", " received with ccksum errs"); - ANY(spxstat.spxs_rcvbadoff, "packet", " received with bad offset"); - ANY(spxstat.spxs_rcvshort, "packet", " received too short"); - ANY(spxstat.spxs_rcvduppack, "duplicate-only packet", " received"); - ANY(spxstat.spxs_rcvdupbyte, "duplicate-only byte", " received"); - ANY(spxstat.spxs_rcvpartduppack, "packet", " with some duplicate data"); - ANY(spxstat.spxs_rcvpartdupbyte, "duplicate byte", " in part-duplicate packet"); - ANY(spxstat.spxs_rcvoopack, "out-of-order packet", " received"); - ANY(spxstat.spxs_rcvoobyte, "out-of-order byte", " received"); - ANY(spxstat.spxs_rcvpackafterwin, "packet", " with data after window"); - ANY(spxstat.spxs_rcvbyteafterwin, "byte", " rcvd after window"); - ANY(spxstat.spxs_rcvafterclose, "packet", " rcvd after 'close'"); - ANY(spxstat.spxs_rcvwinprobe, "rcvd window probe packet", ""); - ANY(spxstat.spxs_rcvdupack, "rcvd duplicate ack", ""); - ANY(spxstat.spxs_rcvacktoomuch, "rcvd ack", " for unsent data"); - ANY(spxstat.spxs_rcvackpack, "rcvd ack packet", ""); - 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%ld %s%s%s\n",x,y,plural(x),z) : 0) - -/* - * Dump IPX statistics structure. - */ -void -ipx_stats(u_long off, char *name) -{ - struct ipxstat ipxstat; - - if (off == 0) - return; - kread(off, &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_badsum, "packet", " with bad checksums"); -} - -#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, char *name) -{ - struct ipx_errstat ipx_errstat; - int j; - int histoprint = 1; - int z; - - if (off == 0) - return; - kread(off, &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"; - snprintf(codebuf, sizeof 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 = { 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 6c262637b45..41cbc949eeb 100644 --- a/usr.bin/netstat/main.c +++ b/usr.bin/netstat/main.c @@ -1,4 +1,4 @@ -/* $OpenBSD: main.c,v 1.65 2007/03/23 15:37:57 jmc Exp $ */ +/* $OpenBSD: main.c,v 1.66 2007/06/04 12:20:24 henning Exp $ */ /* $NetBSD: main.c,v 1.9 1996/05/07 02:55:02 thorpej Exp $ */ /* @@ -40,7 +40,7 @@ char copyright[] = #if 0 static char sccsid[] = "from: @(#)main.c 8.4 (Berkeley) 3/1/94"; #else -static char *rcsid = "$OpenBSD: main.c,v 1.65 2007/03/23 15:37:57 jmc Exp $"; +static char *rcsid = "$OpenBSD: main.c,v 1.66 2007/06/04 12:20:24 henning Exp $"; #endif #endif /* not lint */ @@ -102,12 +102,6 @@ struct nlist nl[] = { { "_mfchash" }, #define N_VIFTABLE 17 { "_viftable" }, -#define N_IPX 18 - { "_ipxcbtable"}, -#define N_IPXSTAT 19 - { "_ipxstat"}, -#define N_SPXSTAT 20 - { "_spx_istat"}, #define N_AHSTAT 21 { "_ahstat"}, #define N_ESPSTAT 22 @@ -219,15 +213,6 @@ struct protox ip6protox[] = { }; #endif -struct protox ipxprotox[] = { - { N_IPX, N_IPXSTAT, 1, ipxprotopr, - ipx_stats, 0, "ipx" }, - { N_IPX, N_SPXSTAT, 1, ipxprotopr, - spx_stats, 0, "spx" }, - { -1, -1, 0, 0, - 0, 0, 0 } -}; - struct protox atalkprotox[] = { { N_DDPCB, N_DDPSTAT, 1, atalkprotopr, ddp_stats, 0, "ddp" }, @@ -237,11 +222,11 @@ struct protox atalkprotox[] = { #ifndef INET6 struct protox *protoprotox[] = { - protox, ipxprotox, atalkprotox, NULL + protox, atalkprotox, NULL }; #else struct protox *protoprotox[] = { - protox, ip6protox, ipxprotox, atalkprotox, NULL + protox, ip6protox, atalkprotox, NULL }; #endif @@ -293,8 +278,6 @@ main(int argc, char *argv[]) af = AF_LOCAL; else if (strcmp(optarg, "unix") == 0) af = AF_UNIX; - else if (strcmp(optarg, "ipx") == 0) - af = AF_IPX; else if (strcmp(optarg, "encap") == 0) af = PF_KEY; else if (strcmp(optarg, "atalk") == 0) @@ -537,9 +520,6 @@ main(int argc, char *argv[]) for (tp = ip6protox; tp->pr_name; tp++) printproto(tp, tp->pr_name); #endif - if (af == AF_IPX || af == AF_UNSPEC) - for (tp = ipxprotox; tp->pr_name; tp++) - printproto(tp, tp->pr_name); if ((af == AF_UNIX || af == AF_UNSPEC) && !sflag) unixpr(nl[N_UNIXSW].n_value); if (af == AF_APPLETALK || af == AF_UNSPEC) diff --git a/usr.bin/netstat/netstat.1 b/usr.bin/netstat/netstat.1 index 995a908a34d..8e5c4869a74 100644 --- a/usr.bin/netstat/netstat.1 +++ b/usr.bin/netstat/netstat.1 @@ -1,4 +1,4 @@ -.\" $OpenBSD: netstat.1,v 1.49 2007/05/31 19:20:13 jmc Exp $ +.\" $OpenBSD: netstat.1,v 1.50 2007/06/04 12:20:24 henning Exp $ .\" $NetBSD: netstat.1,v 1.11 1995/10/03 21:42:43 thorpej Exp $ .\" .\" Copyright (c) 1983, 1990, 1992, 1993 @@ -30,7 +30,7 @@ .\" .\" from: @(#)netstat.1 8.8 (Berkeley) 4/18/94 .\" -.Dd $Mdocdate: May 31 2007 $ +.Dd $Mdocdate: June 4 2007 $ .Dt NETSTAT 1 .Os .Sh NAME @@ -138,7 +138,6 @@ The following address families are recognized: .It Sy "Address Family" Ta Sy "Constant" Ta Sy "Description" .It "inet" Ta Dv "AF_INET" Ta "IP Version 4" .It "inet6" Ta Dv "AF_INET6" Ta "IP Version 6" -.It "ipx" Ta Dv "AF_IPX" Ta "Novell IPX" .It "atalk" Ta Dv "AF_APPLETALK" Ta "AppleTalk" .It "encap" Ta Dv "PF_KEY" Ta "IPsec" .It "local" Ta Dv "AF_LOCAL" Ta "Local to Host (i.e., pipes)" diff --git a/usr.bin/netstat/netstat.h b/usr.bin/netstat/netstat.h index 52fc6591be2..e46b6192038 100644 --- a/usr.bin/netstat/netstat.h +++ b/usr.bin/netstat/netstat.h @@ -1,4 +1,4 @@ -/* $OpenBSD: netstat.h,v 1.40 2007/03/23 10:59:38 pyr Exp $ */ +/* $OpenBSD: netstat.h,v 1.41 2007/06/04 12:20:24 henning Exp $ */ /* $NetBSD: netstat.h,v 1.6 1996/05/07 02:55:05 thorpej Exp $ */ /* @@ -99,8 +99,6 @@ void rt_stats(int, u_long); void pr_rthdr(int, int); void pr_encaphdr(void); void pr_family(int); -char *ns_phost(struct sockaddr *); -char *ipx_phost(struct sockaddr *); #ifdef INET6 struct in6_addr; @@ -127,7 +125,6 @@ char *routename(struct sockaddr *); char *routename4(in_addr_t); char *netname(struct sockaddr *, struct sockaddr *); char *netname4(in_addr_t, in_addr_t); -char *ipx_print(struct sockaddr *); void routepr(u_long, u_long, u_long, u_long); void nsprotopr(u_long, char *); @@ -135,11 +132,6 @@ void spp_stats(u_long, char *); void idp_stats(u_long, char *); void nserr_stats(u_long, char *); -void ipxprotopr(u_long, char *); -void spx_stats(u_long, char *); -void ipx_stats(u_long, char *); -void ipxerr_stats(u_long, char *); - void intpr(int, u_long); void unixpr(u_long); diff --git a/usr.bin/netstat/show.c b/usr.bin/netstat/show.c index 3ff059bd036..894ec84abcf 100644 --- a/usr.bin/netstat/show.c +++ b/usr.bin/netstat/show.c @@ -1,4 +1,4 @@ -/* $OpenBSD: show.c,v 1.5 2007/03/23 10:59:38 pyr Exp $ */ +/* $OpenBSD: show.c,v 1.6 2007/06/04 12:20:24 henning Exp $ */ /* $NetBSD: show.c,v 1.1 1996/11/15 18:01:41 gwr Exp $ */ /* @@ -42,7 +42,6 @@ #include <net/pfkeyv2.h> #include <net/route.h> #include <netinet/in.h> -#include <netipx/ipx.h> #include <netinet/if_ether.h> #include <netinet/ip_ipsp.h> #include <arpa/inet.h> @@ -338,9 +337,6 @@ pr_family(int af) case AF_INET6: afname = "Internet6"; break; - case AF_IPX: - afname = "IPX"; - break; case PF_KEY: afname = "Encap"; break; @@ -568,9 +564,6 @@ routename(struct sockaddr *sa) return (routename6(&sin6)); } - case AF_IPX: - return (ipx_print(sa)); - case AF_LINK: return (link_print(sa)); @@ -778,8 +771,6 @@ netname(struct sockaddr *sa, struct sockaddr *mask) case AF_INET6: return netname6((struct sockaddr_in6 *)sa, (struct sockaddr_in6 *)mask); - case AF_IPX: - return (ipx_print(sa)); case AF_LINK: return (link_print(sa)); default: @@ -810,57 +801,6 @@ any_ntoa(const struct sockaddr *sa) return (obuf); } -short ipx_nullh[] = {0,0,0}; -short ipx_bh[] = {-1,-1,-1}; - -char * -ipx_print(struct sockaddr *sa) -{ - struct sockaddr_ipx *sipx = (struct sockaddr_ipx *)sa; - struct ipx_addr work; - union { - union ipx_net net_e; - u_int32_t long_e; - } net; - u_short port; - static char mybuf[50+MAXHOSTNAMELEN], cport[10], chost[25]; - char *host = ""; - char *p; - u_char *q; - - work = sipx->sipx_addr; - port = ntohs(work.ipx_port); - work.ipx_port = 0; - net.net_e = work.ipx_net; - if (ipx_nullhost(work) && net.long_e == 0) { - if (!port) - return ("*.*"); - (void)snprintf(mybuf, sizeof(mybuf), "*.0x%XH", port); - return (mybuf); - } - - if (memcmp(ipx_bh, work.ipx_host.c_host, 6) == 0) - host = "any"; - else if (memcmp(ipx_nullh, work.ipx_host.c_host, 6) == 0) - host = "*"; - else { - q = work.ipx_host.c_host; - (void)snprintf(chost, sizeof(chost), "%02X%02X%02X%02X%02X%02XH", - q[0], q[1], q[2], q[3], q[4], q[5]); - for (p = chost; *p == '0' && p < chost + 12; p++) - /* void */; - host = p; - } - if (port) - (void)snprintf(cport, sizeof(cport), ".%XH", htons(port)); - else - *cport = '\0'; - - (void)snprintf(mybuf, sizeof(mybuf), "%XH.%s%s", - ntohl(net.long_e), host, cport); - return (mybuf); -} - char * link_print(struct sockaddr *sa) { |