1*6f52b16cSGreg Kroah-Hartman /* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */ 2607ca46eSDavid Howells #ifndef _IP6_TUNNEL_H 3607ca46eSDavid Howells #define _IP6_TUNNEL_H 4607ca46eSDavid Howells 5607ca46eSDavid Howells #include <linux/types.h> 6557d7acdSDmitry V. Levin #include <linux/if.h> /* For IFNAMSIZ. */ 7557d7acdSDmitry V. Levin #include <linux/in6.h> /* For struct in6_addr. */ 8607ca46eSDavid Howells 9607ca46eSDavid Howells #define IPV6_TLV_TNL_ENCAP_LIMIT 4 10607ca46eSDavid Howells #define IPV6_DEFAULT_TNL_ENCAP_LIMIT 4 11607ca46eSDavid Howells 12607ca46eSDavid Howells /* don't add encapsulation limit if one isn't present in inner packet */ 13607ca46eSDavid Howells #define IP6_TNL_F_IGN_ENCAP_LIMIT 0x1 14607ca46eSDavid Howells /* copy the traffic class field from the inner packet */ 15607ca46eSDavid Howells #define IP6_TNL_F_USE_ORIG_TCLASS 0x2 16607ca46eSDavid Howells /* copy the flowlabel from the inner packet */ 17607ca46eSDavid Howells #define IP6_TNL_F_USE_ORIG_FLOWLABEL 0x4 18607ca46eSDavid Howells /* being used for Mobile IPv6 */ 19607ca46eSDavid Howells #define IP6_TNL_F_MIP6_DEV 0x8 20607ca46eSDavid Howells /* copy DSCP from the outer packet */ 21607ca46eSDavid Howells #define IP6_TNL_F_RCV_DSCP_COPY 0x10 22607ca46eSDavid Howells /* copy fwmark from inner packet */ 23607ca46eSDavid Howells #define IP6_TNL_F_USE_ORIG_FWMARK 0x20 24908d140aSShmulik Ladkani /* allow remote endpoint on the local node */ 25908d140aSShmulik Ladkani #define IP6_TNL_F_ALLOW_LOCAL_REMOTE 0x40 26607ca46eSDavid Howells 27607ca46eSDavid Howells struct ip6_tnl_parm { 28607ca46eSDavid Howells char name[IFNAMSIZ]; /* name of tunnel device */ 29607ca46eSDavid Howells int link; /* ifindex of underlying L2 interface */ 30607ca46eSDavid Howells __u8 proto; /* tunnel protocol */ 31607ca46eSDavid Howells __u8 encap_limit; /* encapsulation limit for tunnel */ 32607ca46eSDavid Howells __u8 hop_limit; /* hop limit for tunnel */ 33607ca46eSDavid Howells __be32 flowinfo; /* traffic class and flowlabel for tunnel */ 34607ca46eSDavid Howells __u32 flags; /* tunnel flags */ 35607ca46eSDavid Howells struct in6_addr laddr; /* local tunnel end-point address */ 36607ca46eSDavid Howells struct in6_addr raddr; /* remote tunnel end-point address */ 37607ca46eSDavid Howells }; 38607ca46eSDavid Howells 39607ca46eSDavid Howells struct ip6_tnl_parm2 { 40607ca46eSDavid Howells char name[IFNAMSIZ]; /* name of tunnel device */ 41607ca46eSDavid Howells int link; /* ifindex of underlying L2 interface */ 42607ca46eSDavid Howells __u8 proto; /* tunnel protocol */ 43607ca46eSDavid Howells __u8 encap_limit; /* encapsulation limit for tunnel */ 44607ca46eSDavid Howells __u8 hop_limit; /* hop limit for tunnel */ 45607ca46eSDavid Howells __be32 flowinfo; /* traffic class and flowlabel for tunnel */ 46607ca46eSDavid Howells __u32 flags; /* tunnel flags */ 47607ca46eSDavid Howells struct in6_addr laddr; /* local tunnel end-point address */ 48607ca46eSDavid Howells struct in6_addr raddr; /* remote tunnel end-point address */ 49607ca46eSDavid Howells 50607ca46eSDavid Howells __be16 i_flags; 51607ca46eSDavid Howells __be16 o_flags; 52607ca46eSDavid Howells __be32 i_key; 53607ca46eSDavid Howells __be32 o_key; 54607ca46eSDavid Howells }; 55607ca46eSDavid Howells 56607ca46eSDavid Howells #endif 57