blob: 5eb9b0f857e0720569eb04373ef42fb51bb04c9a [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>
David S. Miller0afd4a22009-02-02 13:27:44 -08008#endif
Masahide NAKAMURA6fd8bb82007-01-23 22:17:23 -08009
Linus Torvalds1da177e2005-04-16 15:20:36 -070010#define SIOCGETTUNNEL (SIOCDEVPRIVATE + 0)
11#define SIOCADDTUNNEL (SIOCDEVPRIVATE + 1)
12#define SIOCDELTUNNEL (SIOCDEVPRIVATE + 2)
13#define SIOCCHGTUNNEL (SIOCDEVPRIVATE + 3)
YOSHIFUJI Hideaki300aaee2008-03-24 18:28:39 +090014#define SIOCGETPRL (SIOCDEVPRIVATE + 4)
Templin, Fred Lfadf6bf2008-03-11 18:35:59 -040015#define SIOCADDPRL (SIOCDEVPRIVATE + 5)
16#define SIOCDELPRL (SIOCDEVPRIVATE + 6)
17#define SIOCCHGPRL (SIOCDEVPRIVATE + 7)
Linus Torvalds1da177e2005-04-16 15:20:36 -070018
Harvey Harrisonf3a7c662009-02-14 22:58:35 -080019#define GRE_CSUM __cpu_to_be16(0x8000)
20#define GRE_ROUTING __cpu_to_be16(0x4000)
21#define GRE_KEY __cpu_to_be16(0x2000)
22#define GRE_SEQ __cpu_to_be16(0x1000)
23#define GRE_STRICT __cpu_to_be16(0x0800)
24#define GRE_REC __cpu_to_be16(0x0700)
25#define GRE_FLAGS __cpu_to_be16(0x00F8)
26#define GRE_VERSION __cpu_to_be16(0x0007)
Linus Torvalds1da177e2005-04-16 15:20:36 -070027
28struct ip_tunnel_parm
29{
30 char name[IFNAMSIZ];
31 int link;
Al Virod5a0a1e2006-11-08 00:23:14 -080032 __be16 i_flags;
33 __be16 o_flags;
34 __be32 i_key;
35 __be32 o_key;
Linus Torvalds1da177e2005-04-16 15:20:36 -070036 struct iphdr iph;
37};
38
Templin, Fred Lfadf6bf2008-03-11 18:35:59 -040039/* SIT-mode i_flags */
40#define SIT_ISATAP 0x0001
41
42struct ip_tunnel_prl {
43 __be32 addr;
44 __u16 flags;
45 __u16 __reserved;
YOSHIFUJI Hideaki300aaee2008-03-24 18:28:39 +090046 __u32 datalen;
Sascha Hlusiak64506922009-05-19 12:56:52 +000047 __u32 rs_delay;
YOSHIFUJI Hideaki2b4743b2008-06-16 16:48:20 -070048 /* data follows */
Templin, Fred Lfadf6bf2008-03-11 18:35:59 -040049};
50
51/* PRL flags */
52#define PRL_DEFAULT 0x0001
53
Herbert Xuc19e6542008-10-09 11:59:55 -070054enum
55{
56 IFLA_GRE_UNSPEC,
57 IFLA_GRE_LINK,
58 IFLA_GRE_IFLAGS,
59 IFLA_GRE_OFLAGS,
60 IFLA_GRE_IKEY,
61 IFLA_GRE_OKEY,
62 IFLA_GRE_LOCAL,
63 IFLA_GRE_REMOTE,
64 IFLA_GRE_TTL,
65 IFLA_GRE_TOS,
66 IFLA_GRE_PMTUDISC,
67 __IFLA_GRE_MAX,
68};
69
70#define IFLA_GRE_MAX (__IFLA_GRE_MAX - 1)
71
Linus Torvalds1da177e2005-04-16 15:20:36 -070072#endif /* _IF_TUNNEL_H_ */