diff options
| author | maxv <maxv@NetBSD.org> | 2018-09-06 06:41:59 +0000 |
|---|---|---|
| committer | maxv <maxv@NetBSD.org> | 2018-09-06 06:41:59 +0000 |
| commit | c858eebf4d00a3df6932882fa2369835d1141213 (patch) | |
| tree | 1a14bbcf72717f0cf9f2150af3744ea39f1e1614 /usr.sbin | |
| parent | aa932dd1f430ab4101fd3017d5499ea42922f4b9 (diff) | |
Remove the network ATM code.
Diffstat (limited to 'usr.sbin')
| -rw-r--r-- | usr.sbin/Makefile | 5 | ||||
| -rw-r--r-- | usr.sbin/pvcsif/Makefile | 12 | ||||
| -rw-r--r-- | usr.sbin/pvcsif/pvcsif.8 | 53 | ||||
| -rw-r--r-- | usr.sbin/pvcsif/pvcsif.c | 149 | ||||
| -rw-r--r-- | usr.sbin/pvctxctl/Makefile | 12 | ||||
| -rw-r--r-- | usr.sbin/pvctxctl/pvctxctl.8 | 154 | ||||
| -rw-r--r-- | usr.sbin/pvctxctl/pvctxctl.c | 201 |
7 files changed, 1 insertions, 585 deletions
diff --git a/usr.sbin/Makefile b/usr.sbin/Makefile index 29228f7cc51..9fd55b4d385 100644 --- a/usr.sbin/Makefile +++ b/usr.sbin/Makefile @@ -1,4 +1,4 @@ -# $NetBSD: Makefile,v 1.277 2018/08/25 11:06:00 martin Exp $ +# $NetBSD: Makefile,v 1.278 2018/09/06 06:42:00 maxv Exp $ # from: @(#)Makefile 5.20 (Berkeley) 6/12/93 .include <bsd.own.mk> @@ -52,9 +52,6 @@ SUBDIR+=faithd ifmcstat ip6addrctl ndp rip6query rtsold SUBDIR+=mld6query route6d rtadvd traceroute6 .endif -# ATM PVC -SUBDIR+=pvcsif pvctxctl - SUBDIR+= racoon racoonctl # NPF diff --git a/usr.sbin/pvcsif/Makefile b/usr.sbin/pvcsif/Makefile deleted file mode 100644 index 4bf6ae8b368..00000000000 --- a/usr.sbin/pvcsif/Makefile +++ /dev/null @@ -1,12 +0,0 @@ -# $NetBSD: Makefile,v 1.2 2005/01/10 02:58:59 lukem Exp $ - -.include <bsd.own.mk> - -PROG= pvcsif -MAN= pvcsif.8 - -.if (${USE_INET6} != "no") -CPPFLAGS+=-DINET6 -.endif - -.include <bsd.prog.mk> diff --git a/usr.sbin/pvcsif/pvcsif.8 b/usr.sbin/pvcsif/pvcsif.8 deleted file mode 100644 index 0bc2abc359e..00000000000 --- a/usr.sbin/pvcsif/pvcsif.8 +++ /dev/null @@ -1,53 +0,0 @@ -.\" -.\" $NetBSD: pvcsif.8,v 1.4 2002/02/02 01:37:13 wiz Exp $ -.\" -.Dd December 29, 1997 -.Dt PVCSIF 8 -.Os -.Sh NAME -.Nm pvcsif -.Nd configure ATM PVC sub interfaces -.Sh SYNOPSIS -.Nm pvcsif -.Ar interface -.Op Fl s -.Nm pvcsif -.Fl a -.Sh DESCRIPTION -.Nm -creates a sub interface for an ATM PVC. -A sub interface -.Xr pvc 4 -is dynamically created. -The created interface is bound to -.Ar interface -but at this point no VC is assigned. To assign a VC, -.Xr pvctxctl 8 -should be used later. -.Pp -A PVC sub interface is intended to use an ATM PVC as an alternative -serial connection, and to be allocated per PVC basis. -A PVC sub interface looks as a point-to-point interface -and is multicast capable, as opposed to the NBMA -(NonBroadcast Multiple Access) model that requires a MARS server. -A point-to-point interface is useful to run MBone or protocols -requiring multicast, such as RSVP and IPv6, over a PVC WAN -connection. -.Pp -Note that a sub interface is not a full-fledged interface but just -an indirect reference to the real interface. -.Pp -The options are as follows: -.Bl -tag -width Fl -.It Fl s -For use with a shell, it prints the created interface name. -.It Fl a -Lists the existing sub interfaces. -.El -.Sh SEE ALSO -.Xr en 4 , -.Xr pvc 4 , -.Xr ifconfig 8 , -.Xr pvctxctl 8 -.Sh BUGS -Currently, there is no way to remove a sub interface. diff --git a/usr.sbin/pvcsif/pvcsif.c b/usr.sbin/pvcsif/pvcsif.c deleted file mode 100644 index d5c4a425913..00000000000 --- a/usr.sbin/pvcsif/pvcsif.c +++ /dev/null @@ -1,149 +0,0 @@ -/* $NetBSD: pvcsif.c,v 1.5 2011/08/30 21:27:00 joerg Exp $ */ - -/* - * Copyright (C) 1998 - * Sony Computer Science Laboratory Inc. 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. - * - * THIS SOFTWARE IS PROVIDED BY SONY CSL 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 SONY CSL 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. - * - * ALTQ Id: pvcsif.c,v 0.3 1999/05/19 11:31:11 kjc Exp - */ - -#include <stdio.h> -#include <stdlib.h> -#include <unistd.h> -#include <string.h> -#include <err.h> - -#include <sys/socket.h> -#include <sys/ioctl.h> -#include <net/if.h> - -#include <net/if_atm.h> - -__dead static void usage(void); -static void list_all(void); - -void usage(void) -{ - fprintf(stderr, "usage: pvcsif -a\n"); - fprintf(stderr, " pvcsif interface [-s]\n"); - exit(1); -} - -int -main(int argc, char **argv) -{ - struct ifreq ifr; - int shell_mode = 0; - int s, ch; - - if (argc < 2) - usage(); - - if (strncmp(argv[1], "-a", 2) == 0) { - list_all(); - return (0); - } - - ifr.ifr_name[IFNAMSIZ-1] = '\0'; - strncpy(ifr.ifr_name, argv[1], IFNAMSIZ-1); - - optind = 2; - while ((ch = getopt(argc, argv, "s")) != -1) { - switch (ch) { - case 's': - shell_mode = 1; - break; - } - } - - if ((s = socket(AF_INET, SOCK_DGRAM, 0)) < 0) - err(1, "can't open socket"); - - if (ioctl(s, SIOCSPVCSIF, &ifr) < 0) - err(1, "SIOCSPVCSIF"); - - close(s); - - if (shell_mode) - printf("%s", ifr.ifr_name); - else - printf("created a pvc subinterface %s (bound to %s)\n", - ifr.ifr_name, argv[1]); - - return (0); -} - -static void -list_all(void) -{ - struct if_nameindex *ifn_list, *ifnp; - struct pvctxreq pvcreq; - int pcr, s; - - if ((ifn_list = if_nameindex()) == NULL) - err(1, "if_nameindex failed"); - - if ((s = socket(AF_INET, SOCK_DGRAM, 0)) < 0) - err(1, "can't open socket"); - - for (ifnp = ifn_list; ifnp->if_name != NULL; ifnp++) { - if (strncmp(ifnp->if_name, "pvc", 3) == 0) { - - bzero(&pvcreq, sizeof(pvcreq)); - strncpy(pvcreq.pvc_ifname, ifnp->if_name, IFNAMSIZ-1); - if (ioctl(s, SIOCGPVCTX, &pvcreq) < 0) - err(1, "SIOCSPVCTX"); - - /* - * print info - */ - pcr = pvcreq.pvc_pcr; - printf(" %s (bound to %s): vci:[%d:%d] (", - ifnp->if_name, pvcreq.pvc_ifname, - ATM_PH_VPI(&pvcreq.pvc_aph), - ATM_PH_VCI(&pvcreq.pvc_aph)); - if (ATM_PH_FLAGS(&pvcreq.pvc_aph) & ATM_PH_AAL5) - printf("AAL5"); - if (ATM_PH_FLAGS(&pvcreq.pvc_aph) & ATM_PH_LLCSNAP) - printf("/LLCSNAP"); - printf(") "); - if (pcr < 0) - printf("(invalid)\n"); - else if (pcr == 0) - printf("pcr:%d(full speed)\n", pcr); - else if (pcr < 1000) - printf("pcr:%d(%dbps)\n", - pcr, pcr * 48 * 8); - else if (pcr < 1000000) - printf("pcr:%d(%dKbps)\n", - pcr, pcr * 48 * 8 / 1000); - else - printf("pcr:%d(%dMbps)\n", - pcr, pcr * 48 * 8 / 1000000); - } - } - - close(s); - if_freenameindex(ifn_list); -} diff --git a/usr.sbin/pvctxctl/Makefile b/usr.sbin/pvctxctl/Makefile deleted file mode 100644 index 29c943920c8..00000000000 --- a/usr.sbin/pvctxctl/Makefile +++ /dev/null @@ -1,12 +0,0 @@ -# $NetBSD: Makefile,v 1.2 2005/01/10 02:58:59 lukem Exp $ - -.include <bsd.own.mk> - -PROG= pvctxctl -MAN= pvctxctl.8 - -.if (${USE_INET6} != "no") -CPPFLAGS+=-DINET6 -.endif - -.include <bsd.prog.mk> diff --git a/usr.sbin/pvctxctl/pvctxctl.8 b/usr.sbin/pvctxctl/pvctxctl.8 deleted file mode 100644 index 64db8ac4661..00000000000 --- a/usr.sbin/pvctxctl/pvctxctl.8 +++ /dev/null @@ -1,154 +0,0 @@ -.\" Copyright (C) 1998 -.\" Sony Computer Science Laboratory Inc. 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. -.\" -.\" THIS SOFTWARE IS PROVIDED BY SONY CSL 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 SONY CSL 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. -.\" -.\" $NetBSD: pvctxctl.8,v 1.7 2005/09/15 01:49:07 wiz Exp $ -.\" -.Dd December 29, 1997 -.Dt PVCTXCTL 8 -.Os -.Sh NAME -.Nm pvctxctl -.Nd display or control ATM PVC transmitter parameters -.Sh SYNOPSIS -.Nm -.Ar interface -.Op Oo vpi : Oc Ns Ar vci -.Nm -.Ar interface -.Oo vpi : Oc Ns Ar vci -.Op Fl n -.Op Fl b Ar max-bandwidth -.Op Fl j Oo vpi : Oc Ns Ar vci -.Op Fl p Ar pcr -.Sh DESCRIPTION -.Nm -displays or controls the shaper parameters of an ATM VC. -When a shaper value is specified, -.Nm -sets a shaper to an ATM VC. -.Nm -works for a PVC sub interface -.Xr pvc 4 -as well as a real ATM interface -.Xr en 4 . -.Pp -For a real ATM interface, the specified VC should be assigned -beforehand by -.Xr route 8 . -.Pp -For a sub interface, -.Nm -assigns the specified VC to the sub interface. If another VC is -already assigned to the sub interface, the old VC is invalidated. -.Pp -Availability of shapers, the number of hardware shaper channels, -and accuracy of shaping are all device dependent. -For example, ENI Midway chip has 8 shaper channels but the driver -reserves one for non-shaping VCs. -.Pp -The options are as follows: -.Bl -tag -width Fl -.It Ar interface -The -.Ar interface -parameter is a string of the form -.Dq name unit , -for example, -.Dq en0 . -.It Oo vpi: Oc Ns Ar vci -The VC number to which the shaper is assigned. -When the VPI number is omitted, VPI number 0 is -assumed. -For example, to assign a shaper to VPI=0 and -VCI=201, the following forms can be used: -"201", "0xc9", "0:201", "0:0xc9". -.It Fl b Ar max-bandwidth -The PCR parameter can be specified also in -.Dq bits per second . -The rate is the rate of AAL5 frame and -the PCR is calculated by the following form: -.Pp -.Dl PCR = max-bandwidth / 8 / 48 -.Pp -.Dq K -and -.Dq M -can be used as a short hand of -.Dq 000 -and -.Dq 000000 -respectively. For example, -.Dq 45M -means -.Dq 45Mbps -or PCR value -.Dq 117187 . -.It Fl j Oo vpi : Oc Ns Ar vci -The join parameter is intended for VP shaping. -The VC shaper channel is shared with the existing VC, -which means the sum of the cell rates never exceeds -the maximum PCR among the shared VCs. -On the other hand, when the shaper channel is not shared, -the sum of the cell rates could be the sum of the PCRs. -.Pp -For example, if two VCs (say 201 and 202) share a -45Mbps VP, use: -.Pp -.Dl # pvctxctl en0 201 -b 45M -.Dl # pvctxctl en0 202 -b 45M -j 201 -.It Fl n -This parameter is only for a sub interface. -Use NULL encapsulation instead of LLC/SNAP. -.It Fl p Ar pcr -The PCR (Peak Cell Rate) parameter specifies the peak cell rate in -"cells per second". -If PCR value "0" is specified, -no shaper is assigned, which means cells are sent at -full-speed of the link. -If PCR value -.Dq -1 -is specified, the corresponding VC -is invalidated. -.El -.Sh SEE ALSO -.Xr en 4 , -.Xr ifconfig 8 , -.Xr pvcsif 8 , -.Xr route 8 -.Sh BUGS -A real ATM interface and a sub interface require different -sequences to set a shaper. -For example, to assign a 45Mbps shaper to VC 201 (0xc9) of en0: -.Bd -literal -offset indent -# ifconfig en0 10.0.0.1 -# route add -iface 10.0.0.2 -link en0:3.0.0.c9 -# pvctxctl en0 0xc9 -b 45M -.Ed -.Pp -For a shadow interface, -.Bd -literal -offset indent -# pvcsif en0 # creates pvc0 -# ifconfig pvc0 10.0.0.1 10.0.0.2 -# pvctxctl pvc0 201 -b 45M -.Ed diff --git a/usr.sbin/pvctxctl/pvctxctl.c b/usr.sbin/pvctxctl/pvctxctl.c deleted file mode 100644 index 78e7cafb88f..00000000000 --- a/usr.sbin/pvctxctl/pvctxctl.c +++ /dev/null @@ -1,201 +0,0 @@ -/* $NetBSD: pvctxctl.c,v 1.7 2011/08/30 21:28:27 joerg Exp $ */ - -/* - * Copyright (C) 1998 - * Sony Computer Science Laboratory Inc. 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. - * - * THIS SOFTWARE IS PROVIDED BY SONY CSL 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 SONY CSL 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. - * - * ALTQ Id: pvctxctl.c,v 0.4 1999/05/19 11:31:11 kjc Exp - */ - -#include <stdio.h> -#include <stdlib.h> -#include <unistd.h> -#include <string.h> -#include <ctype.h> -#include <err.h> - -#include <sys/socket.h> -#include <sys/ioctl.h> -#include <net/if.h> - -#include <net/if_atm.h> - -static int str2vc(char *str, int *vpi, int *vci); -__dead static void usage(void); - -static void -usage(void) -{ - fprintf(stderr, "usage: pvctxctl interface [vpi:]vci\n"); - fprintf(stderr, " [-p pcr] [-b pcr_in_bps] [-j [vpi:]vci\n"); - fprintf(stderr, " [-n] \n"); - exit(1); -} - -int -main(int argc, char **argv) -{ - struct pvctxreq pvcreq; - int s, ch; - long bandwidth; - char *if_name, *cp; - int vpi = 0; - int vci = 0; - int joint_vpi = 0; - int joint_vci = 0; - int pcr = 0; - int llcsnap = ATM_PH_LLCSNAP; - int getinfo = 1; - int subinterface = 0; - int verbose = 1; - - if (argc < 2) - usage(); - - if_name = argv[1]; - if (argc > 2 && isdigit((unsigned char)argv[2][0])) - str2vc(argv[2], &vpi, &vci); - - optind = 3; - while ((ch = getopt(argc, argv, "p:b:j:snv")) != -1) { - switch (ch) { - case 'p': - pcr = strtol(optarg, NULL, 0); - getinfo = 0; - break; - case 'b': - cp = NULL; - bandwidth = strtol(optarg, &cp, 0); - if (cp != NULL) { - if (*cp == 'K' || *cp == 'k') - bandwidth *= 1000; - if (*cp == 'M' || *cp == 'm') - bandwidth *= 1000000; - } - pcr = bandwidth / 8 / 48; - getinfo = 0; - break; - case 'j': - str2vc(optarg, &joint_vpi, &joint_vci); - break; - case 'n': - llcsnap = 0; - break; - case 'v': - verbose = 1; - break; - default: - usage(); - } - } - - if ((s = socket(AF_INET, SOCK_DGRAM, 0)) < 0) - err(1, "can't open socket"); - - pvcreq.pvc_ifname[IFNAMSIZ-1] = '\0'; - strncpy(pvcreq.pvc_ifname, if_name, IFNAMSIZ-1); - - if (strncmp(if_name, "pvc", 3) == 0) - /* pvc subinterface */ - subinterface = 1; - - ATM_PH_FLAGS(&pvcreq.pvc_aph) = ATM_PH_AAL5 | llcsnap; - ATM_PH_VPI(&pvcreq.pvc_aph) = vpi; - ATM_PH_SETVCI(&pvcreq.pvc_aph, vci); - - ATM_PH_FLAGS(&pvcreq.pvc_joint) = 0; - ATM_PH_VPI(&pvcreq.pvc_joint) = joint_vpi; - ATM_PH_SETVCI(&pvcreq.pvc_joint, joint_vci); - - pvcreq.pvc_pcr = pcr; - - if (getinfo) { - if (ioctl(s, SIOCGPVCTX, &pvcreq) < 0) - err(1, "SIOCSPVCTX"); - } - else { - if (verbose) { - printf("setting pvc tx: interface:%s vc:%d:%d ph=0x%x\n", - if_name, vpi, vci, ATM_PH_FLAGS(&pvcreq.pvc_aph)); - printf(" joint:%d:%d, setting pcr:%d\n", - joint_vpi, joint_vci, pcr); - } - - if (ioctl(s, SIOCSPVCTX, &pvcreq) < 0) - err(1, "SIOCSPVCTX"); - } - - pcr = pvcreq.pvc_pcr; - - /* - * print info - */ - printf(" %s", if_name); - if (subinterface) - printf(" (bound to %s)", pvcreq.pvc_ifname); - printf(": vci:[%d:%d] (", - ATM_PH_VPI(&pvcreq.pvc_aph), ATM_PH_VCI(&pvcreq.pvc_aph)); - if (ATM_PH_FLAGS(&pvcreq.pvc_aph) & ATM_PH_AAL5) - printf("AAL5"); - if (ATM_PH_FLAGS(&pvcreq.pvc_aph) & ATM_PH_LLCSNAP) - printf("/LLCSNAP"); - printf(") "); - if (pcr < 0) - printf("(invalid)\n"); - else if (pcr == 0) - printf("pcr:%d(full speed)\n", pcr); - else if (pcr < 1000) - printf("pcr:%d(%dbps)\n", pcr, pcr * 48 * 8); - else if (pcr < 1000000) - printf("pcr:%d(%dKbps)\n", pcr, pcr * 48 * 8 / 1000); - else - printf("pcr:%d(%dMbps)\n", pcr, pcr * 48 * 8 / 1000000); - - close(s); - - if (getinfo && pcr < 0) { - fprintf(stderr, "can't get pvc info for vci:%d\n", vci); - fprintf(stderr, "to setup a vci, use -p or -b option\n"); - } - - return (0); -} - -static int -str2vc(char *str, int *vpip, int *vcip) -{ - char *c; - - if ((c = strchr(str, ':')) != NULL) { - *c = '\0'; - *vpip = strtol(str, NULL, 0); - str = c + 1; - } - else - *vpip = 0; - - *vcip = strtol(str, NULL, 0); - return (0); -} - |
