diff options
author | Henning Brauer <henning@cvs.openbsd.org> | 2005-03-30 05:20:19 +0000 |
---|---|---|
committer | Henning Brauer <henning@cvs.openbsd.org> | 2005-03-30 05:20:19 +0000 |
commit | d845484947aba5985ff260271ec97d18a3810242 (patch) | |
tree | 309ae4907765e724eebdcecc8c7774f95142dada | |
parent | b9b9ecf20d6bed2faf9a781b8aa36c9a90ce16a5 (diff) |
remove ccitt x.25 traces, ok theo
-rw-r--r-- | sbin/route/Makefile | 4 | ||||
-rw-r--r-- | sbin/route/ccitt_addr.c | 177 | ||||
-rw-r--r-- | sbin/route/keywords.c | 3 | ||||
-rw-r--r-- | sbin/route/keywords.h | 5 | ||||
-rw-r--r-- | sbin/route/keywords.sh | 3 | ||||
-rw-r--r-- | sbin/route/route.8 | 4 | ||||
-rw-r--r-- | sbin/route/route.c | 38 |
7 files changed, 9 insertions, 225 deletions
diff --git a/sbin/route/Makefile b/sbin/route/Makefile index ed8c3caa26e..a7d6db455f8 100644 --- a/sbin/route/Makefile +++ b/sbin/route/Makefile @@ -1,8 +1,8 @@ -# $OpenBSD: Makefile,v 1.6 1999/12/08 07:55:54 itojun Exp $ +# $OpenBSD: Makefile,v 1.7 2005/03/30 05:20:18 henning Exp $ PROG= route MAN= route.8 -SRCS= route.c show.c keywords.c ccitt_addr.c +SRCS= route.c show.c keywords.c BINOWN= root BINMODE=555 diff --git a/sbin/route/ccitt_addr.c b/sbin/route/ccitt_addr.c deleted file mode 100644 index a55b8470df7..00000000000 --- a/sbin/route/ccitt_addr.c +++ /dev/null @@ -1,177 +0,0 @@ -/* $OpenBSD: ccitt_addr.c,v 1.9 2005/02/18 04:00:21 jaredy Exp $ */ -/* $NetBSD: ccitt_addr.c,v 1.8 1995/04/23 10:33:41 cgd Exp $ */ - -/* - * Copyright (c) 1990, 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. - * 3. 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. - * - * @(#)ccitt_addr.c 8.1 (Berkeley) 6/5/93 - */ - -/* - * parse CCITT addresses - * - * Addresses must have the format: [hpr],x121address[,userdata][,protocol] - * items enclosed with square brackets are optional - * 'h' or 'p' means hi priority (packet size = 128; specific to Datapac - * and necessary only for X.25(76) and non-negotiating X.25(80) DTE's) - * 'r' means reverse charge (remote DTE pays for call). - * The x121address consists of an optional netid and dot, followed - * by a dte address. - * - * Frank Pronk - * The University of British Columbia - * Laboratory for Computational Vision - * Copyright (c) 1984 - */ - -#include <sys/types.h> -#include <sys/socket.h> - -#include <netccitt/x25.h> - -#include <stdlib.h> -#include <string.h> - -static char *copychar(char *, char *); - -int -ccitt_addr(char *addr, struct sockaddr_x25 *xp) -{ - char *p, *ap, *limit; - int havenet = 0; - - memset(xp, 0, sizeof(*xp)); - xp->x25_family = AF_CCITT; - xp->x25_len = sizeof(*xp); - p = addr; - - /* - * process optional priority and reverse charging flags - */ - - if (*p == 'p' || *p == 'r' || *p == 'h') { - while (*p == 'p' || *p == 'r' || *p == 'h') { - if (*p == 'p' || *p == 'h') - xp->x25_opts.op_psize = X25_PS128; - else if (*p == 'r') - xp->x25_opts.op_flags |= X25_REVERSE_CHARGE; - p++; - } - if (*p != ',') - return (0); - p++; - } - if (*p == '\0') - return (0); - - /* - * [network id:]X.121 address - */ - - ap = xp->x25_addr; - limit = ap + sizeof(xp->x25_addr) - 1; - while (*p) { - if (*p == ',') - break; - if (*p == '.' || *p == ':') { - if (havenet) - return (0); - havenet++; - xp->x25_net = atoi(xp->x25_addr); - p++; - ap = xp->x25_addr; - *ap = '\0'; - } - if (*p < '0' || *p > '9') - return (0); - if (ap >= limit) - return (0); - *ap++ = *p++; - } - if (*p == '\0') - return (1); - - /* - * optional user data, bytes 4 to 16 - */ - - p++; - ap = xp->x25_udata + 4; /* first four bytes are protocol id */ - limit = ap + sizeof(xp->x25_udata) - 4; - xp->x25_udlen = 4; - while (*p) { - if (*p == ',') - break; - if (ap >= limit) - return (0); - p = copychar(p, ap++); - xp->x25_udlen++; - } - if (xp->x25_udlen == 4) - xp->x25_udlen = 0; - if (*p == '\0') - return (1); - - p++; - ap = xp->x25_udata; /* protocol id */ - limit = ap + (xp->x25_udlen ? 4 : sizeof(xp->x25_udata)); - while (*p) { - if (*p == ',') - return (0); - if (ap >= limit) - return (0); - p = copychar(p, ap++); - } - if (xp->x25_udlen == 0) - xp->x25_udlen = ap - xp->x25_udata; - return (1); -} - -static char * -copychar(char *from, char *to) -{ - int n; - - if (*from != '\\' || from[1] < '0' || from[1] > '7') { - *to = *from++; - return (from); - } - n = *++from - '0'; - from++; - if (*from >= '0' && *from <= '7') { - int n1; - - n = n*8 + *from++ - '0'; - if (*from >= '0' && *from <= '7' && (n1 = n*8 + *from-'0') < 256) { - n = n1; - from++; - } - } - *to = n; - return (from); -} diff --git a/sbin/route/keywords.c b/sbin/route/keywords.c index 8a0d7d98a76..9de4c12c617 100644 --- a/sbin/route/keywords.c +++ b/sbin/route/keywords.c @@ -1,4 +1,4 @@ -/* $OpenBSD: keywords.c,v 1.12 2004/09/24 01:13:04 jaredy Exp $ */ +/* $OpenBSD: keywords.c,v 1.13 2005/03/30 05:20:18 henning Exp $ */ /* WARNING! This file was generated by keywords.sh */ @@ -49,7 +49,6 @@ struct keytab keywords[] = { {"show", K_SHOW}, {"ssthresh", K_SSTHRESH}, {"static", K_STATIC}, - {"x25", K_X25}, {"xresolve", K_XRESOLVE}, {0, 0} }; diff --git a/sbin/route/keywords.h b/sbin/route/keywords.h index f08bf09524f..4e91c159ce2 100644 --- a/sbin/route/keywords.h +++ b/sbin/route/keywords.h @@ -1,4 +1,4 @@ -/* $OpenBSD: keywords.h,v 1.12 2004/09/24 01:13:04 jaredy Exp $ */ +/* $OpenBSD: keywords.h,v 1.13 2005/03/30 05:20:18 henning Exp $ */ /* WARNING! This file was generated by keywords.sh */ @@ -51,5 +51,4 @@ extern struct keytab { #define K_SHOW 41 #define K_SSTHRESH 42 #define K_STATIC 43 -#define K_X25 44 -#define K_XRESOLVE 45 +#define K_XRESOLVE 44 diff --git a/sbin/route/keywords.sh b/sbin/route/keywords.sh index 01308f80ef3..89bed053181 100644 --- a/sbin/route/keywords.sh +++ b/sbin/route/keywords.sh @@ -1,5 +1,5 @@ #!/bin/sh -# $OpenBSD: keywords.sh,v 1.11 2004/09/24 01:13:04 jaredy Exp $ +# $OpenBSD: keywords.sh,v 1.12 2005/03/30 05:20:18 henning Exp $ # $NetBSD: keywords.sh,v 1.2 1996/11/15 18:57:21 gwr Exp $ # @(#)keywords 8.2 (Berkeley) 3/19/94 # @@ -52,7 +52,6 @@ sendpipe show ssthresh static -x25 xresolve _EOF_ diff --git a/sbin/route/route.8 b/sbin/route/route.8 index 245437c4805..90a0f651e6b 100644 --- a/sbin/route/route.8 +++ b/sbin/route/route.8 @@ -1,4 +1,4 @@ -.\" $OpenBSD: route.8,v 1.41 2004/08/10 20:02:04 jaredy Exp $ +.\" $OpenBSD: route.8,v 1.42 2005/03/30 05:20:18 henning Exp $ .\" $NetBSD: route.8,v 1.6 1995/03/18 15:00:13 cgd Exp $ .\" .\" Copyright (c) 1983, 1991, 1993 @@ -267,8 +267,6 @@ Hardware (link-level) addresses Actual .Vt sockaddr data, in hexadecimal format -.It Fl x25 -CCITT X.25 addresses .El .Pp The optional modifier diff --git a/sbin/route/route.c b/sbin/route/route.c index 6b1b9cf2d48..2b481e4a243 100644 --- a/sbin/route/route.c +++ b/sbin/route/route.c @@ -1,4 +1,4 @@ -/* $OpenBSD: route.c,v 1.83 2005/02/18 04:00:21 jaredy Exp $ */ +/* $OpenBSD: route.c,v 1.84 2005/03/30 05:20:18 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.83 2005/02/18 04:00:21 jaredy Exp $"; +static const char rcsid[] = "$OpenBSD: route.c,v 1.84 2005/03/30 05:20:18 henning Exp $"; #endif #endif /* not lint */ @@ -56,7 +56,6 @@ static const char rcsid[] = "$OpenBSD: route.c,v 1.83 2005/02/18 04:00:21 jaredy #include <net/route.h> #include <netinet/in.h> #include <netipx/ipx.h> -#include <netccitt/x25.h> #include <arpa/inet.h> #include <netdb.h> @@ -82,7 +81,6 @@ union sockunion { #endif struct sockaddr_ipx sipx; struct sockaddr_dl sdl; - struct sockaddr_x25 sx25; struct sockaddr_rtin rtin; struct sockaddr_rtlabel rtlabel; } so_dst, so_gate, so_mask, so_genmask, so_ifa, so_ifp, so_label; @@ -116,13 +114,11 @@ static int inet6_makenetandmask(struct sockaddr_in6 *); #endif int getaddr(int, char *, struct hostent **); int rtmsg(int, int); -int x25_makemask(void); __dead void usage(char *); void set_metric(char *, int); void inet_makenetandmask(u_int32_t, struct sockaddr_in *, int); void interfaces(void); void getlabel(char *); -int ccitt_addr(char *, struct sockaddr_x25 *); __dead void usage(char *cp) @@ -246,9 +242,6 @@ flushroutes(int argc, char **argv) case K_LINK: af = AF_LINK; break; - case K_X25: - af = AF_CCITT; - break; default: usage(*argv); /* NOTREACHED */ @@ -397,10 +390,6 @@ newroute(int argc, char **argv) aflen = sizeof(struct sockaddr_in6); break; #endif - case K_X25: - af = AF_CCITT; - aflen = sizeof(struct sockaddr_x25); - break; case K_SA: af = PF_ROUTE; aflen = sizeof(union sockunion); @@ -624,9 +613,6 @@ show(int argc, char *argv[]) case K_LINK: af = AF_LINK; break; - case K_X25: - af = AF_CCITT; - break; default: usage(*argv); /* NOTREACHED */ @@ -827,10 +813,6 @@ getaddr(int which, char *s, struct hostent **hpp) link_addr(s, &su->sdl); return (1); - case AF_CCITT: - ccitt_addr(s, &su->sx25); - return (which == RTA_DST ? x25_makemask() : 1); - case PF_ROUTE: su->sa.sa_len = sizeof(*su); sockaddr(s, &su->sa); @@ -926,21 +908,6 @@ prefixlen(char *s) return (len == max); } -int -x25_makemask(void) -{ - char *cp; - - if ((rtm_addrs & RTA_NETMASK) == 0) { - rtm_addrs |= RTA_NETMASK; - for (cp = (char *)&so_mask.sx25.x25_net; - cp < &so_mask.sx25.x25_opts.op_flags; cp++) - *cp = -1; - so_mask.sx25.x25_len = (u_char)&(((sup)0)->sx25.x25_opts); - } - return (0); -} - void interfaces(void) { @@ -1091,7 +1058,6 @@ mask_addr(union sockunion *addr, union sockunion *mask, int which) #ifdef INET6 case AF_INET6: #endif - case AF_CCITT: case 0: return; } |