blob: 16b92d008bed842e141f77664e94446cbe652dcf [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>
Paulius Zaleckas9bf35c82010-03-21 21:19:02 -07005#include <asm/byteorder.h>
David S. Miller0afd4a22009-02-02 13:27:44 -08006
7#ifdef __KERNEL__
Herbert Xuc19e6542008-10-09 11:59:55 -07008#include <linux/ip.h>
Brian Haley125a77e2009-10-07 13:57:10 -07009#include <linux/in6.h>
David S. Miller0afd4a22009-02-02 13:27:44 -080010#endif
Masahide NAKAMURA6fd8bb82007-01-23 22:17:23 -080011
Linus Torvalds1da177e2005-04-16 15:20:36 -070012#define SIOCGETTUNNEL (SIOCDEVPRIVATE + 0)
13#define SIOCADDTUNNEL (SIOCDEVPRIVATE + 1)
14#define SIOCDELTUNNEL (SIOCDEVPRIVATE + 2)
15#define SIOCCHGTUNNEL (SIOCDEVPRIVATE + 3)
YOSHIFUJI Hideaki300aaee2008-03-24 18:28:39 +090016#define SIOCGETPRL (SIOCDEVPRIVATE + 4)
Templin, Fred Lfadf6bf2008-03-11 18:35:59 -040017#define SIOCADDPRL (SIOCDEVPRIVATE + 5)
18#define SIOCDELPRL (SIOCDEVPRIVATE + 6)
19#define SIOCCHGPRL (SIOCDEVPRIVATE + 7)
YOSHIFUJI Hideaki / 吉藤英明fa857af2009-09-22 23:43:14 +000020#define SIOCGET6RD (SIOCDEVPRIVATE + 8)
21#define SIOCADD6RD (SIOCDEVPRIVATE + 9)
22#define SIOCDEL6RD (SIOCDEVPRIVATE + 10)
23#define SIOCCHG6RD (SIOCDEVPRIVATE + 11)
Linus Torvalds1da177e2005-04-16 15:20:36 -070024
Harvey Harrisonf3a7c662009-02-14 22:58:35 -080025#define GRE_CSUM __cpu_to_be16(0x8000)
26#define GRE_ROUTING __cpu_to_be16(0x4000)
27#define GRE_KEY __cpu_to_be16(0x2000)
28#define GRE_SEQ __cpu_to_be16(0x1000)
29#define GRE_STRICT __cpu_to_be16(0x0800)
30#define GRE_REC __cpu_to_be16(0x0700)
31#define GRE_FLAGS __cpu_to_be16(0x00F8)
32#define GRE_VERSION __cpu_to_be16(0x0007)
Linus Torvalds1da177e2005-04-16 15:20:36 -070033
Eric Dumazetd94d9fe2009-11-04 09:50:58 -080034struct ip_tunnel_parm {
Linus Torvalds1da177e2005-04-16 15:20:36 -070035 char name[IFNAMSIZ];
36 int link;
Al Virod5a0a1e2006-11-08 00:23:14 -080037 __be16 i_flags;
38 __be16 o_flags;
39 __be32 i_key;
40 __be32 o_key;
Linus Torvalds1da177e2005-04-16 15:20:36 -070041 struct iphdr iph;
42};
43
Templin, Fred Lfadf6bf2008-03-11 18:35:59 -040044/* SIT-mode i_flags */
45#define SIT_ISATAP 0x0001
46
47struct ip_tunnel_prl {
48 __be32 addr;
49 __u16 flags;
50 __u16 __reserved;
YOSHIFUJI Hideaki300aaee2008-03-24 18:28:39 +090051 __u32 datalen;
Sascha Hlusiakd1f82972009-09-26 20:28:07 -070052 __u32 __reserved2;
YOSHIFUJI Hideaki2b4743b2008-06-16 16:48:20 -070053 /* data follows */
Templin, Fred Lfadf6bf2008-03-11 18:35:59 -040054};
55
56/* PRL flags */
57#define PRL_DEFAULT 0x0001
58
YOSHIFUJI Hideaki / 吉藤英明fa857af2009-09-22 23:43:14 +000059struct ip_tunnel_6rd {
60 struct in6_addr prefix;
61 __be32 relay_prefix;
62 __u16 prefixlen;
63 __u16 relay_prefixlen;
64};
65
Eric Dumazetd94d9fe2009-11-04 09:50:58 -080066enum {
Herbert Xuc19e6542008-10-09 11:59:55 -070067 IFLA_GRE_UNSPEC,
68 IFLA_GRE_LINK,
69 IFLA_GRE_IFLAGS,
70 IFLA_GRE_OFLAGS,
71 IFLA_GRE_IKEY,
72 IFLA_GRE_OKEY,
73 IFLA_GRE_LOCAL,
74 IFLA_GRE_REMOTE,
75 IFLA_GRE_TTL,
76 IFLA_GRE_TOS,
77 IFLA_GRE_PMTUDISC,
78 __IFLA_GRE_MAX,
79};
80
81#define IFLA_GRE_MAX (__IFLA_GRE_MAX - 1)
82
Linus Torvalds1da177e2005-04-16 15:20:36 -070083#endif /* _IF_TUNNEL_H_ */