summaryrefslogtreecommitdiff
path: root/sbin/route
diff options
context:
space:
mode:
authorAngelos D. Keromytis <angelos@cvs.openbsd.org>2000-07-27 20:12:26 +0000
committerAngelos D. Keromytis <angelos@cvs.openbsd.org>2000-07-27 20:12:26 +0000
commit91954e0152fc1180ecfb88df989151b3b1a68d73 (patch)
treec70ad03185dc914a535f7cdd52c26a8d9c9dbe79 /sbin/route
parent39e6a2f99dc20d9cc83bf3201b5d742daaace4b7 (diff)
Don't show or delete IPsec flows with the route command -- this was a
kludge to begin with, and it's about time we get rid of it.
Diffstat (limited to 'sbin/route')
-rw-r--r--sbin/route/keywords.c3
-rw-r--r--sbin/route/keywords.h85
-rw-r--r--sbin/route/keywords.sh3
-rw-r--r--sbin/route/route.89
-rw-r--r--sbin/route/route.c14
-rw-r--r--sbin/route/show.c100
6 files changed, 51 insertions, 163 deletions
diff --git a/sbin/route/keywords.c b/sbin/route/keywords.c
index d132e5295ba..ba38d6ab288 100644
--- a/sbin/route/keywords.c
+++ b/sbin/route/keywords.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: keywords.c,v 1.5 1999/12/08 07:55:54 itojun Exp $ */
+/* $OpenBSD: keywords.c,v 1.6 2000/07/27 20:12:24 angelos Exp $ */
/* WARNING! This file was generated by keywords.sh */
@@ -12,7 +12,6 @@ struct keytab keywords[] = {
{"cloning", K_CLONING},
{"delete", K_DELETE},
{"dst", K_DST},
- {"encap", K_ENCAP},
{"expire", K_EXPIRE},
{"flush", K_FLUSH},
{"gateway", K_GATEWAY},
diff --git a/sbin/route/keywords.h b/sbin/route/keywords.h
index 95263dd00c5..81c547bf986 100644
--- a/sbin/route/keywords.h
+++ b/sbin/route/keywords.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: keywords.h,v 1.5 1999/12/08 07:55:54 itojun Exp $ */
+/* $OpenBSD: keywords.h,v 1.6 2000/07/27 20:12:25 angelos Exp $ */
/* WARNING! This file was generated by keywords.sh */
@@ -14,45 +14,44 @@ extern struct keytab {
#define K_CLONING 4
#define K_DELETE 5
#define K_DST 6
-#define K_ENCAP 7
-#define K_EXPIRE 8
-#define K_FLUSH 9
-#define K_GATEWAY 10
-#define K_GENMASK 11
-#define K_GET 12
-#define K_HOST 13
-#define K_HOPCOUNT 14
-#define K_IFACE 15
-#define K_INTERFACE 16
-#define K_IFA 17
-#define K_IFP 18
-#define K_INET 19
-#define K_INET6 20
-#define K_IPX 21
-#define K_ISO 22
-#define K_LINK 23
-#define K_LLINFO 24
-#define K_LOCK 25
-#define K_LOCKREST 26
-#define K_MASK 27
-#define K_MONITOR 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_SSTHRESH 44
-#define K_STATIC 45
-#define K_X25 46
-#define K_XNS 47
-#define K_XRESOLVE 48
+#define K_EXPIRE 7
+#define K_FLUSH 8
+#define K_GATEWAY 9
+#define K_GENMASK 10
+#define K_GET 11
+#define K_HOST 12
+#define K_HOPCOUNT 13
+#define K_IFACE 14
+#define K_INTERFACE 15
+#define K_IFA 16
+#define K_IFP 17
+#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_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_SSTHRESH 43
+#define K_STATIC 44
+#define K_X25 45
+#define K_XNS 46
+#define K_XRESOLVE 47
diff --git a/sbin/route/keywords.sh b/sbin/route/keywords.sh
index c77269d3721..c97c481abee 100644
--- a/sbin/route/keywords.sh
+++ b/sbin/route/keywords.sh
@@ -1,5 +1,5 @@
#!/bin/sh
-# $OpenBSD: keywords.sh,v 1.4 1999/12/08 07:55:54 itojun Exp $
+# $OpenBSD: keywords.sh,v 1.5 2000/07/27 20:12:25 angelos Exp $
# $NetBSD: keywords.sh,v 1.2 1996/11/15 18:57:21 gwr Exp $
# @(#)keywords 8.2 (Berkeley) 3/19/94
#
@@ -15,7 +15,6 @@ change
cloning
delete
dst
-encap
expire
flush
gateway
diff --git a/sbin/route/route.8 b/sbin/route/route.8
index 550e67483d7..4e831b1403b 100644
--- a/sbin/route/route.8
+++ b/sbin/route/route.8
@@ -1,4 +1,4 @@
-.\" $OpenBSD: route.8,v 1.24 2000/04/15 11:45:58 aaron Exp $
+.\" $OpenBSD: route.8,v 1.25 2000/07/27 20:12:25 angelos Exp $
.\" $NetBSD: route.8,v 1.6 1995/03/18 15:00:13 cgd Exp $
.\"
.\" Copyright (c) 1983, 1991, 1993
@@ -123,16 +123,12 @@ command is specified,
.Nm
will
.Dq flush
-the routing tables of all gateway entries expect
-the
-.Dq encap
-family entries (IPsec routing flows).
+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 encap ,
.Fl x25 ,
.Fl inet ,
or
@@ -341,7 +337,6 @@ to create the new entry.
.El
.Sh SEE ALSO
.Xr esis 4 ,
-.Xr ipsecadm 1 ,
.Xr netintro 4 ,
.Xr route 4 ,
.Xr routed 8
diff --git a/sbin/route/route.c b/sbin/route/route.c
index 134babcaa13..826e2bbadeb 100644
--- a/sbin/route/route.c
+++ b/sbin/route/route.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: route.c,v 1.37 2000/04/20 12:26:35 itojun Exp $ */
+/* $OpenBSD: route.c,v 1.38 2000/07/27 20:12:25 angelos Exp $ */
/* $NetBSD: route.c,v 1.16 1996/04/15 18:27:05 cgd Exp $ */
/*
@@ -44,7 +44,7 @@ static char copyright[] =
#if 0
static char sccsid[] = "@(#)route.c 8.3 (Berkeley) 3/19/94";
#else
-static char rcsid[] = "$OpenBSD: route.c,v 1.37 2000/04/20 12:26:35 itojun Exp $";
+static char rcsid[] = "$OpenBSD: route.c,v 1.38 2000/07/27 20:12:25 angelos Exp $";
#endif
#endif /* not lint */
@@ -268,9 +268,6 @@ flushroutes(argc, argv)
case K_OSI:
af = AF_ISO;
break;
- case K_ENCAP:
- af = AF_KEY;
- break;
case K_X25:
af = AF_CCITT;
break;
@@ -313,13 +310,6 @@ bad: usage(*argv);
if (af) {
if (sa->sa_family != af)
continue;
- } else {
- /*
- * A general 'flush' should not touch PF_KEY flows,
- * as the flows' SPIs would be left behind.
- */
- if (sa->sa_family == AF_KEY)
- continue;
}
if (debugonly)
continue;
diff --git a/sbin/route/show.c b/sbin/route/show.c
index 0bdfc2fdfc2..15b2e4548d2 100644
--- a/sbin/route/show.c
+++ b/sbin/route/show.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: show.c,v 1.16 2000/01/14 19:59:17 deraadt Exp $ */
+/* $OpenBSD: show.c,v 1.17 2000/07/27 20:12:25 angelos Exp $ */
/* $NetBSD: show.c,v 1.1 1996/11/15 18:01:41 gwr Exp $ */
/*
@@ -38,7 +38,7 @@
#if 0
static char sccsid[] = "from: @(#)route.c 8.3 (Berkeley) 3/9/94";
#else
-static char *rcsid = "$OpenBSD: show.c,v 1.16 2000/01/14 19:59:17 deraadt Exp $";
+static char *rcsid = "$OpenBSD: show.c,v 1.17 2000/07/27 20:12:25 angelos Exp $";
#endif
#endif /* not lint */
@@ -104,9 +104,7 @@ static void p_rtentry __P((struct rt_msghdr *));
static void p_sockaddr __P((struct sockaddr *, int, int));
static void p_flags __P((int, char *));
static void pr_rthdr __P((void));
-static void pr_encaphdr __P((void));
static void pr_family __P((int));
-static void encap_print __P((struct rt_msghdr *));
/*
* Print routing tables.
@@ -201,14 +199,7 @@ p_rtentry(rtm)
if (old_af != af) {
old_af = af;
pr_family(af);
- if (af != PF_KEY)
- pr_rthdr();
- else
- pr_encaphdr();
- }
- if (af == PF_KEY) {
- encap_print(rtm);
- return;
+ pr_rthdr();
}
if (rtm->rtm_addrs == RTA_DST)
p_sockaddr(sa, 0, 36);
@@ -221,19 +212,6 @@ p_rtentry(rtm)
putchar('\n');
}
-/*
- * Print header for PF_KEY entries.
- */
-void
-pr_encaphdr()
-{
-/*
- printf("%-40s %-15s %s\n",
- "Source/Destination Networks", "Protocol/Ports",
- "SA(Address/SPI/Proto)");
-*/
-}
-
/*
* Print address family header before a section of the routing table.
*/
@@ -264,9 +242,6 @@ pr_family(af)
case AF_CCITT:
afname = "X.25";
break;
- case PF_KEY:
- afname = "IPsec";
- break;
case AF_APPLETALK:
afname = "AppleTalk";
break;
@@ -389,72 +364,3 @@ p_flags(f, format)
*flags = '\0';
printf(format, name);
}
-
-static void
-encap_print(rtm)
- register struct rt_msghdr *rtm;
-{
- struct sockaddr_encap *sen1 = (struct sockaddr_encap *)(rtm + 1);
- struct protoent *prnt = NULL;
- struct sockaddr_encap *sen3;
- struct sockaddr_encap *sen2;
-
- u_char buffer[40];
-
- bzero(buffer, sizeof(buffer));
-
- sen3 = (struct sockaddr_encap *) (ROUNDUP(sen1->sen_len) +
- (char *)sen1);
- sen2 = (struct sockaddr_encap *) (ROUNDUP(sen3->sen_len) +
- (char *)sen3);
-
- if (sen1->sen_type == SENT_IP4) {
- inet_ntop(AF_INET, &sen1->sen_ip_src, buffer, sizeof(buffer));
- printf("%s/", buffer);
- inet_ntop(AF_INET, &sen2->sen_ip_src, buffer, sizeof(buffer));
- printf("%s:%u -> ", buffer, ntohs(sen1->sen_sport));
- inet_ntop(AF_INET, &sen1->sen_ip_dst, buffer, sizeof(buffer));
- printf("%s/", buffer);
- inet_ntop(AF_INET, &sen2->sen_ip_dst, buffer, sizeof(buffer));
- printf("%s:%u ", buffer, ntohs(sen1->sen_dport));
-
- if (sen1->sen_proto) {
- prnt = getprotobynumber(sen1->sen_proto);
- if (prnt)
- printf("(%s) ", prnt->p_name);
- else
- printf("(%u) ", sen1->sen_proto);
- }
- else
- printf("(all) ");
- }
-
-#ifdef INET6
- if (sen1->sen_type == SENT_IP6) {
- inet_ntop(AF_INET6, &sen1->sen_ip6_src, buffer, sizeof(buffer));
- printf("%s:%d ->", buffer, ntohs(sen1->sen_ip6_sport));
- inet_ntop(AF_INET6, &sen1->sen_ip6_dst, buffer, sizeof(buffer));
- printf("%s:%d ", buffer, ntohs(sen1->sen_ip6_dport));
-
- if (sen1->sen_ip6_proto) {
- prnt = getprotobynumber(sen1->sen_ip6_proto);
- if (prnt)
- printf("(%s) ", prnt->p_name);
- else
- printf("(%u) ", sen1->sen_ip6_proto);
- }
- else
- printf("(all) ");
- }
-
- if (sen3->sen_type == SENT_IPSP6)
- printf("%s/%08x/%-lu\n",
- inet_ntop(AF_INET6, &sen3->sen_ipsp6_dst, buffer,
- sizeof(buffer)),
- ntohl(sen3->sen_ipsp6_spi), sen3->sen_ipsp6_sproto);
-#endif /* INET6 */
-
- if (sen3->sen_type == SENT_IPSP)
- printf("%s/%08x/%-lu\n", inet_ntoa(sen3->sen_ipsp_dst),
- ntohl(sen3->sen_ipsp_spi), sen3->sen_ipsp_sproto);
-}