File tree Expand file tree Collapse file tree 9 files changed +1372
-2
lines changed Expand file tree Collapse file tree 9 files changed +1372
-2
lines changed Original file line number Diff line number Diff line change 60
60
#define ARPHRD_RAWHDLC 518 /* Raw HDLC */
61
61
62
62
#define ARPHRD_TUNNEL 768 /* IPIP tunnel */
63
- #define ARPHRD_TUNNEL6 769 /* IPIP6 tunnel */
63
+ #define ARPHRD_TUNNEL6 769 /* IP6IP6 tunnel */
64
64
#define ARPHRD_FRAD 770 /* Frame Relay Access Device */
65
65
#define ARPHRD_SKIP 771 /* SKIP vif */
66
66
#define ARPHRD_LOOPBACK 772 /* Loopback device */
Original file line number Diff line number Diff line change
1
+ /*
2
+ * $Id$
3
+ */
4
+
5
+ #ifndef _IP6_TUNNEL_H
6
+ #define _IP6_TUNNEL_H
7
+
8
+ #define IPV6_TLV_TNL_ENCAP_LIMIT 4
9
+ #define IPV6_DEFAULT_TNL_ENCAP_LIMIT 4
10
+
11
+ /* don't add encapsulation limit if one isn't present in inner packet */
12
+ #define IP6_TNL_F_IGN_ENCAP_LIMIT 0x1
13
+ /* copy the traffic class field from the inner packet */
14
+ #define IP6_TNL_F_USE_ORIG_TCLASS 0x2
15
+ /* copy the flowlabel from the inner packet */
16
+ #define IP6_TNL_F_USE_ORIG_FLOWLABEL 0x4
17
+ /* being used for Mobile IPv6 */
18
+ #define IP6_TNL_F_MIP6_DEV 0x8
19
+
20
+ struct ip6_tnl_parm {
21
+ char name [IFNAMSIZ ]; /* name of tunnel device */
22
+ int link ; /* ifindex of underlying L2 interface */
23
+ __u8 proto ; /* tunnel protocol */
24
+ __u8 encap_limit ; /* encapsulation limit for tunnel */
25
+ __u8 hop_limit ; /* hop limit for tunnel */
26
+ __u32 flowinfo ; /* traffic class and flowlabel for tunnel */
27
+ __u32 flags ; /* tunnel flags */
28
+ struct in6_addr laddr ; /* local tunnel end-point address */
29
+ struct in6_addr raddr ; /* remote tunnel end-point address */
30
+ };
31
+
32
+ #endif
Original file line number Diff line number Diff line change
1
+ /*
2
+ * $Id$
3
+ */
4
+
5
+ #ifndef _NET_IP6_TUNNEL_H
6
+ #define _NET_IP6_TUNNEL_H
7
+
8
+ #include <linux/ipv6.h>
9
+ #include <linux/netdevice.h>
10
+ #include <linux/ip6_tunnel.h>
11
+
12
+ /* capable of sending packets */
13
+ #define IP6_TNL_F_CAP_XMIT 0x10000
14
+ /* capable of receiving packets */
15
+ #define IP6_TNL_F_CAP_RCV 0x20000
16
+
17
+ #define IP6_TNL_MAX 128
18
+
19
+ /* IPv6 tunnel */
20
+
21
+ struct ip6_tnl {
22
+ struct ip6_tnl * next ; /* next tunnel in list */
23
+ struct net_device * dev ; /* virtual device associated with tunnel */
24
+ struct net_device_stats stat ; /* statistics for tunnel device */
25
+ int recursion ; /* depth of hard_start_xmit recursion */
26
+ struct ip6_tnl_parm parms ; /* tunnel configuration paramters */
27
+ struct flowi fl ; /* flowi template for xmit */
28
+ };
29
+
30
+ /* Tunnel encapsulation limit destination sub-option */
31
+
32
+ struct ipv6_tlv_tnl_enc_lim {
33
+ __u8 type ; /* type-code for option */
34
+ __u8 length ; /* option length */
35
+ __u8 encap_limit ; /* tunnel encapsulation limit */
36
+ } __attribute__ ((packed ));
37
+
38
+ #ifdef __KERNEL__
39
+ #ifdef CONFIG_IPV6_TUNNEL
40
+ extern int __init ip6_tunnel_init (void );
41
+ extern void ip6_tunnel_cleanup (void );
42
+ #endif
43
+ #endif
44
+ #endif
Original file line number Diff line number Diff line change @@ -55,4 +55,12 @@ config INET6_IPCOMP
55
55
56
56
If unsure, say Y.
57
57
58
+ config IPV6_TUNNEL
59
+ tristate "IPv6: IPv6-in-IPv6 tunnel"
60
+ depends on IPV6
61
+ ---help---
62
+ Support for IPv6-in-IPv6 tunnels described in RFC 2473.
63
+
64
+ If unsure, say N.
65
+
58
66
source "net/ipv6/netfilter/Kconfig"
Original file line number Diff line number Diff line change @@ -15,3 +15,5 @@ obj-$(CONFIG_INET6_AH) += ah6.o
15
15
obj-$(CONFIG_INET6_ESP) += esp6.o
16
16
obj-$(CONFIG_INET6_IPCOMP) += ipcomp6.o
17
17
obj-$(CONFIG_NETFILTER) += netfilter/
18
+
19
+ obj-$(CONFIG_IPV6_TUNNEL) += ip6_tunnel.o
Original file line number Diff line number Diff line change 57
57
#include <net/transp_v6.h>
58
58
#include <net/ip6_route.h>
59
59
#include <net/addrconf.h>
60
+ #if CONFIG_IPV6_TUNNEL
61
+ #include <net/ip6_tunnel.h>
62
+ #endif
60
63
61
64
#include <asm/uaccess.h>
62
65
#include <asm/system.h>
@@ -776,6 +779,11 @@ static int __init inet6_init(void)
776
779
err = ndisc_init (& inet6_family_ops );
777
780
if (err )
778
781
goto ndisc_fail ;
782
+ #ifdef CONFIG_IPV6_TUNNEL
783
+ err = ip6_tunnel_init ();
784
+ if (err )
785
+ goto ip6_tunnel_fail ;
786
+ #endif
779
787
err = igmp6_init (& inet6_family_ops );
780
788
if (err )
781
789
goto igmp_fail ;
@@ -830,6 +838,10 @@ static int __init inet6_init(void)
830
838
igmp6_cleanup ();
831
839
#endif
832
840
igmp_fail :
841
+ #ifdef CONFIG_IPV6_TUNNEL
842
+ ip6_tunnel_cleanup ();
843
+ ip6_tunnel_fail :
844
+ #endif
833
845
ndisc_cleanup ();
834
846
ndisc_fail :
835
847
icmpv6_cleanup ();
@@ -865,6 +877,9 @@ static void inet6_exit(void)
865
877
ip6_route_cleanup ();
866
878
ipv6_packet_cleanup ();
867
879
igmp6_cleanup ();
880
+ #ifdef CONFIG_IPV6_TUNNEL
881
+ ip6_tunnel_cleanup ();
882
+ #endif
868
883
ndisc_cleanup ();
869
884
icmpv6_cleanup ();
870
885
#ifdef CONFIG_SYSCTL
You can’t perform that action at this time.
0 commit comments