Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/usr.sbin gifconfig(8) is obsolete; functionality has been ad...



details:   https://anonhg.NetBSD.org/src/rev/3bede3bf2f95
branches:  trunk
changeset: 494067:3bede3bf2f95
user:      thorpej <thorpej%NetBSD.org@localhost>
date:      Fri Jun 30 18:02:32 2000 +0000

description:
gifconfig(8) is obsolete; functionality has been added to
ifconfig(8).

diffstat:

 usr.sbin/Makefile              |    4 +-
 usr.sbin/gifconfig/Makefile    |    7 -
 usr.sbin/gifconfig/gifconfig.8 |  145 ------
 usr.sbin/gifconfig/gifconfig.c |  889 -----------------------------------------
 4 files changed, 2 insertions(+), 1043 deletions(-)

diffs (truncated from 1071 to 300 lines):

diff -r 6c1adfa1de87 -r 3bede3bf2f95 usr.sbin/Makefile
--- a/usr.sbin/Makefile Fri Jun 30 17:55:11 2000 +0000
+++ b/usr.sbin/Makefile Fri Jun 30 18:02:32 2000 +0000
@@ -1,4 +1,4 @@
-#      $NetBSD: Makefile,v 1.145 2000/06/23 06:01:18 thorpej Exp $
+#      $NetBSD: Makefile,v 1.146 2000/06/30 18:02:32 thorpej Exp $
 #      from: @(#)Makefile      5.20 (Berkeley) 6/12/93
 
 .include <bsd.own.mk>
@@ -21,7 +21,7 @@
        wsfontload ypbind yppoll ypserv ypset zdump zic
 
 # IPv6
-SUBDIR+=faithd gifconfig ifmcstat mld6query mtrace6 ndp pim6dd pim6sd \
+SUBDIR+=faithd ifmcstat mld6query mtrace6 ndp pim6dd pim6sd \
        rip6query route6d rtadvd traceroute6 rtsold
 
 # ATM PVC
