blob: 1822d635be6b461124e659cfaa0861474a25e0bf [file] [log] [blame]
Linus Torvalds1da177e2005-04-16 15:20:36 -07001#ifndef _IF_TUNNEL_H_
2#define _IF_TUNNEL_H_
3
Masahide NAKAMURA6fd8bb82007-01-23 22:17:23 -08004#include <linux/types.h>
David S. Miller0afd4a22009-02-02 13:27:44 -08005
6#ifdef __KERNEL__
Herbert Xuc19e6542008-10-09 11:59:55 -07007#include <linux/ip.h>
Brian Haley125a77e2009-10-07 13:57:10 -07008#include <linux/in6.h>
David S. Miller0afd4a22009-02-02 13:27:44 -08009#endif
Masahide NAKAMURA6fd8bb82007-01-23 22:17:23 -080010
Linus Torvalds1da177e2005-04-16 15:20:36 -070011#define SIOCGETTUNNEL (SIOCDEVPRIVATE + 0)
12#define SIOCADDTUNNEL (SIOCDEVPRIVATE + 1)
13#define SIOCDELTUNNEL (SIOCDEVPRIVATE + 2)
14#define SIOCCHGTUNNEL (SIOCDEVPRIVATE + 3)
YOSHIFUJI Hideaki300aaee2008-03-24 18:28:39 +090015#define SIOCGETPRL (SIOCDEVPRIVATE + 4)
Templin, Fred Lfadf6bf2008-03-11 18:35:59 -040016#define SIOCADDPRL (SIOCDEVPRIVATE + 5)
17#define SIOCDELPRL (SIOCDEVPRIVATE + 6)
18#define SIOCCHGPRL (SIOCDEVPRIVATE + 7)
YOSHIFUJI Hideaki / 吉藤英明fa857af2009-09-22 23:43:14 +000019#define SIOCGET6RD (SIOCDEVPRIVATE + 8)
20#define SIOCADD6RD (SIOCDEVPRIVATE + 9)
21#define SIOCDEL6RD (SIOCDEVPRIVATE + 10)
22#define SIOCCHG6RD (SIOCDEVPRIVATE + 11)
Linus Torvalds1da177e2005-04-16 15:20:36 -070023
Harvey Harrisonf3a7c662009-02-14 22:58:35 -080024#define GRE_CSUM __cpu_to_be16(0x8000)
25#define GRE_ROUTING __cpu_to_be16(0x4000)
26#define GRE_KEY __cpu_to_be16(0x2000)
27#define GRE_SEQ __cpu_to_be16(0x1000)
28#define GRE_STRICT __cpu_to_be16(0x0800)
29#define GRE_REC __cpu_to_be16(0x0700)
30#define GRE_FLAGS __cpu_to_be16(0x00F8)
31#define GRE_VERSION __cpu_to_be16(0x0007)
Linus Torvalds1da177e2005-04-16 15:20:36 -070032
Eric Dumazetd94d9fe2009-11-04 09:50:58 -080033struct ip_tunnel_parm {
Linus Torvalds1da177e2005-04-16 15:20:36 -070034 char name[IFNAMSIZ];
35 int link;
Al Virod5a0a1e2006-11-08 00:23:14 -080036 __be16 i_flags;
37 __be16 o_flags;
38 __be32 i_key;
39 __be32 o_key;
Linus Torvalds1da177e2005-04-16 15:20:36 -070040 struct iphdr iph;
41};
42
Templin, Fred Lfadf6bf2008-03-11 18:35:59 -040043/* SIT-mode i_flags */
44#define SIT_ISATAP 0x0001
45
46struct ip_tunnel_prl {
47 __be32 addr;
48 __u16 flags;
49 __u16 __reserved;
YOSHIFUJI Hideaki300aaee2008-03-24 18:28:39 +090050 __u32 datalen;
Sascha Hlusiakd1f82972009-09-26 20:28:07 -070051 __u32 __reserved2;
YOSHIFUJI Hideaki2b4743b2008-06-16 16:48:20 -070052 /* data follows */
Templin, Fred Lfadf6bf2008-03-11 18:35:59 -040053};
54
55/* PRL flags */
56#define PRL_DEFAULT 0x0001
57
YOSHIFUJI Hideaki / 吉藤英明fa857af2009-09-22 23:43:14 +000058struct ip_tunnel_6rd {
59 struct in6_addr prefix;
60 __be32 relay_prefix;
61 __u16 prefixlen;
62 __u16 relay_prefixlen;
63};
64
Eric Dumazetd94d9fe2009-11-04 09:50:58 -080065enum {
Herbert Xuc19e6542008-10-09 11:59:55 -070066 IFLA_GRE_UNSPEC,
67 IFLA_GRE_LINK,
68 IFLA_GRE_IFLAGS,
69 IFLA_GRE_OFLAGS,
70 IFLA_GRE_IKEY,
71 IFLA_GRE_OKEY,
72 IFLA_GRE_LOCAL,
73 IFLA_GRE_REMOTE,
74 IFLA_GRE_TTL,
75 IFLA_GRE_TOS,
76 IFLA_GRE_PMTUDISC,
77 __IFLA_GRE_MAX,
78};
79
80#define IFLA_GRE_MAX (__IFLA_GRE_MAX - 1)
81
Linus Torvalds1da177e2005-04-16 15:20:36 -070082#endif /* _IF_TUNNEL_H_ */