summaryrefslogtreecommitdiff
path: root/sbin/route/show.c
diff options
context:
space:
mode:
Diffstat (limited to 'sbin/route/show.c')
-rw-r--r--sbin/route/show.c100
1 files changed, 3 insertions, 97 deletions
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);
-}