summaryrefslogtreecommitdiff
path: root/sbin/route
diff options
context:
space:
mode:
Diffstat (limited to 'sbin/route')
-rw-r--r--sbin/route/keywords4
-rw-r--r--sbin/route/keywords.c4
-rw-r--r--sbin/route/keywords.h60
-rw-r--r--sbin/route/keywords.sh4
-rw-r--r--sbin/route/route.827
-rw-r--r--sbin/route/route.c74
-rw-r--r--sbin/route/show.c71
7 files changed, 41 insertions, 203 deletions
diff --git a/sbin/route/keywords b/sbin/route/keywords
index 5122d760a0d..9e26b0bdb37 100644
--- a/sbin/route/keywords
+++ b/sbin/route/keywords
@@ -1,4 +1,4 @@
-# $OpenBSD: keywords,v 1.3 1996/08/16 09:26:10 mickey Exp $
+# $OpenBSD: keywords,v 1.4 2004/06/25 01:26:01 henning Exp $
# $NetBSD: keywords,v 1.6 1995/04/20 17:39:17 mycroft Exp $
# @(#)keywords 8.2 (Berkeley) 3/19/94
@@ -32,7 +32,6 @@ mtu
net
netmask
nostatic
-osi
proto1
proto2
recvpipe
@@ -44,5 +43,4 @@ sendpipe
ssthresh
static
x25
-xns
xresolve
diff --git a/sbin/route/keywords.c b/sbin/route/keywords.c
index e45986b497b..a205ff55ae5 100644
--- a/sbin/route/keywords.c
+++ b/sbin/route/keywords.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: keywords.c,v 1.8 2004/06/19 19:55:53 cedric Exp $ */
+/* $OpenBSD: keywords.c,v 1.9 2004/06/25 01:26:01 henning Exp $ */
/* WARNING! This file was generated by keywords.sh */
@@ -26,7 +26,6 @@ struct keytab keywords[] = {
{"inet", K_INET},
{"inet6", K_INET6},
{"ipx", K_IPX},
- {"iso", K_ISO},
{"link", K_LINK},
{"llinfo", K_LLINFO},
{"lock", K_LOCK},
@@ -54,7 +53,6 @@ struct keytab keywords[] = {
{"ssthresh", K_SSTHRESH},
{"static", K_STATIC},
{"x25", K_X25},
- {"xns", K_XNS},
{"xresolve", K_XRESOLVE},
{0, 0}
};
diff --git a/sbin/route/keywords.h b/sbin/route/keywords.h
index c3584a23d5a..c3cf9177d51 100644
--- a/sbin/route/keywords.h
+++ b/sbin/route/keywords.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: keywords.h,v 1.8 2004/06/19 19:55:53 cedric Exp $ */
+/* $OpenBSD: keywords.h,v 1.9 2004/06/25 01:26:01 henning Exp $ */
/* WARNING! This file was generated by keywords.sh */
@@ -28,33 +28,31 @@ extern struct keytab {
#define K_INET 18
#define K_INET6 19
#define K_IPX 20
-#define K_ISO 21
-#define K_LINK 22
-#define K_LLINFO 23
-#define K_LOCK 24
-#define K_LOCKREST 25
-#define K_MASK 26
-#define K_MONITOR 27
-#define K_MPATH 28
-#define K_MTU 29
-#define K_NET 30
-#define K_NETMASK 31
-#define K_NOSTATIC 32
-#define K_OSI 33
-#define K_PREFIXLEN 34
-#define K_PROTO1 35
-#define K_PROTO2 36
-#define K_RECVPIPE 37
-#define K_REJECT 38
-#define K_RTT 39
-#define K_RTTVAR 40
-#define K_SA 41
-#define K_SENDPIPE 42
-#define K_SHOW 43
-#define K_SRC 44
-#define K_SRCMASK 45
-#define K_SSTHRESH 46
-#define K_STATIC 47
-#define K_X25 48
-#define K_XNS 49
-#define K_XRESOLVE 50
+#define K_LINK 21
+#define K_LLINFO 22
+#define K_LOCK 23
+#define K_LOCKREST 24
+#define K_MASK 25
+#define K_MONITOR 26
+#define K_MPATH 27
+#define K_MTU 28
+#define K_NET 29
+#define K_NETMASK 30
+#define K_NOSTATIC 31
+#define K_OSI 32
+#define K_PREFIXLEN 33
+#define K_PROTO1 34
+#define K_PROTO2 35
+#define K_RECVPIPE 36
+#define K_REJECT 37
+#define K_RTT 38
+#define K_RTTVAR 39
+#define K_SA 40
+#define K_SENDPIPE 41
+#define K_SHOW 42
+#define K_SRC 43
+#define K_SRCMASK 44
+#define K_SSTHRESH 45
+#define K_STATIC 46
+#define K_X25 47
+#define K_XRESOLVE 48
diff --git a/sbin/route/keywords.sh b/sbin/route/keywords.sh
index 820672532a9..4c8bc5989e9 100644
--- a/sbin/route/keywords.sh
+++ b/sbin/route/keywords.sh
@@ -1,5 +1,5 @@
#!/bin/sh
-# $OpenBSD: keywords.sh,v 1.7 2004/06/19 19:55:53 cedric Exp $
+# $OpenBSD: keywords.sh,v 1.8 2004/06/25 01:26:01 henning Exp $
# $NetBSD: keywords.sh,v 1.2 1996/11/15 18:57:21 gwr Exp $
# @(#)keywords 8.2 (Berkeley) 3/19/94
#
@@ -29,7 +29,6 @@ ifp
inet
inet6
ipx
-iso
link
llinfo
lock
@@ -57,7 +56,6 @@ srcmask
ssthresh
static
x25
-xns
xresolve
_EOF_
diff --git a/sbin/route/route.8 b/sbin/route/route.8
index 7b0096f56fc..a1bc04baa6b 100644
--- a/sbin/route/route.8
+++ b/sbin/route/route.8
@@ -1,4 +1,4 @@
-.\" $OpenBSD: route.8,v 1.34 2004/06/19 19:55:53 cedric Exp $
+.\" $OpenBSD: route.8,v 1.35 2004/06/25 01:26:01 henning Exp $
.\" $NetBSD: route.8,v 1.6 1995/03/18 15:00:13 cgd Exp $
.\"
.\" Copyright (c) 1983, 1991, 1993
@@ -123,8 +123,6 @@ will
.Dq flush
the routing tables of all gateway entries.
When the address family is specified by any of the
-.Fl osi ,
-.Fl xns ,
.Fl ipx ,
.Fl link ,
.Fl x25 ,
@@ -210,27 +208,15 @@ modifier should be specified;
the gateway given is the address of this host on the common network,
indicating the interface to be used for transmission.
.Pp
-The optional modifiers
-.Fl xns ,
-.Fl osi ,
-and
+The optional modifier
.Fl link
-specify that all subsequent addresses are in the
-.Tn XNS
-.Tn OSI
-address families,
-or are specified as link-level addresses,
+specify that all subsequent addresses are specified as link-level addresses,
and the names must be numeric specifications rather than
symbolic names.
.Pp
The optional
.Fl netmask
-qualifier is intended
-to achieve the effect of an
-.Tn OSI
-.Tn ESIS
-redirect with the netmask option,
-or to manually add subnet routes with
+qualifier is intended to manually add subnet routes with
netmasks different from that of the implied network interface
(as would otherwise be communicated using the OSPF or ISIS routing protocols).
One specifies an additional ensuing address parameter
@@ -323,10 +309,7 @@ In a
or
.Cm add
command where the destination and gateway are not sufficient to specify
-the route (as in the
-.Tn ISO
-case where several interfaces may have the
-same address), the
+the route, the
.Fl ifp
or
.Fl ifa
diff --git a/sbin/route/route.c b/sbin/route/route.c
index e548d1d6e56..06cb5762fd7 100644
--- a/sbin/route/route.c
+++ b/sbin/route/route.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: route.c,v 1.70 2004/06/19 19:55:53 cedric Exp $ */
+/* $OpenBSD: route.c,v 1.71 2004/06/25 01:26:01 henning Exp $ */
/* $NetBSD: route.c,v 1.16 1996/04/15 18:27:05 cgd Exp $ */
/*
@@ -40,7 +40,7 @@ static const char copyright[] =
#if 0
static const char sccsid[] = "@(#)route.c 8.3 (Berkeley) 3/19/94";
#else
-static const char rcsid[] = "$OpenBSD: route.c,v 1.70 2004/06/19 19:55:53 cedric Exp $";
+static const char rcsid[] = "$OpenBSD: route.c,v 1.71 2004/06/25 01:26:01 henning Exp $";
#endif
#endif /* not lint */
@@ -55,9 +55,7 @@ static const char rcsid[] = "$OpenBSD: route.c,v 1.70 2004/06/19 19:55:53 cedric
#include <net/if_types.h>
#include <net/route.h>
#include <netinet/in.h>
-#include <netns/ns.h>
#include <netipx/ipx.h>
-#include <netiso/iso.h>
#include <netccitt/x25.h>
#include <arpa/inet.h>
#include <netdb.h>
@@ -82,9 +80,7 @@ union sockunion {
#ifdef INET6
struct sockaddr_in6 sin6;
#endif
- struct sockaddr_ns sns;
struct sockaddr_ipx sipx;
- struct sockaddr_iso siso;
struct sockaddr_dl sdl;
struct sockaddr_x25 sx25;
struct sockaddr_rtin rtin;
@@ -256,19 +252,12 @@ flushroutes(int argc, char **argv)
af = AF_INET6;
break;
#endif
- case K_XNS:
- af = AF_NS;
- break;
case K_IPX:
af = AF_IPX;
break;
case K_LINK:
af = AF_LINK;
break;
- case K_ISO:
- case K_OSI:
- af = AF_ISO;
- break;
case K_X25:
af = AF_CCITT;
break;
@@ -391,11 +380,6 @@ newroute(int argc, char **argv)
af = AF_LINK;
aflen = sizeof(struct sockaddr_dl);
break;
- case K_OSI:
- case K_ISO:
- af = AF_ISO;
- aflen = sizeof(struct sockaddr_iso);
- break;
case K_INET:
af = AF_INET;
aflen = sizeof(struct sockaddr_in);
@@ -414,10 +398,6 @@ newroute(int argc, char **argv)
af = PF_ROUTE;
aflen = sizeof(union sockunion);
break;
- case K_XNS:
- af = AF_NS;
- aflen = sizeof(struct sockaddr_ns);
- break;
case K_IPX:
af = AF_IPX;
aflen = sizeof(struct sockaddr_ipx);
@@ -644,19 +624,12 @@ show(int argc, char *argv[])
af = AF_INET6;
break;
#endif
- case K_XNS:
- af = AF_NS;
- break;
case K_IPX:
af = AF_IPX;
break;
case K_LINK:
af = AF_LINK;
break;
- case K_ISO:
- case K_OSI:
- af = AF_ISO;
- break;
case K_X25:
af = AF_CCITT;
break;
@@ -854,19 +827,6 @@ getaddr(int which, char *s, struct hostent **hpp)
}
#endif
- case AF_NS:
- if (which == RTA_DST) {
- extern short ns_bh[3];
- struct sockaddr_ns *sms = &(so_mask.sns);
- memset(sms, 0, sizeof(*sms));
- sms->sns_family = 0;
- sms->sns_len = 6;
- sms->sns_addr.x_net = *(union ns_net *)ns_bh;
- rtm_addrs |= RTA_NETMASK;
- }
- su->sns.sns_addr = ns_addr(s);
- return (!ns_nullhost(su->sns.sns_addr));
-
case AF_IPX:
if (which == RTA_DST) {
extern short ipx_bh[3];
@@ -880,18 +840,6 @@ getaddr(int which, char *s, struct hostent **hpp)
su->sipx.sipx_addr = ipx_addr(s);
return (!ipx_nullhost(su->sipx.sipx_addr));
- case AF_OSI:
- su->siso.siso_addr = *iso_addr(s);
- if (which == RTA_NETMASK || which == RTA_GENMASK) {
- char *cp = (char *)TSEL(&su->siso);
- su->siso.siso_nlen = 0;
- do {
- --cp;
- } while ((cp > (char *)su) && (*cp == 0));
- su->siso.siso_len = 1 + cp - (char *)su;
- }
- return (1);
-
case AF_LINK:
link_addr(s, &su->sdl);
return (1);
@@ -1159,7 +1107,6 @@ mask_addr(union sockunion *addr, union sockunion *mask, int which)
if ((rtm_addrs & which) == 0)
return;
switch (addr->sa.sa_family) {
- case AF_NS:
case AF_IPX:
case AF_INET:
#ifdef INET6
@@ -1168,10 +1115,6 @@ mask_addr(union sockunion *addr, union sockunion *mask, int which)
case AF_CCITT:
case 0:
return;
- case AF_ISO:
- olen = MIN(addr->siso.siso_nlen,
- MAX(mask->sa.sa_len - 6, 0));
- break;
}
cp1 = mask->sa.sa_len + 1 + (char *)addr;
cp2 = addr->sa.sa_len + 1 + (char *)addr;
@@ -1180,11 +1123,6 @@ mask_addr(union sockunion *addr, union sockunion *mask, int which)
cp2 = mask->sa.sa_len + 1 + (char *)mask;
while (cp1 > addr->sa.sa_data)
*--cp1 &= *--cp2;
- switch (addr->sa.sa_family) {
- case AF_ISO:
- addr->siso.siso_nlen = olen;
- break;
- }
}
char *msgtypes[] = {
@@ -1474,10 +1412,6 @@ sodump(sup su, char *which)
(void) printf("%s: link %s; ",
which, link_ntoa(&su->sdl));
break;
- case AF_ISO:
- (void) printf("%s: iso %s; ",
- which, iso_ntoa(&su->siso.siso_addr));
- break;
case AF_INET:
(void) printf("%s: inet %s; ",
which, inet_ntoa(su->sin.sin_addr));
@@ -1489,10 +1423,6 @@ sodump(sup su, char *which)
ntop_buf, sizeof(ntop_buf)));
break;
#endif
- case AF_NS:
- (void) printf("%s: xns %s; ",
- which, ns_ntoa(su->sns.sns_addr));
- break;
case AF_IPX:
(void) printf("%s: ipx %s; ",
which, ipx_ntoa(su->sipx.sipx_addr));
diff --git a/sbin/route/show.c b/sbin/route/show.c
index 52ec8898c5a..6758fc9efe6 100644
--- a/sbin/route/show.c
+++ b/sbin/route/show.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: show.c,v 1.31 2004/06/16 11:47:35 cedric Exp $ */
+/* $OpenBSD: show.c,v 1.32 2004/06/25 01:26:01 henning Exp $ */
/* $NetBSD: show.c,v 1.1 1996/11/15 18:01:41 gwr Exp $ */
/*
@@ -34,7 +34,7 @@
#if 0
static char sccsid[] = "from: @(#)route.c 8.3 (Berkeley) 3/9/94";
#else
-static const char rcsid[] = "$OpenBSD: show.c,v 1.31 2004/06/16 11:47:35 cedric Exp $";
+static const char rcsid[] = "$OpenBSD: show.c,v 1.32 2004/06/25 01:26:01 henning Exp $";
#endif
#endif /* not lint */
@@ -48,9 +48,7 @@ static const char rcsid[] = "$OpenBSD: show.c,v 1.31 2004/06/16 11:47:35 cedric
#include <net/if_types.h>
#include <net/route.h>
#include <netinet/in.h>
-#include <netns/ns.h>
#include <netipx/ipx.h>
-#include <netiso/iso.h>
#include <netinet/if_ether.h>
#include <netinet/ip_ipsp.h>
#include <arpa/inet.h>
@@ -291,9 +289,6 @@ pr_family(af)
case AF_IPX:
afname = "IPX";
break;
- case AF_ISO:
- afname = "ISO";
- break;
case AF_CCITT:
afname = "X.25";
break;
@@ -436,20 +431,12 @@ routename(struct sockaddr *sa)
}
#endif
- case AF_NS:
- return (ns_print(sa));
-
case AF_IPX:
return (ipx_print(sa));
case AF_LINK:
return (link_print(sa));
- case AF_ISO:
- (void) snprintf(line, sizeof line, "iso %s",
- iso_ntoa(&((struct sockaddr_iso *)sa)->siso_addr));
- break;
-
default:
(void) snprintf(line, sizeof line, "(%d) %s",
sa->sa_family, any_ntoa(sa));
@@ -662,20 +649,12 @@ netname(struct sockaddr *sa, struct sockaddr *mask)
(struct sockaddr_in6 *)mask);
#endif
- case AF_NS:
- return (ns_print(sa));
-
case AF_IPX:
return (ipx_print(sa));
case AF_LINK:
return (link_print(sa));
- case AF_ISO:
- (void) snprintf(line, sizeof line, "iso %s",
- iso_ntoa(&((struct sockaddr_iso *)sa)->siso_addr));
- break;
-
default:
snprintf(line, sizeof line, "af %d: %s",
sa->sa_family, any_ntoa(sa));
@@ -704,52 +683,6 @@ any_ntoa(const struct sockaddr *sa)
return (obuf);
}
-short ns_nullh[] = {0,0,0};
-short ns_bh[] = {-1,-1,-1};
-
-char *
-ns_print(struct sockaddr *sa)
-{
- struct sockaddr_ns *sns = (struct sockaddr_ns *)sa;
- struct ns_addr work;
- union { union ns_net net_e; u_int32_t long_e; } net;
- u_short port;
- static char mybuf[50+MAXHOSTNAMELEN];
- char cport[10], chost[25];
- char *host = "";
- u_char *q;
-
- work = sns->sns_addr;
- port = ntohs(work.x_port);
- work.x_port = 0;
- net.net_e = work.x_net;
- if (ns_nullhost(work) && net.long_e == 0) {
- if (!port)
- return ("*.*");
- (void) snprintf(mybuf, sizeof mybuf, "*.0x%x", port);
- return (mybuf);
- }
-
- if (memcmp(ns_bh, work.x_host.c_host, 6) == 0)
- host = "any";
- else if (memcmp(ns_nullh, work.x_host.c_host, 6) == 0)
- host = "*";
- else {
- q = work.x_host.c_host;
- (void) snprintf(chost, sizeof chost, "0x%02x%02x%02x%02x%02x%02x",
- q[0], q[1], q[2], q[3], q[4], q[5]);
- host = chost;
- }
- if (port)
- (void) snprintf(cport, sizeof cport, ".0x%x", htons(port));
- else
- *cport = '\0';
-
- (void) snprintf(mybuf, sizeof mybuf, "0x%x.%s%s",
- ntohl(net.long_e), host, cport);
- return (mybuf);
-}
-
short ipx_nullh[] = {0,0,0};
short ipx_bh[] = {-1,-1,-1};