From 2c35f5c582dd732d6a6a5463286785e4f2113e35 Mon Sep 17 00:00:00 2001 From: mycroft Date: Sun, 25 Apr 1993 07:26:40 +0000 Subject: [PATCH] Compile X.25, OSI, and NS code. --- sbin/route/Makefile | 4 ++-- sbin/route/route.c | 44 +------------------------------------------- 2 files changed, 3 insertions(+), 45 deletions(-) diff --git a/sbin/route/Makefile b/sbin/route/Makefile index b6245204d808..fea0512e1e1c 100644 --- a/sbin/route/Makefile +++ b/sbin/route/Makefile @@ -1,11 +1,11 @@ # @(#)Makefile 5.6 (Berkeley) 6/27/91 # -# $Header: /cvsroot/src/sbin/route/Makefile,v 1.3 1993/03/23 00:29:59 cgd Exp $ +# $Header: /cvsroot/src/sbin/route/Makefile,v 1.4 1993/04/25 07:26:58 mycroft Exp $ PROG= route MAN8= route.0 SRCS= route.c -#SRCS= route.c ccitt_addr.c +SRCS= route.c ccitt_addr.c CFLAGS+=-I. #CLEANFILES+=keywords.h BINOWN= root diff --git a/sbin/route/route.c b/sbin/route/route.c index 88bfa572cad4..fd1d28c78feb 100644 --- a/sbin/route/route.c +++ b/sbin/route/route.c @@ -39,7 +39,7 @@ char copyright[] = #ifndef lint static char sccsid[] = "@(#)route.c 5.35 (Berkeley) 6/27/91"; -static char rcsid[] = "$Header: /cvsroot/src/sbin/route/route.c,v 1.4 1993/04/18 19:02:31 mycroft Exp $"; +static char rcsid[] = "$Header: /cvsroot/src/sbin/route/route.c,v 1.5 1993/04/25 07:26:40 mycroft Exp $"; #endif /* not lint */ #include @@ -52,11 +52,9 @@ static char rcsid[] = "$Header: /cvsroot/src/sbin/route/route.c,v 1.4 1993/04/18 #include #include #include -#ifdef notyet #include #include #include -#endif #include #include @@ -80,14 +78,10 @@ struct ortentry route; union sockunion { struct sockaddr sa; struct sockaddr_in sin; -#ifdef notdef struct sockaddr_ns sns; struct sockaddr_iso siso; -#endif struct sockaddr_dl sdl; -#ifdef notdef struct sockaddr_x25 sx25; -#endif } so_dst, so_gate, so_mask, so_genmask, so_ifa, so_ifp; union sockunion *so_addrs[] = @@ -108,9 +102,7 @@ void flushroutes(), newroute(), monitor(), sockaddr(); void print_getmsg(), print_rtmsg(), pmsg_common(), sodump(), bprintf(); int getaddr(), rtmsg(); extern char *inet_ntoa(), -#ifdef notdef *iso_ntoa(), -#endif *link_ntoa(); void @@ -351,21 +343,17 @@ routename(sa) break; } -#ifdef notdef case AF_NS: return (ns_print((struct sockaddr_ns *)sa)); -#endif case AF_LINK: return (link_ntoa((struct sockaddr_dl *)sa)); -#ifdef notdef case AF_ISO: (void) sprintf(line, "iso %s", iso_ntoa(&((struct sockaddr_iso *)sa)->siso_addr)); break; -#endif default: { u_short *s = (u_short *)sa->sa_data; u_short *slim = s + ((sa->sa_len + 1) >> 1); @@ -447,21 +435,17 @@ netname(sa) break; } -#ifdef notdef case AF_NS: return (ns_print((struct sockaddr_ns *)sa)); break; -#endif case AF_LINK: return (link_ntoa((struct sockaddr_dl *)sa)); -#ifdef notdef case AF_ISO: (void) sprintf(line, "iso %s", iso_ntoa(&((struct sockaddr_iso *)sa)->siso_addr)); break; -#endif default: { u_short *s = (u_short *)sa->sa_data; @@ -525,33 +509,27 @@ newroute(argc, argv) af = AF_LINK; aflen = sizeof(struct sockaddr_dl); break; -#ifdef notdef case K_OSI: case K_ISO: af = AF_ISO; aflen = sizeof(struct sockaddr_iso); break; -#endif case K_INET: af = AF_INET; aflen = sizeof(struct sockaddr_in); break; -#ifdef notdef case K_X25: af = AF_CCITT; aflen = sizeof(struct sockaddr_x25); break; -#endif case K_SA: af = 0; aflen = sizeof(union sockunion); break; -#ifdef notdef case K_XNS: af = AF_NS; aflen = sizeof(struct sockaddr_ns); break; -#endif case K_IFACE: case K_INTERFACE: iflag++; @@ -759,10 +737,8 @@ getaddr(which, s, hpp) struct hostent **hpp; { register sup su; -#ifdef notdef struct ns_addr ns_addr(); struct iso_addr *iso_addr(); -#endif struct hostent *hp; struct netent *np; u_long val; @@ -794,18 +770,14 @@ getaddr(which, s, hpp) } return 0; } -#ifdef notdef if (af == AF_NS) goto do_xns; if (af == AF_OSI) goto do_osi; -#endif if (af == AF_LINK) goto do_link; -#ifdef notdef if (af == AF_CCITT) goto do_ccitt; -#endif if (af == 0) goto do_sa; if (hpp == NULL) @@ -841,7 +813,6 @@ getaddr(which, s, hpp) } (void) fprintf(stderr, "%s: bad value\n", s); exit(1); -#ifdef notdef do_xns: if (which == RTA_DST) { extern short ns_bh[3]; @@ -866,7 +837,6 @@ do_osi: do_ccitt: ccitt_addr(s, &su->sx25); return (1); -#endif do_link: link_addr(s, &su->sdl); return (1); @@ -876,7 +846,6 @@ do_sa: return (1); } -#ifdef notdef short ns_nullh[] = {0,0,0}; short ns_bh[] = {-1,-1,-1}; @@ -923,7 +892,6 @@ ns_print(sns) (void) sprintf(mybuf,"%XH.%s%s", ntohl(net.long_e), host, cport); return (mybuf); } -#endif void monitor() @@ -1017,15 +985,11 @@ mask_addr() { if ((rtm_addrs & RTA_DST) == 0) return; switch(so_dst.sa.sa_family) { -#ifdef notdef case AF_NS: -#endif case AF_INET: case 0: return; -#ifdef notdef case AF_ISO: olen = MIN(so_dst.siso.siso_nlen, so_mask.sa.sa_len - 6); -#endif } cp1 = so_mask.sa.sa_len + 1 + (char *)&so_dst; cp2 = so_dst.sa.sa_len + 1 + (char *)&so_dst; @@ -1034,12 +998,10 @@ mask_addr() { cp2 = so_mask.sa.sa_len + 1 + (char *)&so_mask; while (cp1 > so_dst.sa.sa_data) *--cp1 &= *--cp2; -#ifdef notdef switch(so_dst.sa.sa_family) { case AF_ISO: so_dst.siso.siso_nlen = olen; } -#endif } char *msgtypes[] = { @@ -1191,22 +1153,18 @@ sodump(su, which) (void) printf("%s: link %s; ", which, link_ntoa(&su->sdl)); break; -#ifdef notdef case AF_ISO: (void) printf("%s: iso %s; ", which, iso_ntoa(&su->siso.siso_addr)); break; -#endif case AF_INET: (void) printf("%s: inet %s; ", which, inet_ntoa(su->sin.sin_addr)); break; -#ifdef notdef case AF_NS: (void) printf("%s: xns %s; ", which, ns_ntoa(su->sns.sns_addr)); break; -#endif } (void) fflush(stdout); }