From 80e85e32a582ff3a03a87cb98dd996b7929f824b Mon Sep 17 00:00:00 2001 From: glebius Date: Fri, 14 Mar 2014 06:29:43 +0000 Subject: Remove AppleTalk support. AppleTalk was a network transport protocol for Apple Macintosh devices in 80s and then 90s. Starting with Mac OS X in 2000 the AppleTalk was a legacy protocol and primary networking protocol is TCP/IP. The last Mac OS X release to support AppleTalk happened in 2009. The same year routing equipment vendors (namely Cisco) end their support. Thus, AppleTalk won't be supported in FreeBSD 11.0-RELEASE. --- usr.bin/kdump/kdump.c | 18 --- usr.bin/netstat/Makefile | 2 +- usr.bin/netstat/atalk.c | 285 ---------------------------------------------- usr.bin/netstat/if.c | 6 - usr.bin/netstat/main.c | 89 ++++++--------- usr.bin/netstat/netstat.1 | 2 - usr.bin/netstat/netstat.h | 5 - usr.bin/netstat/route.c | 12 -- 8 files changed, 38 insertions(+), 381 deletions(-) delete mode 100644 usr.bin/netstat/atalk.c (limited to 'usr.bin') diff --git a/usr.bin/kdump/kdump.c b/usr.bin/kdump/kdump.c index 9e85f3a..d18918f 100644 --- a/usr.bin/kdump/kdump.c +++ b/usr.bin/kdump/kdump.c @@ -60,9 +60,6 @@ extern int errno; #include #include #include -#ifdef NETATALK -#include -#endif #include #include #include @@ -1656,21 +1653,6 @@ ktrsockaddr(struct sockaddr *sa) printf("%s:%u", addr, ntohs(sa_in.sin_port)); break; } -#ifdef NETATALK - case AF_APPLETALK: { - struct sockaddr_at sa_at; - struct netrange *nr; - - memset(&sa_at, 0, sizeof(sa_at)); - memcpy(&sa_at, sa, sa->sa_len); - check_sockaddr_len(at); - nr = &sa_at.sat_range.r_netrange; - printf("%d.%d, %d-%d, %d", ntohs(sa_at.sat_addr.s_net), - sa_at.sat_addr.s_node, ntohs(nr->nr_firstnet), - ntohs(nr->nr_lastnet), nr->nr_phase); - break; - } -#endif case AF_INET6: { struct sockaddr_in6 sa_in6; diff --git a/usr.bin/netstat/Makefile b/usr.bin/netstat/Makefile index b9af87a..ff97074 100644 --- a/usr.bin/netstat/Makefile +++ b/usr.bin/netstat/Makefile @@ -5,7 +5,7 @@ PROG= netstat SRCS= if.c inet.c main.c mbuf.c mroute.c netisr.c route.c \ - unix.c atalk.c mroute6.c ipsec.c bpf.c pfkey.c sctp.c \ + unix.c mroute6.c ipsec.c bpf.c pfkey.c sctp.c \ flowtable.c WARNS?= 3 diff --git a/usr.bin/netstat/atalk.c b/usr.bin/netstat/atalk.c deleted file mode 100644 index dc1de3f..0000000 --- a/usr.bin/netstat/atalk.c +++ /dev/null @@ -1,285 +0,0 @@ -/*- - * 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. - * 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[] = "@(#)atalk.c 1.1 (Whistle) 6/6/96"; -#endif /* not lint */ -#endif - -#include -__FBSDID("$FreeBSD$"); - -#include -#include -#include -#include -#include - -#include -#include - -#include -#include - -#include -#include -#include -#include -#include -#include -#include "netstat.h" - -struct ddpcb ddpcb; -struct socket sockb; - -static int first = 1; - -/* - * Print a summary of connections related to a Network Systems - * protocol. For XXX, also give state of connection. - * Listening processes (aflag) are suppressed unless the - * -a (all) flag is specified. - */ - -static const char * -at_pr_net(struct sockaddr_at *sat, int numeric) -{ -static char mybuf[50]; - - if (!numeric) { - switch(sat->sat_addr.s_net) { - case 0xffff: - return "????"; - case ATADDR_ANYNET: - return("*"); - } - } - sprintf(mybuf,"%hu",ntohs(sat->sat_addr.s_net)); - return mybuf; -} - -static const char * -at_pr_host(struct sockaddr_at *sat, int numeric) -{ -static char mybuf[50]; - - if (!numeric) { - switch(sat->sat_addr.s_node) { - case ATADDR_BCAST: - return "bcast"; - case ATADDR_ANYNODE: - return("*"); - } - } - sprintf(mybuf,"%d",(unsigned int)sat->sat_addr.s_node); - return mybuf; -} - -static const char * -at_pr_port(struct sockaddr_at *sat) -{ -static char mybuf[50]; - struct servent *serv; - - switch(sat->sat_port) { - case ATADDR_ANYPORT: - return("*"); - case 0xff: - return "????"; - default: - if (numeric_port) { - (void)snprintf(mybuf, sizeof(mybuf), "%d", - (unsigned int)sat->sat_port); - } else { - serv = getservbyport(sat->sat_port, "ddp"); - if (serv == NULL) - (void)snprintf(mybuf, sizeof(mybuf), "%d", - (unsigned int) sat->sat_port); - else - (void) snprintf(mybuf, sizeof(mybuf), "%s", - serv->s_name); - } - } - return mybuf; -} - -static char * -at_pr_range(struct sockaddr_at *sat) -{ -static char mybuf[50]; - - if(sat->sat_range.r_netrange.nr_firstnet - != sat->sat_range.r_netrange.nr_lastnet) { - sprintf(mybuf,"%d-%d", - ntohs(sat->sat_range.r_netrange.nr_firstnet), - ntohs(sat->sat_range.r_netrange.nr_lastnet)); - } else { - sprintf(mybuf,"%d", - ntohs(sat->sat_range.r_netrange.nr_firstnet)); - } - return mybuf; -} - - -/* what == 0 for addr only == 3 */ -/* 1 for net */ -/* 2 for host */ -/* 4 for port */ -/* 8 for numeric only */ -char * -atalk_print(struct sockaddr *sa, int what) -{ - struct sockaddr_at *sat = (struct sockaddr_at *)sa; - static char mybuf[50]; - int numeric = (what & 0x08); - - mybuf[0] = 0; - switch (what & 0x13) { - case 0: - mybuf[0] = 0; - break; - case 1: - sprintf(mybuf,"%s",at_pr_net(sat, numeric)); - break; - case 2: - sprintf(mybuf,"%s",at_pr_host(sat, numeric)); - break; - case 3: - sprintf(mybuf,"%s.%s", - at_pr_net(sat, numeric), - at_pr_host(sat, numeric)); - break; - case 0x10: - sprintf(mybuf,"%s", at_pr_range(sat)); - } - if (what & 4) { - sprintf(mybuf+strlen(mybuf),".%s",at_pr_port(sat)); - } - return mybuf; -} - -char * -atalk_print2(struct sockaddr *sa, struct sockaddr *mask, int what) -{ - int n; - static char buf[100]; - struct sockaddr_at *sat1, *sat2; - struct sockaddr_at thesockaddr; - struct sockaddr *sa2; - - sat1 = (struct sockaddr_at *)sa; - sat2 = (struct sockaddr_at *)mask; - sa2 = (struct sockaddr *)&thesockaddr; - - thesockaddr.sat_addr.s_net = sat1->sat_addr.s_net & sat2->sat_addr.s_net; - snprintf(buf, sizeof(buf), "%s", atalk_print(sa2, 1 |(what & 8))); - if(sat2->sat_addr.s_net != 0xFFFF) { - thesockaddr.sat_addr.s_net = sat1->sat_addr.s_net | ~sat2->sat_addr.s_net; - n = strlen(buf); - snprintf(buf + n, sizeof(buf) - n, "-%s", atalk_print(sa2, 1 |(what & 8))); - } - if(what & 2) { - n = strlen(buf); - snprintf(buf + n, sizeof(buf) - n, ".%s", atalk_print(sa, what & (~1))); - } - return(buf); -} - -void -atalkprotopr(u_long off __unused, const char *name, int af1 __unused, - int proto __unused) -{ - struct ddpcb *this, *next; - - if (off == 0) - return; - kread(off, (char *)&this, sizeof (struct ddpcb *)); - for ( ; this != NULL; this = next) { - kread((u_long)this, (char *)&ddpcb, sizeof (ddpcb)); - next = ddpcb.ddp_next; -#if 0 - if (!aflag && atalk_nullhost(ddpcb.ddp_lsat) ) { - continue; - } -#endif - kread((u_long)ddpcb.ddp_socket, (char *)&sockb, sizeof (sockb)); - if (first) { - printf("Active ATALK 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 ", (u_long) this); - printf("%-5.5s %6u %6u ", name, sockb.so_rcv.sb_cc, - sockb.so_snd.sb_cc); - printf(Aflag?" %-18.18s":" %-22.22s", atalk_print( - (struct sockaddr *)&ddpcb.ddp_lsat,7)); - printf(Aflag?" %-18.18s":" %-22.22s", atalk_print( - (struct sockaddr *)&ddpcb.ddp_fsat,7)); - putchar('\n'); - } -} - -#define ANY(x,y,z) if (x || sflag <= 1) \ - printf("\t%lu %s%s%s\n",x,y,plural(x),z) - -/* - * Dump DDP statistics structure. - */ -void -ddp_stats(u_long off __unused, const char *name, int af1 __unused, - int proto __unused) -{ - struct ddpstat ddpstat; - - if (off == 0) - return; - kread(off, (char *)&ddpstat, sizeof (ddpstat)); - printf("%s:\n", name); - ANY(ddpstat.ddps_short, "packet", " with short headers "); - ANY(ddpstat.ddps_long, "packet", " with long headers "); - ANY(ddpstat.ddps_nosum, "packet", " with no checksum "); - ANY(ddpstat.ddps_tooshort, "packet", " too short "); - ANY(ddpstat.ddps_badsum, "packet", " with bad checksum "); - ANY(ddpstat.ddps_toosmall, "packet", " with not enough data "); - ANY(ddpstat.ddps_forward, "packet", " forwarded "); - ANY(ddpstat.ddps_encap, "packet", " encapsulated "); - ANY(ddpstat.ddps_cantforward, "packet", " rcvd for unreachable dest "); - ANY(ddpstat.ddps_nosockspace, "packet", " dropped due to no socket space "); -} diff --git a/usr.bin/netstat/if.c b/usr.bin/netstat/if.c index aeb59091..ce2db16 100644 --- a/usr.bin/netstat/if.c +++ b/usr.bin/netstat/if.c @@ -323,12 +323,6 @@ intpr(int interval, void (*pfunc)(char *), int af) break; } #endif /* INET6 */ - case AF_APPLETALK: - printf("atalk:%-12.12s ", - atalk_print(ifa->ifa_addr, 0x10)); - printf("%-11.11s ", - atalk_print(ifa->ifa_addr, 0x0b)); - break; case AF_LINK: { struct sockaddr_dl *sdl; diff --git a/usr.bin/netstat/main.c b/usr.bin/netstat/main.c index d928b7f..5fe4917 100644 --- a/usr.bin/netstat/main.c +++ b/usr.bin/netstat/main.c @@ -80,81 +80,77 @@ static struct nlist nl[] = { { .n_name = "_mfchashtbl" }, #define N_VIFTABLE 4 { .n_name = "_viftable" }, -#define N_DDPSTAT 5 - { .n_name = "_ddpstat"}, -#define N_DDPCB 6 - { .n_name = "_ddpcb"}, -#define N_NGSOCKS 7 +#define N_NGSOCKS 5 { .n_name = "_ngsocklist"}, -#define N_IP6STAT 8 +#define N_IP6STAT 6 { .n_name = "_ip6stat" }, -#define N_ICMP6STAT 9 +#define N_ICMP6STAT 7 { .n_name = "_icmp6stat" }, -#define N_IPSECSTAT 10 +#define N_IPSECSTAT 8 { .n_name = "_ipsec4stat" }, -#define N_IPSEC6STAT 11 +#define N_IPSEC6STAT 9 { .n_name = "_ipsec6stat" }, -#define N_PIM6STAT 12 +#define N_PIM6STAT 10 { .n_name = "_pim6stat" }, -#define N_MRT6STAT 13 +#define N_MRT6STAT 11 { .n_name = "_mrt6stat" }, -#define N_MF6CTABLE 14 +#define N_MF6CTABLE 12 { .n_name = "_mf6ctable" }, -#define N_MIF6TABLE 15 +#define N_MIF6TABLE 13 { .n_name = "_mif6table" }, -#define N_PFKEYSTAT 16 +#define N_PFKEYSTAT 14 { .n_name = "_pfkeystat" }, -#define N_RTTRASH 17 +#define N_RTTRASH 15 { .n_name = "_rttrash" }, -#define N_CARPSTAT 18 +#define N_CARPSTAT 16 { .n_name = "_carpstats" }, -#define N_PFSYNCSTAT 19 +#define N_PFSYNCSTAT 17 { .n_name = "_pfsyncstats" }, -#define N_AHSTAT 20 +#define N_AHSTAT 18 { .n_name = "_ahstat" }, -#define N_ESPSTAT 21 +#define N_ESPSTAT 19 { .n_name = "_espstat" }, -#define N_IPCOMPSTAT 22 +#define N_IPCOMPSTAT 20 { .n_name = "_ipcompstat" }, -#define N_TCPSTAT 23 +#define N_TCPSTAT 21 { .n_name = "_tcpstat" }, -#define N_UDPSTAT 24 +#define N_UDPSTAT 22 { .n_name = "_udpstat" }, -#define N_IPSTAT 25 +#define N_IPSTAT 23 { .n_name = "_ipstat" }, -#define N_ICMPSTAT 26 +#define N_ICMPSTAT 24 { .n_name = "_icmpstat" }, -#define N_IGMPSTAT 27 +#define N_IGMPSTAT 25 { .n_name = "_igmpstat" }, -#define N_PIMSTAT 28 +#define N_PIMSTAT 26 { .n_name = "_pimstat" }, -#define N_TCBINFO 29 +#define N_TCBINFO 27 { .n_name = "_tcbinfo" }, -#define N_UDBINFO 30 +#define N_UDBINFO 28 { .n_name = "_udbinfo" }, -#define N_DIVCBINFO 31 +#define N_DIVCBINFO 29 { .n_name = "_divcbinfo" }, -#define N_RIPCBINFO 32 +#define N_RIPCBINFO 30 { .n_name = "_ripcbinfo" }, -#define N_UNP_COUNT 33 +#define N_UNP_COUNT 31 { .n_name = "_unp_count" }, -#define N_UNP_GENCNT 34 +#define N_UNP_GENCNT 32 { .n_name = "_unp_gencnt" }, -#define N_UNP_DHEAD 35 +#define N_UNP_DHEAD 33 { .n_name = "_unp_dhead" }, -#define N_UNP_SHEAD 36 +#define N_UNP_SHEAD 34 { .n_name = "_unp_shead" }, -#define N_RIP6STAT 37 +#define N_RIP6STAT 36 { .n_name = "_rip6stat" }, -#define N_SCTPSTAT 38 +#define N_SCTPSTAT 36 { .n_name = "_sctpstat" }, -#define N_MFCTABLESIZE 39 +#define N_MFCTABLESIZE 37 { .n_name = "_mfctablesize" }, -#define N_ARPSTAT 40 +#define N_ARPSTAT 38 { .n_name = "_arpstat" }, -#define N_UNP_SPHEAD 41 +#define N_UNP_SPHEAD 39 { .n_name = "unp_sphead" }, -#define N_SFSTAT 42 +#define N_SFSTAT 40 { .n_name = "_sfstat"}, { .n_name = NULL }, }; @@ -254,12 +250,6 @@ struct protox pfkeyprotox[] = { }; #endif -struct protox atalkprotox[] = { - { N_DDPCB, N_DDPSTAT, 1, atalkprotopr, - ddp_stats, NULL, "ddp", 0, 0 }, - { -1, -1, 0, NULL, - NULL, NULL, NULL, 0, 0 } -}; #ifdef NETGRAPH struct protox netgraphprotox[] = { { N_NGSOCKS, -1, 1, netgraphprotopr, @@ -279,7 +269,7 @@ struct protox *protoprotox[] = { #ifdef IPSEC pfkeyprotox, #endif - atalkprotox, NULL }; + NULL }; static void printproto(struct protox *, const char *); static void usage(void); @@ -380,8 +370,6 @@ main(int argc, char *argv[]) #endif else if (strcmp(optarg, "unix") == 0) af = AF_UNIX; - else if (strcmp(optarg, "atalk") == 0) - af = AF_APPLETALK; #ifdef NETGRAPH else if (strcmp(optarg, "ng") == 0 || strcmp(optarg, "netgraph") == 0) @@ -595,9 +583,6 @@ main(int argc, char *argv[]) for (tp = pfkeyprotox; tp->pr_name; tp++) printproto(tp, tp->pr_name); #endif /*IPSEC*/ - if (af == AF_APPLETALK || af == AF_UNSPEC) - for (tp = atalkprotox; tp->pr_name; tp++) - printproto(tp, tp->pr_name); #ifdef NETGRAPH if (af == AF_NETGRAPH || af == AF_UNSPEC) for (tp = netgraphprotox; tp->pr_name; tp++) diff --git a/usr.bin/netstat/netstat.1 b/usr.bin/netstat/netstat.1 index 575db85..6f8a03d 100644 --- a/usr.bin/netstat/netstat.1 +++ b/usr.bin/netstat/netstat.1 @@ -350,8 +350,6 @@ The following address families and protocols are recognized: .Cm icmp6 , ip6 , ipsec6 , rip6 , tcp , udp .It Cm pfkey Pq Dv PF_KEY .Cm pfkey -.It Cm atalk Pq Dv AF_APPLETALK -.Cm ddp .It Cm netgraph , ng Pq Dv AF_NETGRAPH .Cm ctrl , data .It Cm unix Pq Dv AF_UNIX diff --git a/usr.bin/netstat/netstat.h b/usr.bin/netstat/netstat.h index 5747cea..ebbdd5d 100644 --- a/usr.bin/netstat/netstat.h +++ b/usr.bin/netstat/netstat.h @@ -130,8 +130,6 @@ void flowtable_stats(void); 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 *ns_print(struct sockaddr *); void routepr(int, int); @@ -140,9 +138,6 @@ void spp_stats(u_long, const char *, int, int); void idp_stats(u_long, const char *, int, int); void nserr_stats(u_long, const char *, int, int); -void atalkprotopr(u_long, const char *, int, int); -void ddp_stats(u_long, const char *, int, int); - #ifdef NETGRAPH void netgraphprotopr(u_long, const char *, int, int); #endif diff --git a/usr.bin/netstat/route.c b/usr.bin/netstat/route.c index 2d443a5..78ffdcd 100644 --- a/usr.bin/netstat/route.c +++ b/usr.bin/netstat/route.c @@ -52,7 +52,6 @@ __FBSDID("$FreeBSD$"); #include #include -#include #include #include @@ -218,9 +217,6 @@ pr_family(int af1) case AF_ISO: afname = "ISO"; break; - case AF_APPLETALK: - afname = "AppleTalk"; - break; case AF_CCITT: afname = "X.25"; break; @@ -750,14 +746,6 @@ fmt_sockaddr(struct sockaddr *sa, struct sockaddr *mask, int flags) } #endif /*INET6*/ - case AF_APPLETALK: - { - if (!(flags & RTF_HOST) && mask) - cp = atalk_print2(sa,mask,9); - else - cp = atalk_print(sa,11); - break; - } case AF_NETGRAPH: { strlcpy(workbuf, ((struct sockaddr_ng *)sa)->sg_data, -- cgit v1.1