Source-Changes-HG archive

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

[src/trunk]: src/sys ISO over IPv4/v6 by EON encapsulation. from chopps, syn...



details:   https://anonhg.NetBSD.org/src/rev/ffce6804817a
branches:  trunk
changeset: 504033:ffce6804817a
user:      itojun <itojun%NetBSD.org@localhost>
date:      Tue Feb 20 08:49:15 2001 +0000

description:
ISO over IPv4/v6 by EON encapsulation.  from chopps, sync with kame.

diffstat:

 sys/netinet/in_gif.c     |  55 +++++++----------------------------------------
 sys/netinet/in_proto.c   |  12 ++++++++-
 sys/netinet6/in6_gif.c   |  14 ++++++-----
 sys/netinet6/in6_proto.c |  10 +++++++-
 4 files changed, 36 insertions(+), 55 deletions(-)

diffs (234 lines):

diff -r 3aed6bc15e8f -r ffce6804817a sys/netinet/in_gif.c
--- a/sys/netinet/in_gif.c      Tue Feb 20 08:48:27 2001 +0000
+++ b/sys/netinet/in_gif.c      Tue Feb 20 08:49:15 2001 +0000
@@ -1,5 +1,5 @@
-/*     $NetBSD: in_gif.c,v 1.17 2001/01/22 07:57:34 itojun Exp $       */
-/*     $KAME: in_gif.c,v 1.50 2001/01/22 07:27:16 itojun Exp $ */
+/*     $NetBSD: in_gif.c,v 1.18 2001/02/20 08:49:15 itojun Exp $       */
+/*     $KAME: in_gif.c,v 1.51 2001/02/20 08:31:07 itojun Exp $ */
 
 /*
  * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
@@ -30,16 +30,8 @@
  * SUCH DAMAGE.
  */
 
-/*
- * in_gif.c
- */
-
-#ifdef __FreeBSD__
-#include "opt_mrouting.h"
-#endif
-#if (defined(__FreeBSD__) && __FreeBSD__ >= 3) || defined(__NetBSD__)
 #include "opt_inet.h"
-#endif
+#include "opt_iso.h"
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -47,19 +39,9 @@
 #include <sys/sockio.h>
 #include <sys/mbuf.h>
 #include <sys/errno.h>
-#ifdef __FreeBSD__
-#include <sys/kernel.h>
-#include <sys/sysctl.h>
-#endif
-#if !defined(__FreeBSD__) || __FreeBSD__ < 3
 #include <sys/ioctl.h>
-#endif
 #include <sys/syslog.h>
 
-#if defined(__FreeBSD__) && __FreeBSD__ >= 3
-#include <sys/malloc.h>
-#endif
-
 #include <net/if.h>
 #include <net/route.h>
 
@@ -96,10 +78,6 @@
 #else
 int ip_gif_ttl = 0;
 #endif
-#ifdef __FreeBSD__
-SYSCTL_INT(_net_inet_ip, IPCTL_GIF_TTL, gifttl, CTLFLAG_RW,
-       &ip_gif_ttl,    0, "");
-#endif
 
 int
 in_gif_output(ifp, family, m, rt)
@@ -240,11 +218,7 @@
 #endif
        }
 
-#ifndef __OpenBSD__
        error = ip_output(m, NULL, &sc->gif_ro, 0, NULL);
-#else
-       error = ip_output(m, NULL, &sc->gif_ro, 0, NULL, NULL);
-#endif
        return(error);
 }
 
@@ -260,21 +234,16 @@
        int off, proto;
        struct ifnet *gifp = NULL;
        struct ip *ip;
+       va_list ap;
        int af;
-       va_list ap;
        u_int8_t otos;
 
        va_start(ap, m);
        off = va_arg(ap, int);
-#ifndef __OpenBSD__
        proto = va_arg(ap, int);
-#endif
        va_end(ap);
 
        ip = mtod(m, struct ip *);
-#ifdef __OpenBSD__
-       proto = ip->ip_p;
-#endif
 
        gifp = (struct ifnet *)encap_getarg(m);
 
@@ -324,6 +293,11 @@
                break;
            }
 #endif /* INET6 */
+#ifdef ISO
+       case IPPROTO_EON:
+               af = AF_ISO;
+               break;
+#endif
        default:
                ipstat.ips_nogif++;
                m_freem(m);
@@ -379,14 +353,7 @@
                return 0;
        }
        /* reject packets with broadcast on source */
-#if defined(__OpenBSD__) || defined(__NetBSD__)
        for (ia4 = in_ifaddr.tqh_first; ia4; ia4 = ia4->ia_list.tqe_next)
