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