130692c65c4174412c90e79489e98ab85c1a7412fBen Cheng#ifndef _IP6_TUNNEL_H
230692c65c4174412c90e79489e98ab85c1a7412fBen Cheng#define _IP6_TUNNEL_H
330692c65c4174412c90e79489e98ab85c1a7412fBen Cheng
430692c65c4174412c90e79489e98ab85c1a7412fBen Cheng#include <linux/types.h>
530692c65c4174412c90e79489e98ab85c1a7412fBen Cheng
630692c65c4174412c90e79489e98ab85c1a7412fBen Cheng#define IPV6_TLV_TNL_ENCAP_LIMIT 4
730692c65c4174412c90e79489e98ab85c1a7412fBen Cheng#define IPV6_DEFAULT_TNL_ENCAP_LIMIT 4
830692c65c4174412c90e79489e98ab85c1a7412fBen Cheng
930692c65c4174412c90e79489e98ab85c1a7412fBen Cheng/* don't add encapsulation limit if one isn't present in inner packet */
1030692c65c4174412c90e79489e98ab85c1a7412fBen Cheng#define IP6_TNL_F_IGN_ENCAP_LIMIT 0x1
1130692c65c4174412c90e79489e98ab85c1a7412fBen Cheng/* copy the traffic class field from the inner packet */
1230692c65c4174412c90e79489e98ab85c1a7412fBen Cheng#define IP6_TNL_F_USE_ORIG_TCLASS 0x2
1330692c65c4174412c90e79489e98ab85c1a7412fBen Cheng/* copy the flowlabel from the inner packet */
1430692c65c4174412c90e79489e98ab85c1a7412fBen Cheng#define IP6_TNL_F_USE_ORIG_FLOWLABEL 0x4
1530692c65c4174412c90e79489e98ab85c1a7412fBen Cheng/* being used for Mobile IPv6 */
1630692c65c4174412c90e79489e98ab85c1a7412fBen Cheng#define IP6_TNL_F_MIP6_DEV 0x8
1730692c65c4174412c90e79489e98ab85c1a7412fBen Cheng/* copy DSCP from the outer packet */
1830692c65c4174412c90e79489e98ab85c1a7412fBen Cheng#define IP6_TNL_F_RCV_DSCP_COPY 0x10
1930692c65c4174412c90e79489e98ab85c1a7412fBen Cheng/* copy fwmark from inner packet */
2030692c65c4174412c90e79489e98ab85c1a7412fBen Cheng#define IP6_TNL_F_USE_ORIG_FWMARK 0x20
2130692c65c4174412c90e79489e98ab85c1a7412fBen Cheng
2230692c65c4174412c90e79489e98ab85c1a7412fBen Chengstruct ip6_tnl_parm {
2330692c65c4174412c90e79489e98ab85c1a7412fBen Cheng	char name[IFNAMSIZ];	/* name of tunnel device */
2430692c65c4174412c90e79489e98ab85c1a7412fBen Cheng	int link;		/* ifindex of underlying L2 interface */
2530692c65c4174412c90e79489e98ab85c1a7412fBen Cheng	__u8 proto;		/* tunnel protocol */
2630692c65c4174412c90e79489e98ab85c1a7412fBen Cheng	__u8 encap_limit;	/* encapsulation limit for tunnel */
2730692c65c4174412c90e79489e98ab85c1a7412fBen Cheng	__u8 hop_limit;		/* hop limit for tunnel */
2830692c65c4174412c90e79489e98ab85c1a7412fBen Cheng	__be32 flowinfo;	/* traffic class and flowlabel for tunnel */
2930692c65c4174412c90e79489e98ab85c1a7412fBen Cheng	__u32 flags;		/* tunnel flags */
3030692c65c4174412c90e79489e98ab85c1a7412fBen Cheng	struct in6_addr laddr;	/* local tunnel end-point address */
3130692c65c4174412c90e79489e98ab85c1a7412fBen Cheng	struct in6_addr raddr;	/* remote tunnel end-point address */
3230692c65c4174412c90e79489e98ab85c1a7412fBen Cheng};
3330692c65c4174412c90e79489e98ab85c1a7412fBen Cheng
3430692c65c4174412c90e79489e98ab85c1a7412fBen Chengstruct ip6_tnl_parm2 {
3530692c65c4174412c90e79489e98ab85c1a7412fBen Cheng	char name[IFNAMSIZ];	/* name of tunnel device */
3630692c65c4174412c90e79489e98ab85c1a7412fBen Cheng	int link;		/* ifindex of underlying L2 interface */
3730692c65c4174412c90e79489e98ab85c1a7412fBen Cheng	__u8 proto;		/* tunnel protocol */
3830692c65c4174412c90e79489e98ab85c1a7412fBen Cheng	__u8 encap_limit;	/* encapsulation limit for tunnel */
3930692c65c4174412c90e79489e98ab85c1a7412fBen Cheng	__u8 hop_limit;		/* hop limit for tunnel */
4030692c65c4174412c90e79489e98ab85c1a7412fBen Cheng	__be32 flowinfo;	/* traffic class and flowlabel for tunnel */
4130692c65c4174412c90e79489e98ab85c1a7412fBen Cheng	__u32 flags;		/* tunnel flags */
4230692c65c4174412c90e79489e98ab85c1a7412fBen Cheng	struct in6_addr laddr;	/* local tunnel end-point address */
4330692c65c4174412c90e79489e98ab85c1a7412fBen Cheng	struct in6_addr raddr;	/* remote tunnel end-point address */
4430692c65c4174412c90e79489e98ab85c1a7412fBen Cheng
4530692c65c4174412c90e79489e98ab85c1a7412fBen Cheng	__be16			i_flags;
4630692c65c4174412c90e79489e98ab85c1a7412fBen Cheng	__be16			o_flags;
4730692c65c4174412c90e79489e98ab85c1a7412fBen Cheng	__be32			i_key;
4830692c65c4174412c90e79489e98ab85c1a7412fBen Cheng	__be32			o_key;
4930692c65c4174412c90e79489e98ab85c1a7412fBen Cheng};
5030692c65c4174412c90e79489e98ab85c1a7412fBen Cheng
5130692c65c4174412c90e79489e98ab85c1a7412fBen Cheng#endif
52