-#elif (defined(__FreeBSD__) && __FreeBSD__ >= 3)
-       for (ia4 = TAILQ_FIRST(&in_ifaddrhead); ia4;
-            ia4 = TAILQ_NEXT(ia4, ia_link))
-#else
-       for (ia4 = in_ifaddr; ia4 != NULL; ia4 = ia4->ia_next)
-#endif
        {
                if ((ia4->ia_ifa.ifa_ifp->if_flags & IFF_BROADCAST) == 0)
                        continue;
@@ -404,11 +371,7 @@
                sin.sin_family = AF_INET;
                sin.sin_len = sizeof(struct sockaddr_in);
                sin.sin_addr = ip.ip_src;
-#ifdef __FreeBSD__
-               rt = rtalloc1((struct sockaddr *)&sin, 0, 0UL);
-#else
                rt = rtalloc1((struct sockaddr *)&sin, 0);
-#endif
                if (!rt || rt->rt_ifp != m->m_pkthdr.rcvif) {
 #if 0
                        log(LOG_WARNING, "%s: packet from 0x%x dropped "
diff -r 3aed6bc15e8f -r ffce6804817a sys/netinet/in_proto.c
--- a/sys/netinet/in_proto.c    Tue Feb 20 08:48:27 2001 +0000
+++ b/sys/netinet/in_proto.c    Tue Feb 20 08:49:15 2001 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: in_proto.c,v 1.44 2000/10/18 17:09:14 thorpej Exp $    */
+/*     $NetBSD: in_proto.c,v 1.45 2001/02/20 08:49:15 itojun Exp $     */
 
 /*
  * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
@@ -235,14 +235,22 @@
   tp_init,     0,              tp_slowtimo,    tp_drain,
 },
 #endif /* TPIP */
+#ifdef ISO
 /* EON (ISO CLNL over IP) */
 #ifdef EON
 { SOCK_RAW,    &inetdomain,    IPPROTO_EON,    0,
-  eoninput,    0,              eonctlinput,            0,
+  eoninput,    0,              eonctlinput,    0,
   0,
   eonprotoinit,        0,              0,              0,
 },
+#else
+{ SOCK_RAW,    &inetdomain,    IPPROTO_EON,    0,
+  encap4_input,        rip_output,     0,              rip_ctloutput,
+  rip_usrreq,  /*XXX*/
+  0,           0,              0,              0,
+},
 #endif /* EON */
+#endif /* ISO */
 #ifdef NSIP
 { SOCK_RAW,    &inetdomain,    IPPROTO_IDP,    PR_ATOMIC|PR_ADDR,
   idpip_input, NULL,           nsip_ctlinput,  0,
diff -r 3aed6bc15e8f -r ffce6804817a sys/netinet6/in6_gif.c
--- a/sys/netinet6/in6_gif.c    Tue Feb 20 08:48:27 2001 +0000
+++ b/sys/netinet6/in6_gif.c    Tue Feb 20 08:49:15 2001 +0000
@@ -1,5 +1,5 @@
-/*     $NetBSD: in6_gif.c,v 1.16 2001/02/11 05:24:21 itojun Exp $      */
-/*     $KAME: in6_gif.c,v 1.43 2001/01/22 07:27:17 itojun Exp $        */
+/*     $NetBSD: in6_gif.c,v 1.17 2001/02/20 08:49:16 itojun Exp $      */
+/*     $KAME: in6_gif.c,v 1.45 2001/02/20 08:37:00 itojun Exp $        */
 
 /*
  * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
@@ -30,11 +30,8 @@
  * SUCH DAMAGE.
  */
 
-/*
- * in6_gif.c
- */
-
 #include "opt_inet.h"
+#include "opt_iso.h"
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -280,6 +277,11 @@
                break;
            }
 #endif
+#ifdef ISO
+       case IPPROTO_EON:
+               af = AF_ISO;
+               break;
+#endif
        default:
                ip6stat.ip6s_nogif++;
                m_freem(m);
diff -r 3aed6bc15e8f -r ffce6804817a sys/netinet6/in6_proto.c
--- a/sys/netinet6/in6_proto.c  Tue Feb 20 08:48:27 2001 +0000
+++ b/sys/netinet6/in6_proto.c  Tue Feb 20 08:49:15 2001 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: in6_proto.c,v 1.25 2001/02/11 06:49:52 itojun Exp $    */
+/*     $NetBSD: in6_proto.c,v 1.26 2001/02/20 08:49:16 itojun Exp $    */
 /*     $KAME: in6_proto.c,v 1.66 2000/10/10 15:35:47 itojun Exp $      */
 
 /*
@@ -67,6 +67,7 @@
 
 #include "opt_inet.h"
 #include "opt_ipsec.h"
+#include "opt_iso.h"
 
 #include <sys/param.h>
 #include <sys/socket.h>
@@ -220,6 +221,13 @@
   encap_init,  0,              0,              0,
 #endif
 },
+#ifdef ISO
+{ SOCK_RAW,    &inet6domain,   IPPROTO_EON,    0,
+  encap6_input,        rip6_output,    0,              rip6_ctloutput,
+  rip_usrreq,  /*XXX*/
+  0,           0,              0,              0,
+},
+#endif
 { SOCK_RAW,     &inet6domain,  IPPROTO_PIM,    PR_ATOMIC|PR_ADDR,
   pim6_input,    rip6_output,  0,              rip6_ctloutput, 
   rip6_usrreq,



Home | Main Index | Thread Index | Old Index