summaryrefslogtreecommitdiffstats
path: root/sbin
diff options
context:
space:
mode:
authorglebius <glebius@FreeBSD.org>2014-03-14 06:29:43 +0000
committerglebius <glebius@FreeBSD.org>2014-03-14 06:29:43 +0000
commit80e85e32a582ff3a03a87cb98dd996b7929f824b (patch)
treeb6714370b79bb13837321dcbc195eadc7047b2b2 /sbin
parentfc1b773c21c561cbe8c09b09d48f80aada9bc2f9 (diff)
downloadFreeBSD-src-80e85e32a582ff3a03a87cb98dd996b7929f824b.zip
FreeBSD-src-80e85e32a582ff3a03a87cb98dd996b7929f824b.tar.gz
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.
Diffstat (limited to 'sbin')
-rw-r--r--sbin/ifconfig/Makefile1
-rw-r--r--sbin/ifconfig/af_atalk.c182
-rw-r--r--sbin/ifconfig/ifconfig.841
-rw-r--r--sbin/route/keywords1
-rw-r--r--sbin/route/route.87
-rw-r--r--sbin/route/route.c64
6 files changed, 2 insertions, 294 deletions
diff --git a/sbin/ifconfig/Makefile b/sbin/ifconfig/Makefile
index 7393da4..d7c6452 100644
--- a/sbin/ifconfig/Makefile
+++ b/sbin/ifconfig/Makefile
@@ -21,7 +21,6 @@ SRCS+= af_inet.c # IPv4 support
.if ${MK_INET6_SUPPORT} != "no"
SRCS+= af_inet6.c # IPv6 support
.endif
-SRCS+= af_atalk.c # AppleTalk support
.if ${MK_INET6_SUPPORT} != "no"
SRCS+= af_nd6.c # ND6 support
.endif
diff --git a/sbin/ifconfig/af_atalk.c b/sbin/ifconfig/af_atalk.c
deleted file mode 100644
index c50e0fd1..0000000
--- a/sbin/ifconfig/af_atalk.c
+++ /dev/null
@@ -1,182 +0,0 @@
-/*
- * Copyright (c) 1983, 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.
- */
-
-#ifndef lint
-static const char rcsid[] =
- "$FreeBSD$";
-#endif /* not lint */
-
-#include <sys/types.h>
-#include <sys/ioctl.h>
-#include <sys/socket.h>
-#include <net/if.h>
-
-#include <netatalk/at.h>
-
-#include <err.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <unistd.h>
-#include <ifaddrs.h>
-
-#include <arpa/inet.h>
-
-#include "ifconfig.h"
-
-static struct netrange at_nr; /* AppleTalk net range */
-static struct ifaliasreq at_addreq;
-
-/* XXX FIXME -- should use strtoul for better parsing. */
-static void
-setatrange(const char *range, int dummy __unused, int s,
- const struct afswtch *afp)
-{
- u_int first = 123, last = 123;
-
- if (sscanf(range, "%u-%u", &first, &last) != 2
- || first == 0 || first > 0xffff
- || last == 0 || last > 0xffff || first > last)
- errx(1, "%s: illegal net range: %u-%u", range, first, last);
- at_nr.nr_firstnet = htons(first);
- at_nr.nr_lastnet = htons(last);
-}
-
-static void
-setatphase(const char *phase, int dummy __unused, int s,
- const struct afswtch *afp)
-{
- if (!strcmp(phase, "1"))
- at_nr.nr_phase = 1;
- else if (!strcmp(phase, "2"))
- at_nr.nr_phase = 2;
- else
- errx(1, "%s: illegal phase", phase);
-}
-
-static void
-at_status(int s __unused, const struct ifaddrs *ifa)
-{
- struct sockaddr_at *sat, null_sat;
- struct netrange *nr;
-
- memset(&null_sat, 0, sizeof(null_sat));
-
- sat = (struct sockaddr_at *)ifa->ifa_addr;
- if (sat == NULL)
- return;
- nr = &sat->sat_range.r_netrange;
- printf("\tatalk %d.%d range %d-%d phase %d",
- ntohs(sat->sat_addr.s_net), sat->sat_addr.s_node,
- ntohs(nr->nr_firstnet), ntohs(nr->nr_lastnet), nr->nr_phase);
- if (ifa->ifa_flags & IFF_POINTOPOINT) {
- sat = (struct sockaddr_at *)ifa->ifa_dstaddr;
- if (sat == NULL)
- sat = &null_sat;
- printf("--> %d.%d",
- ntohs(sat->sat_addr.s_net), sat->sat_addr.s_node);
- }
- if (ifa->ifa_flags & IFF_BROADCAST) {
- sat = (struct sockaddr_at *)ifa->ifa_broadaddr;
- if (sat != NULL)
- printf(" broadcast %d.%d",
- ntohs(sat->sat_addr.s_net),
- sat->sat_addr.s_node);
- }
-
- putchar('\n');
-}
-
-static void
-at_getaddr(const char *addr, int which)
-{
- struct sockaddr_at *sat = (struct sockaddr_at *) &at_addreq.ifra_addr;
- u_int net, node;
-
- sat->sat_family = AF_APPLETALK;
- sat->sat_len = sizeof(*sat);
- if (which == MASK)
- errx(1, "AppleTalk does not use netmasks");
- if (sscanf(addr, "%u.%u", &net, &node) != 2
- || net > 0xffff || node > 0xfe)
- errx(1, "%s: illegal address", addr);
- sat->sat_addr.s_net = htons(net);
- sat->sat_addr.s_node = node;
-}
-
-static void
-at_postproc(int s, const struct afswtch *afp)
-{
- struct sockaddr_at *sat = (struct sockaddr_at *) &at_addreq.ifra_addr;
-
- if (at_nr.nr_phase == 0)
- at_nr.nr_phase = 2; /* Default phase 2 */
- if (at_nr.nr_firstnet == 0)
- at_nr.nr_firstnet = /* Default range of one */
- at_nr.nr_lastnet = sat->sat_addr.s_net;
- printf("\tatalk %d.%d range %d-%d phase %d\n",
- ntohs(sat->sat_addr.s_net), sat->sat_addr.s_node,
- ntohs(at_nr.nr_firstnet), ntohs(at_nr.nr_lastnet),
- at_nr.nr_phase);
- if ((u_short) ntohs(at_nr.nr_firstnet) >
- (u_short) ntohs(sat->sat_addr.s_net)
- || (u_short) ntohs(at_nr.nr_lastnet) <
- (u_short) ntohs(sat->sat_addr.s_net))
- errx(1, "AppleTalk address is not in range");
- sat->sat_range.r_netrange = at_nr;
-}
-
-static struct cmd atalk_cmds[] = {
- DEF_CMD_ARG("range", setatrange),
- DEF_CMD_ARG("phase", setatphase),
-};
-
-static struct afswtch af_atalk = {
- .af_name = "atalk",
- .af_af = AF_APPLETALK,
- .af_status = at_status,
- .af_getaddr = at_getaddr,
- .af_postproc = at_postproc,
- .af_difaddr = SIOCDIFADDR,
- .af_aifaddr = SIOCAIFADDR,
- .af_ridreq = &at_addreq,
- .af_addreq = &at_addreq,
-};
-
-static __constructor void
-atalk_ctor(void)
-{
-#define N(a) (sizeof(a) / sizeof(a[0]))
- size_t i;
-
- for (i = 0; i < N(atalk_cmds); i++)
- cmd_register(&atalk_cmds[i]);
- af_register(&af_atalk);
-#undef N
-}
diff --git a/sbin/ifconfig/ifconfig.8 b/sbin/ifconfig/ifconfig.8
index 0bf92d7..8116cb7 100644
--- a/sbin/ifconfig/ifconfig.8
+++ b/sbin/ifconfig/ifconfig.8
@@ -158,7 +158,6 @@ The address or protocol families currently
supported are
.Dq inet ,
.Dq inet6 ,
-.Dq atalk ,
and
.Dq link .
The default if available is
@@ -562,42 +561,6 @@ The prefix can also be specified using the slash notation after the address.
See the
.Ar address
option above for more information.
-.\" see
-.\" Xr eon 5 .
-.\" .It Cm nsellength Ar n
-.\" .Pf ( Tn ISO
-.\" only)
-.\" This specifies a trailing number of bytes for a received
-.\" .Tn NSAP
-.\" used for local identification, the remaining leading part of which is
-.\" taken to be the
-.\" .Tn NET
-.\" (Network Entity Title).
-.\" The default value is 1, which is conformant to US
-.\" .Tn GOSIP .
-.\" When an ISO address is set in an ifconfig command,
-.\" it is really the
-.\" .Tn NSAP
-.\" which is being specified.
-.\" For example, in
-.\" .Tn US GOSIP ,
-.\" 20 hex digits should be
-.\" specified in the
-.\" .Tn ISO NSAP
-.\" to be assigned to the interface.
-.\" There is some evidence that a number different from 1 may be useful
-.\" for
-.\" .Tn AFI
-.\" 37 type addresses.
-.It Cm range Ar netrange
-Under appletalk, set the interface to respond to a
-.Ar netrange
-of the form
-.Ar startnet Ns - Ns Ar endnet .
-Appletalk uses this scheme instead of
-netmasks though
-.Fx
-implements it internally as a set of netmasks.
.It Cm remove
Another name for the
.Fl alias
@@ -605,10 +568,6 @@ parameter.
Introduced for compatibility
with
.Bsx .
-.It Cm phase
-The argument following this specifies the version (phase) of the
-Appletalk network attached to the interface.
-Values of 1 or 2 are permitted.
.Sm off
.It Cm link Op Cm 0 No - Cm 2
.Sm on
diff --git a/sbin/route/keywords b/sbin/route/keywords
index bb0968b..8b64be2 100644
--- a/sbin/route/keywords
+++ b/sbin/route/keywords
@@ -4,7 +4,6 @@
4
6
add
-atalk
blackhole
change
cloning
diff --git a/sbin/route/route.8 b/sbin/route/route.8
index ecfeac6..000fbe9 100644
--- a/sbin/route/route.8
+++ b/sbin/route/route.8
@@ -144,7 +144,6 @@ will ``flush'' the routing tables of all gateway entries.
When the address family may is specified by any of the
.Fl osi ,
.Fl xns ,
-.Fl atalk ,
.Fl inet6 ,
or
.Fl inet
@@ -255,14 +254,12 @@ if the local or remote addresses change.
The optional modifiers
.Fl xns ,
.Fl osi ,
-.Fl atalk ,
and
.Fl link
specify that all subsequent addresses are in the
-.Tn XNS ,
-.Tn OSI ,
+.Tn XNS
or
-.Tn AppleTalk
+.Tn OSI
address families,
or are specified as link-level addresses,
and the names must be numeric specifications rather than
diff --git a/sbin/route/route.c b/sbin/route/route.c
index d3be6b7..f22d9d2 100644
--- a/sbin/route/route.c
+++ b/sbin/route/route.c
@@ -55,7 +55,6 @@ __FBSDID("$FreeBSD$");
#include <net/if_dl.h>
#include <netinet/in.h>
#include <netinet/if_ether.h>
-#include <netatalk/at.h>
#include <arpa/inet.h>
#include <netdb.h>
@@ -72,8 +71,6 @@ __FBSDID("$FreeBSD$");
#include <unistd.h>
#include <ifaddrs.h>
-#define ATALK_BUF_SIZE 20
-
struct fibl {
TAILQ_ENTRY(fibl) fl_next;
@@ -114,8 +111,6 @@ static struct {
static TAILQ_HEAD(fibl_head_t, fibl) fibl_head;
-static int atalk_aton(const char *, struct at_addr *);
-static char *atalk_ntoa(struct at_addr, char [ATALK_BUF_SIZE]);
static void printb(int, const char *);
static void flushroutes(int argc, char *argv[]);
static int flushroutes_fib(int);
@@ -409,9 +404,6 @@ flushroutes(int argc, char *argv[])
af = AF_INET6;
break;
#endif
- case K_ATALK:
- af = AF_APPLETALK;
- break;
case K_LINK:
af = AF_LINK;
break;
@@ -526,7 +518,6 @@ routename(struct sockaddr *sa)
{
struct sockaddr_dl *sdl;
const char *cp;
- char atalk_buf[ATALK_BUF_SIZE];
int n;
if (!domain_initialized) {
@@ -604,12 +595,6 @@ routename(struct sockaddr *sa)
break;
}
#endif
- case AF_APPLETALK:
- (void)snprintf(rt_line, sizeof(rt_line), "atalk %s",
- atalk_ntoa(((struct sockaddr_at *)(void *)sa)->sat_addr,
- atalk_buf));
- break;
-
case AF_LINK:
sdl = (struct sockaddr_dl *)(void *)sa;
@@ -651,7 +636,6 @@ static const char *
netname(struct sockaddr *sa)
{
struct sockaddr_dl *sdl;
- char atalk_buf[ATALK_BUF_SIZE];
int n;
#ifdef INET
struct netent *np = NULL;
@@ -712,13 +696,6 @@ netname(struct sockaddr *sa)
return(net_line);
}
#endif
-
- case AF_APPLETALK:
- (void)snprintf(net_line, sizeof(net_line), "atalk %s",
- atalk_ntoa(((struct sockaddr_at *)(void *)sa)->sat_addr,
- atalk_buf));
- break;
-
case AF_LINK:
sdl = (struct sockaddr_dl *)(void *)sa;
@@ -838,10 +815,6 @@ newroute(int argc, char **argv)
aflen = sizeof(struct sockaddr_in6);
break;
#endif
- case K_ATALK:
- af = AF_APPLETALK;
- aflen = sizeof(struct sockaddr_at);
- break;
case K_SA:
af = PF_ROUTE;
aflen = sizeof(struct sockaddr_storage);
@@ -1304,16 +1277,6 @@ getaddr(int idx, char *str, struct hostent **hpp, int nrflags)
return (0);
}
#endif /* INET6 */
-
- case AF_APPLETALK:
- {
- struct sockaddr_at *sat = (struct sockaddr_at *)(void *)sa;
-
- if (!atalk_aton(str, &sat->sat_addr))
- errx(EX_NOHOST, "bad address: %s", str);
- rtm_addrs |= RTA_NETMASK;
- return(forcehost || sat->sat_addr.s_node != 0);
- }
case AF_LINK:
link_addr(str, (struct sockaddr_dl *)(void *)sa);
return (1);
@@ -1892,7 +1855,6 @@ keyword(const char *cp)
static void
sodump(struct sockaddr *sa, const char *which)
{
- char atalk_buf[ATALK_BUF_SIZE];
#ifdef INET6
char nbuf[INET6_ADDRSTRLEN];
#endif
@@ -1915,11 +1877,6 @@ sodump(struct sockaddr *sa, const char *which)
sizeof(nbuf)));
break;
#endif
- case AF_APPLETALK:
- (void)printf("%s: atalk %s; ", which,
- atalk_ntoa(((struct sockaddr_at *)(void *)sa)->sat_addr,
- atalk_buf));
- break;
}
(void)fflush(stdout);
}
@@ -1973,24 +1930,3 @@ sockaddr(char *addr, struct sockaddr *sa, size_t size)
} while (cp < cplim);
sa->sa_len = cp - (char *)sa;
}
-
-static int
-atalk_aton(const char *text, struct at_addr *addr)
-{
- u_int net, node;
-
- if (sscanf(text, "%u.%u", &net, &node) != 2
- || net > 0xffff || node > 0xff)
- return(0);
- addr->s_net = htons(net);
- addr->s_node = node;
- return(1);
-}
-
-static char *
-atalk_ntoa(struct at_addr at, char buf[ATALK_BUF_SIZE])
-{
- (void)snprintf(buf, ATALK_BUF_SIZE, "%u.%u", ntohs(at.s_net), at.s_node);
- buf[ATALK_BUF_SIZE - 1] = '\0';
- return(buf);
-}
OpenPOWER on IntegriCloud