1*4882a593Smuzhiyun /* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */ 2*4882a593Smuzhiyun #ifndef _IP6_TUNNEL_H 3*4882a593Smuzhiyun #define _IP6_TUNNEL_H 4*4882a593Smuzhiyun 5*4882a593Smuzhiyun #include <linux/types.h> 6*4882a593Smuzhiyun #include <linux/if.h> /* For IFNAMSIZ. */ 7*4882a593Smuzhiyun #include <linux/in6.h> /* For struct in6_addr. */ 8*4882a593Smuzhiyun 9*4882a593Smuzhiyun #define IPV6_TLV_TNL_ENCAP_LIMIT 4 10*4882a593Smuzhiyun #define IPV6_DEFAULT_TNL_ENCAP_LIMIT 4 11*4882a593Smuzhiyun 12*4882a593Smuzhiyun /* don't add encapsulation limit if one isn't present in inner packet */ 13*4882a593Smuzhiyun #define IP6_TNL_F_IGN_ENCAP_LIMIT 0x1 14*4882a593Smuzhiyun /* copy the traffic class field from the inner packet */ 15*4882a593Smuzhiyun #define IP6_TNL_F_USE_ORIG_TCLASS 0x2 16*4882a593Smuzhiyun /* copy the flowlabel from the inner packet */ 17*4882a593Smuzhiyun #define IP6_TNL_F_USE_ORIG_FLOWLABEL 0x4 18*4882a593Smuzhiyun /* being used for Mobile IPv6 */ 19*4882a593Smuzhiyun #define IP6_TNL_F_MIP6_DEV 0x8 20*4882a593Smuzhiyun /* copy DSCP from the outer packet */ 21*4882a593Smuzhiyun #define IP6_TNL_F_RCV_DSCP_COPY 0x10 22*4882a593Smuzhiyun /* copy fwmark from inner packet */ 23*4882a593Smuzhiyun #define IP6_TNL_F_USE_ORIG_FWMARK 0x20 24*4882a593Smuzhiyun /* allow remote endpoint on the local node */ 25*4882a593Smuzhiyun #define IP6_TNL_F_ALLOW_LOCAL_REMOTE 0x40 26*4882a593Smuzhiyun 27*4882a593Smuzhiyun struct ip6_tnl_parm { 28*4882a593Smuzhiyun char name[IFNAMSIZ]; /* name of tunnel device */ 29*4882a593Smuzhiyun int link; /* ifindex of underlying L2 interface */ 30*4882a593Smuzhiyun __u8 proto; /* tunnel protocol */ 31*4882a593Smuzhiyun __u8 encap_limit; /* encapsulation limit for tunnel */ 32*4882a593Smuzhiyun __u8 hop_limit; /* hop limit for tunnel */ 33*4882a593Smuzhiyun __be32 flowinfo; /* traffic class and flowlabel for tunnel */ 34*4882a593Smuzhiyun __u32 flags; /* tunnel flags */ 35*4882a593Smuzhiyun struct in6_addr laddr; /* local tunnel end-point address */ 36*4882a593Smuzhiyun struct in6_addr raddr; /* remote tunnel end-point address */ 37*4882a593Smuzhiyun }; 38*4882a593Smuzhiyun 39*4882a593Smuzhiyun struct ip6_tnl_parm2 { 40*4882a593Smuzhiyun char name[IFNAMSIZ]; /* name of tunnel device */ 41*4882a593Smuzhiyun int link; /* ifindex of underlying L2 interface */ 42*4882a593Smuzhiyun __u8 proto; /* tunnel protocol */ 43*4882a593Smuzhiyun __u8 encap_limit; /* encapsulation limit for tunnel */ 44*4882a593Smuzhiyun __u8 hop_limit; /* hop limit for tunnel */ 45*4882a593Smuzhiyun __be32 flowinfo; /* traffic class and flowlabel for tunnel */ 46*4882a593Smuzhiyun __u32 flags; /* tunnel flags */ 47*4882a593Smuzhiyun struct in6_addr laddr; /* local tunnel end-point address */ 48*4882a593Smuzhiyun struct in6_addr raddr; /* remote tunnel end-point address */ 49*4882a593Smuzhiyun 50*4882a593Smuzhiyun __be16 i_flags; 51*4882a593Smuzhiyun __be16 o_flags; 52*4882a593Smuzhiyun __be32 i_key; 53*4882a593Smuzhiyun __be32 o_key; 54*4882a593Smuzhiyun }; 55*4882a593Smuzhiyun 56*4882a593Smuzhiyun #endif 57