Commit 1df64a85 authored by Ville Nuorvala's avatar Ville Nuorvala Committed by Hideaki Yoshifuji

[IPV6]: Add ip6ip6 tunnel driver.

parent 5b29b6f3
...@@ -60,7 +60,7 @@ ...@@ -60,7 +60,7 @@
#define ARPHRD_RAWHDLC 518 /* Raw HDLC */ #define ARPHRD_RAWHDLC 518 /* Raw HDLC */
#define ARPHRD_TUNNEL 768 /* IPIP tunnel */ #define ARPHRD_TUNNEL 768 /* IPIP tunnel */
#define ARPHRD_TUNNEL6 769 /* IPIP6 tunnel */ #define ARPHRD_TUNNEL6 769 /* IP6IP6 tunnel */
#define ARPHRD_FRAD 770 /* Frame Relay Access Device */ #define ARPHRD_FRAD 770 /* Frame Relay Access Device */
#define ARPHRD_SKIP 771 /* SKIP vif */ #define ARPHRD_SKIP 771 /* SKIP vif */
#define ARPHRD_LOOPBACK 772 /* Loopback device */ #define ARPHRD_LOOPBACK 772 /* Loopback device */
......
/*
* $Id$
*/
#ifndef _IP6_TUNNEL_H
#define _IP6_TUNNEL_H
#define IPV6_TLV_TNL_ENCAP_LIMIT 4
#define IPV6_DEFAULT_TNL_ENCAP_LIMIT 4
/* don't add encapsulation limit if one isn't present in inner packet */
#define IP6_TNL_F_IGN_ENCAP_LIMIT 0x1
/* copy the traffic class field from the inner packet */
#define IP6_TNL_F_USE_ORIG_TCLASS 0x2
/* copy the flowlabel from the inner packet */
#define IP6_TNL_F_USE_ORIG_FLOWLABEL 0x4
/* being used for Mobile IPv6 */
#define IP6_TNL_F_MIP6_DEV 0x8
struct ip6_tnl_parm {
char name[IFNAMSIZ]; /* name of tunnel device */
int link; /* ifindex of underlying L2 interface */
__u8 proto; /* tunnel protocol */
__u8 encap_limit; /* encapsulation limit for tunnel */
__u8 hop_limit; /* hop limit for tunnel */
__u32 flowinfo; /* traffic class and flowlabel for tunnel */
__u32 flags; /* tunnel flags */
struct in6_addr laddr; /* local tunnel end-point address */
struct in6_addr raddr; /* remote tunnel end-point address */
};
#endif
/*
* $Id$
*/
#ifndef _NET_IP6_TUNNEL_H
#define _NET_IP6_TUNNEL_H
#include <linux/ipv6.h>
#include <linux/netdevice.h>
#include <linux/ip6_tunnel.h>
/* capable of sending packets */
#define IP6_TNL_F_CAP_XMIT 0x10000
/* capable of receiving packets */
#define IP6_TNL_F_CAP_RCV 0x20000
#define IP6_TNL_MAX 128
/* IPv6 tunnel */
struct ip6_tnl {
struct ip6_tnl *next; /* next tunnel in list */
struct net_device *dev; /* virtual device associated with tunnel */
struct net_device_stats stat; /* statistics for tunnel device */
int recursion; /* depth of hard_start_xmit recursion */
struct ip6_tnl_parm parms; /* tunnel configuration paramters */
struct flowi fl; /* flowi template for xmit */
};
/* Tunnel encapsulation limit destination sub-option */
struct ipv6_tlv_tnl_enc_lim {
__u8 type; /* type-code for option */
__u8 length; /* option length */
__u8 encap_limit; /* tunnel encapsulation limit */
} __attribute__ ((packed));
#ifdef __KERNEL__
#ifdef CONFIG_IPV6_TUNNEL
extern int __init ip6_tunnel_init(void);
extern void ip6_tunnel_cleanup(void);
#endif
#endif
#endif
...@@ -55,4 +55,12 @@ config INET6_IPCOMP ...@@ -55,4 +55,12 @@ config INET6_IPCOMP
If unsure, say Y. If unsure, say Y.
config IPV6_TUNNEL
tristate "IPv6: IPv6-in-IPv6 tunnel"
depends on IPV6
---help---
Support for IPv6-in-IPv6 tunnels described in RFC 2473.
If unsure, say N.
source "net/ipv6/netfilter/Kconfig" source "net/ipv6/netfilter/Kconfig"
...@@ -15,3 +15,5 @@ obj-$(CONFIG_INET6_AH) += ah6.o ...@@ -15,3 +15,5 @@ obj-$(CONFIG_INET6_AH) += ah6.o
obj-$(CONFIG_INET6_ESP) += esp6.o obj-$(CONFIG_INET6_ESP) += esp6.o
obj-$(CONFIG_INET6_IPCOMP) += ipcomp6.o obj-$(CONFIG_INET6_IPCOMP) += ipcomp6.o
obj-$(CONFIG_NETFILTER) += netfilter/ obj-$(CONFIG_NETFILTER) += netfilter/
obj-$(CONFIG_IPV6_TUNNEL) += ip6_tunnel.o
...@@ -57,6 +57,9 @@ ...@@ -57,6 +57,9 @@
#include <net/transp_v6.h> #include <net/transp_v6.h>
#include <net/ip6_route.h> #include <net/ip6_route.h>
#include <net/addrconf.h> #include <net/addrconf.h>
#if CONFIG_IPV6_TUNNEL
#include <net/ip6_tunnel.h>
#endif
#include <asm/uaccess.h> #include <asm/uaccess.h>
#include <asm/system.h> #include <asm/system.h>
...@@ -776,6 +779,11 @@ static int __init inet6_init(void) ...@@ -776,6 +779,11 @@ static int __init inet6_init(void)
err = ndisc_init(&inet6_family_ops); err = ndisc_init(&inet6_family_ops);
if (err) if (err)
goto ndisc_fail; goto ndisc_fail;
#ifdef CONFIG_IPV6_TUNNEL
err = ip6_tunnel_init();
if (err)
goto ip6_tunnel_fail;
#endif
err = igmp6_init(&inet6_family_ops); err = igmp6_init(&inet6_family_ops);
if (err) if (err)
goto igmp_fail; goto igmp_fail;
...@@ -830,6 +838,10 @@ static int __init inet6_init(void) ...@@ -830,6 +838,10 @@ static int __init inet6_init(void)
igmp6_cleanup(); igmp6_cleanup();
#endif #endif
igmp_fail: igmp_fail:
#ifdef CONFIG_IPV6_TUNNEL
ip6_tunnel_cleanup();
ip6_tunnel_fail:
#endif
ndisc_cleanup(); ndisc_cleanup();
ndisc_fail: ndisc_fail:
icmpv6_cleanup(); icmpv6_cleanup();
...@@ -865,6 +877,9 @@ static void inet6_exit(void) ...@@ -865,6 +877,9 @@ static void inet6_exit(void)
ip6_route_cleanup(); ip6_route_cleanup();
ipv6_packet_cleanup(); ipv6_packet_cleanup();
igmp6_cleanup(); igmp6_cleanup();
#ifdef CONFIG_IPV6_TUNNEL
ip6_tunnel_cleanup();
#endif
ndisc_cleanup(); ndisc_cleanup();
icmpv6_cleanup(); icmpv6_cleanup();
#ifdef CONFIG_SYSCTL #ifdef CONFIG_SYSCTL
......
This diff is collapsed.
...@@ -38,3 +38,9 @@ EXPORT_SYMBOL(in6_dev_finish_destroy); ...@@ -38,3 +38,9 @@ EXPORT_SYMBOL(in6_dev_finish_destroy);
EXPORT_SYMBOL(ip6_find_1stfragopt); EXPORT_SYMBOL(ip6_find_1stfragopt);
EXPORT_SYMBOL(xfrm6_rcv); EXPORT_SYMBOL(xfrm6_rcv);
EXPORT_SYMBOL(xfrm6_clear_mutable_options); EXPORT_SYMBOL(xfrm6_clear_mutable_options);
EXPORT_SYMBOL(rt6_lookup);
EXPORT_SYMBOL(fl6_sock_lookup);
EXPORT_SYMBOL(ipv6_ext_hdr);
EXPORT_SYMBOL(ip6_append_data);
EXPORT_SYMBOL(ip6_flush_pending_frames);
EXPORT_SYMBOL(ip6_push_pending_frames);
...@@ -477,8 +477,10 @@ EXPORT_SYMBOL(sysctl_tcp_tw_recycle); ...@@ -477,8 +477,10 @@ EXPORT_SYMBOL(sysctl_tcp_tw_recycle);
EXPORT_SYMBOL(sysctl_max_syn_backlog); EXPORT_SYMBOL(sysctl_max_syn_backlog);
#endif #endif
EXPORT_SYMBOL(ip_generic_getfrag); #endif
#if defined (CONFIG_IPV6_MODULE) || defined (CONFIG_IP_SCTP_MODULE) || defined (CONFIG_IPV6_TUNNEL_MODULE)
EXPORT_SYMBOL(ip_generic_getfrag);
#endif #endif
EXPORT_SYMBOL(tcp_read_sock); EXPORT_SYMBOL(tcp_read_sock);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment