diff options
author | Jun-ichiro itojun Hagino <itojun@cvs.openbsd.org> | 1999-12-08 06:50:25 +0000 |
---|---|---|
committer | Jun-ichiro itojun Hagino <itojun@cvs.openbsd.org> | 1999-12-08 06:50:25 +0000 |
commit | d9c080e0265d3557ac6fe2d2723cf4823eaa909f (patch) | |
tree | 422a747ed77f091d33ae234312450cc5cb2aa789 /sys/netinet/in_proto.c | |
parent | bfa115c3a1f89cedeb913741469312347a52f8ee (diff) |
bring in KAME IPv6 code, dated 19991208.
replaces NRL IPv6 layer. reuses NRL pcb layer. no IPsec-on-v6 support.
see sys/netinet6/{TODO,IMPLEMENTATION} for more details.
GENERIC configuration should work fine as before. GENERIC.v6 works fine
as well, but you'll need KAME userland tools to play with IPv6 (will be
bringed into soon).
Diffstat (limited to 'sys/netinet/in_proto.c')
-rw-r--r-- | sys/netinet/in_proto.c | 73 |
1 files changed, 69 insertions, 4 deletions
diff --git a/sys/netinet/in_proto.c b/sys/netinet/in_proto.c index ed387d1efb3..179361ddbd0 100644 --- a/sys/netinet/in_proto.c +++ b/sys/netinet/in_proto.c @@ -1,7 +1,36 @@ -/* $OpenBSD: in_proto.c,v 1.15 1999/10/28 03:21:51 angelos Exp $ */ +/* $OpenBSD: in_proto.c,v 1.16 1999/12/08 06:50:19 itojun Exp $ */ /* $NetBSD: in_proto.c,v 1.14 1996/02/18 18:58:32 christos 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. + */ + +/* * Copyright (c) 1982, 1986, 1993 * The Regents of the University of California. All rights reserved. * @@ -64,6 +93,14 @@ didn't get a copy, you may request one from <license@ipv6.nrl.navy.mil>. #include <netinet/ip_var.h> #include <netinet/ip_icmp.h> #include <netinet/in_pcb.h> + +#ifdef INET6 +#ifndef INET +#include <netinet/in.h> +#endif +#include <netinet/ip6.h> +#endif + #include <netinet/igmp_var.h> #include <netinet/tcp.h> #include <netinet/tcp_fsm.h> @@ -78,6 +115,19 @@ didn't get a copy, you may request one from <license@ipv6.nrl.navy.mil>. * TCP/IP protocol family: IP, ICMP, UDP, TCP. */ +#if 0 /*KAME IPSEC*/ +#include <netinet6/ah.h> +#ifdef IPSEC_ESP +#include <netinet6/esp.h> +#endif +#include <netinet6/ipcomp.h> +#endif /* IPSEC */ + +#include "gif.h" +#if NGIF > 0 +#include <netinet/in_gif.h> +#endif + #ifdef NSIP #include <netns/ns_var.h> #include <netns/idp_var.h> @@ -107,7 +157,7 @@ void iplinit __P((void)); #endif #ifdef INET6 -#include <netinet6/ipv6_var.h> +#include <netinet6/ip6_var.h> #endif /* INET6 */ #ifdef IPSEC @@ -146,6 +196,20 @@ struct protosw inetsw[] = { rip_usrreq, 0, 0, 0, 0, icmp_sysctl }, +#if NGIF > 0 +{ SOCK_RAW, &inetdomain, IPPROTO_IPV4, PR_ATOMIC|PR_ADDR, + in_gif_input, 0, 0, 0, + 0, + 0, 0, 0, 0, +}, +#ifdef INET6 +{ SOCK_RAW, &inetdomain, IPPROTO_IPV6, PR_ATOMIC|PR_ADDR, + in_gif_input, 0, 0, 0, + 0, + 0, 0, 0, 0, +}, +#endif /* INET6 */ +#else /* NGIF */ #if defined(IPSEC) || defined(MROUTING) { SOCK_RAW, &inetdomain, IPPROTO_IPIP, PR_ATOMIC|PR_ADDR, ip4_input, rip_output, 0, rip_ctloutput, @@ -153,6 +217,7 @@ struct protosw inetsw[] = { 0, 0, 0, 0, ip4_sysctl }, #endif /* MROUTING || IPSEC */ +#endif /*NGIF*/ { SOCK_RAW, &inetdomain, IPPROTO_IGMP, PR_ATOMIC|PR_ADDR, igmp_input, rip_output, 0, rip_ctloutput, rip_usrreq, @@ -204,10 +269,10 @@ struct protosw inetsw[] = { 0, 0, 0, 0, etherip_sysctl }, #endif -#ifdef INET6 +#if 0 /*NRL IPv6*/ /* IPv6 in IPv4 tunneled packets... */ { SOCK_RAW, &inetdomain, IPPROTO_IPV6, PR_ATOMIC|PR_ADDR, - ipv6_input, rip_output, ipv6_trans_ctlinput, rip_ctloutput, + ip6_input, rip_output, ipv6_trans_ctlinput, rip_ctloutput, rip_usrreq, 0, 0, 0, 0 }, |