blob: 0245269b037c809f36a107f83d0a69ffa7fbe1cf [file] [log] [blame]
Greg Kroah-Hartman6f52b162017-11-01 15:08:43 +01001/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
Linus Torvalds1da177e2005-04-16 15:20:36 -07002#ifndef _IP6_TUNNEL_H
3#define _IP6_TUNNEL_H
4
Jaswinder Singh Rajput217a2292009-01-30 21:44:19 +05305#include <linux/types.h>
Dmitry V. Levin557d7ac2017-02-23 01:38:03 +03006#include <linux/if.h> /* For IFNAMSIZ. */
7#include <linux/in6.h> /* For struct in6_addr. */
Jaswinder Singh Rajput217a2292009-01-30 21:44:19 +05308
Linus Torvalds1da177e2005-04-16 15:20:36 -07009#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
Eric Dumazetd24f22f2011-09-20 14:50:00 -040022/* copy fwmark from inner packet */
23#define IP6_TNL_F_USE_ORIG_FWMARK 0x20
Shmulik Ladkani908d1402017-10-21 00:25:15 +030024/* allow remote endpoint on the local node */
25#define IP6_TNL_F_ALLOW_LOCAL_REMOTE 0x40
Linus Torvalds1da177e2005-04-16 15:20:36 -070026
27struct ip6_tnl_parm {
28 char name[IFNAMSIZ]; /* name of tunnel device */
29 int link; /* ifindex of underlying L2 interface */
30 __u8 proto; /* tunnel protocol */
31 __u8 encap_limit; /* encapsulation limit for tunnel */
32 __u8 hop_limit; /* hop limit for tunnel */
Al Viro90bcaf72006-11-08 00:25:17 -080033 __be32 flowinfo; /* traffic class and flowlabel for tunnel */
Linus Torvalds1da177e2005-04-16 15:20:36 -070034 __u32 flags; /* tunnel flags */
35 struct in6_addr laddr; /* local tunnel end-point address */
36 struct in6_addr raddr; /* remote tunnel end-point address */
37};
38
xeb@mail.ruc12b3952012-08-10 00:51:50 +000039struct ip6_tnl_parm2 {
40 char name[IFNAMSIZ]; /* name of tunnel device */
41 int link; /* ifindex of underlying L2 interface */
42 __u8 proto; /* tunnel protocol */
43 __u8 encap_limit; /* encapsulation limit for tunnel */
44 __u8 hop_limit; /* hop limit for tunnel */
45 __be32 flowinfo; /* traffic class and flowlabel for tunnel */
46 __u32 flags; /* tunnel flags */
47 struct in6_addr laddr; /* local tunnel end-point address */
48 struct in6_addr raddr; /* remote tunnel end-point address */
49
50 __be16 i_flags;
51 __be16 o_flags;
52 __be32 i_key;
53 __be32 o_key;
54};
55
Linus Torvalds1da177e2005-04-16 15:20:36 -070056#endif