diff -r 6c1adfa1de87 -r 3bede3bf2f95 usr.sbin/gifconfig/Makefile
--- a/usr.sbin/gifconfig/Makefile       Fri Jun 30 17:55:11 2000 +0000
+++ /dev/null   Thu Jan 01 00:00:00 1970 +0000
@@ -1,7 +0,0 @@
-# $NetBSD: Makefile,v 1.2 1999/07/03 06:26:25 itojun Exp $
-
-PROG=  gifconfig
-CPPFLAGS+=-DINET6
-MAN=   gifconfig.8
-
-.include <bsd.prog.mk>
diff -r 6c1adfa1de87 -r 3bede3bf2f95 usr.sbin/gifconfig/gifconfig.8
--- a/usr.sbin/gifconfig/gifconfig.8    Fri Jun 30 17:55:11 2000 +0000
+++ /dev/null   Thu Jan 01 00:00:00 1970 +0000
@@ -1,145 +0,0 @@
-.\"    $NetBSD: gifconfig.8,v 1.5 2000/05/13 07:55:06 itojun Exp $
-.\"    $KAME: gifconfig.8,v 1.5 2000/05/13 07:48:10 itojun Exp $
-.\"
-.\" Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
-.\" 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 project 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 PROJECT 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 PROJECT 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.
-.\"
-.Dd May 17, 1998
-.Dt GIFCONFIG 8
-.Os
-.\"
-.Sh NAME
-.Nm gifconfig
-.Nd configure generic IP tunnel
-.\"
-.Sh SYNOPSIS
-.Nm
-.Ar interface
-.Op Ar af
-.Op Ar physsrc physdest
-.Nm gifconfig
-.Ar interface
-.Ic delete
-.Nm gifconfig
-.Fl a
-.Sh DESCRIPTION
-.Nm
-configures the physical address for the generic IP tunnel 
-inteface, such as "gif0".
-Argument
-.Ar physsrc
-and
-.Ar physdest
-are interpreted as the outer source/destination address for 
-encapsulating IPv4/v6 header.
-Argument
-.Ar af
-specifies the address family for
-.Ar physsrc
-and
-.Ar physdest .
-.Ar Af
-can be
-.Li inet
-or
-.Li inet6 ,
-and will be treated as
-.Li inet
-if ommitted.
-.Pp
-If a special argument
-.Ic delete
-is specified,
-.Nm
-just deletes the existing source and destination addresses on
-.Ar interface .
-If no outer addresses are specified, this usage has no effect.
-.Pp
-.Nm
-takes the following optional argument:
-.Bl -tag -width Ds
-.It Fl a
-Display information associated all generic IP tunnel interfaces.
-.El
-.Pp
-Please note that it is very easy to create infinite routing loop,
-when you configure tunnel over same address family
-.Po
-e.g. IPv4-over-IPv4
-.Pc .
-.Sh EXAMPLES
-If you would like to configure IPv6 over IPv4
-.Pq aka IPv6 in IPv4
-tunnel between
-.Li 10.1.1.1
-and
-.Li 10.2.3.4 ,
-you should perform the following command:
-.Bd -literal -offset
-# gifconfig gif0 inet 10.1.1.1 10.2.3.4
-.Ed
-.Pp
-.\" To use the
-.\" .Li 0.0.0.0
-.\" feature to establish a tunnel from host1 to host3
-.\" which will encapsulate and carry packets from host2, on host1 do:
-.\" .Bd -literal -offset
-.\" # ifconfig gif0 inet host1  127.0.0.2  # assign an address to gif0
-.\" # gifconfig gif0 inet host1 0.0.0.0    # assign encapsulation addresses
-.\" # route add host2 host3 -ifp gif0:     # encap host2 packets, send to host3
-.\" .Ed
-.\" .Pp
-.\" Note: the
-.\" .Fl ifp
-.\" option to route does not work as documented in
-.\" most versions of FreeBSD.
-.\" .Pp
-.\" On host3 do:
-.\" .Bd -literal -offset
-.\" # ifconfig gif0 inet host3  127.0.0.2  # assign an address to gif0
-.\" # gifconfig gif0 inet host3 0.0.0.0    # assign encapsulation addresses
-.\" .Ed
-.\" .Pp
-.\" Now if you ping host2 from host1, the packets should be encapsulated
-.\" with outer source address = host1 and outer destination address = host3,
-.\" and delivered to host3.
-.\" host3 will decapsulate the packet and deliver it normally to host2.
-.\" .Pp
-This is also possible to use IPv6 as outer proto, by replacing
-.Li inet
-to
-.Li inet6 ,
-and IPv4 addresses to some appropriate IPv6 addresses in above example.
-.Sh RETURN VALUES
-The command exits with exit status of 1 on errors, 0 on success.
-.Sh SEE ALSO
-.Xr gif 4 ,
-.Xr ifconfig 8
-.Sh HISTORY
-The
-.Nm
-command first appeared in WIDE Hydrangea IPv6 protocol stack kit.
diff -r 6c1adfa1de87 -r 3bede3bf2f95 usr.sbin/gifconfig/gifconfig.c
--- a/usr.sbin/gifconfig/gifconfig.c    Fri Jun 30 17:55:11 2000 +0000
+++ /dev/null   Thu Jan 01 00:00:00 1970 +0000
@@ -1,889 +0,0 @@
-/*     $NetBSD: gifconfig.c,v 1.9 2000/05/22 03:06:46 itojun Exp $     */
-/*     $KAME: gifconfig.c,v 1.11 2000/05/22 03:01:43 itojun Exp $      */
-
-/*
- * Copyright (c) 1983, 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. All advertising materials mentioning features or use of this software
- *    must display the following acknowledgement:
- *     This product includes software developed by the University of
- *     California, Berkeley and its contributors.
- * 4. 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.
- */
-
-/*
- * gifconfig, derived from ifconfig
- *
- * @(#) Copyright (c) 1983, 1993\n\
- *     The Regents of the University of California.  All rights reserved.\n
- *
- * @(#)ifconfig.c      8.2 (Berkeley) 2/16/94
- */
-
-/*
- *  951109 - Andrew%pubnix.net@localhost - Changed to iterative buffer growing mechanism
- *                              for ifconfig -a so all interfaces are queried.
- *
- *  960101 - peter%freebsd.org@localhost - Blow away the SIOCGIFCONF code and use
- *                              sysctl() to get the structured interface conf
- *                              and parse the messages in there. REALLY UGLY!
- */
-
-#include <sys/param.h>
-#include <sys/socket.h>
-#include <sys/ioctl.h>
-#include <sys/sysctl.h>
-
-#include <net/if.h>
-#if defined(__FreeBSD__) && __FreeBSD__ >= 3
-#include <net/if_var.h>
-#endif /* __FreeBSD__ >= 3 */
-#include <net/if_dl.h>
-#include <net/if_types.h>
-#include <net/route.h>
-#include <netinet/in.h>
-#include <netinet/in_var.h>
-#include <arpa/inet.h>
-#include <netdb.h>
-
-#include <sys/protosw.h>
-
-#include <ctype.h>
-#include <err.h>
-#include <errno.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <unistd.h>
-#include <nlist.h>
-#include <kvm.h>
-#include <fcntl.h>
-
-struct ifreq           ifr;
-struct ifaliasreq      addreq;
-#ifdef INET6
-struct in6_ifreq       in6_ifr;
-struct in6_aliasreq    in6_addreq;
-#endif
-
-char   name[32];
-int    flags;
-int    metric;
-int    mtu;
-int    setpsrc = 0;
-int    newaddr = 0;
-int    s;
-kvm_t  *kvmd;
-
-#ifdef INET6
-char ntop_buf[INET6_ADDRSTRLEN];       /*inet_ntop()*/
-#endif
-
-void setifpsrc __P((char *, int));
-void setifpdst __P((char *, int));
-void setifflags __P((char *, int));
-#ifdef SIOCDIFPHYADDR
-void delifaddrs __P((char *, int));
-#endif
-
-#define        NEXTARG         0xffffff
-
-struct cmd {
-       char    *c_name;
-       int     c_parameter;            /* NEXTARG means next argv */
-       void    (*c_func) __P((char *, int));
-} cmds[] = {



Home | Main Index | Thread Index | Old Index