Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1 | #ifndef _IF_TUNNEL_H_ |
| 2 | #define _IF_TUNNEL_H_ |
| 3 | |
Masahide NAKAMURA | 6fd8bb8 | 2007-01-23 22:17:23 -0800 | [diff] [blame] | 4 | #include <linux/types.h> |
David S. Miller | 0afd4a2 | 2009-02-02 13:27:44 -0800 | [diff] [blame] | 5 | |
| 6 | #ifdef __KERNEL__ |
Herbert Xu | c19e654 | 2008-10-09 11:59:55 -0700 | [diff] [blame] | 7 | #include <linux/ip.h> |
David S. Miller | 0afd4a2 | 2009-02-02 13:27:44 -0800 | [diff] [blame] | 8 | #endif |
Masahide NAKAMURA | 6fd8bb8 | 2007-01-23 22:17:23 -0800 | [diff] [blame] | 9 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 10 | #define SIOCGETTUNNEL (SIOCDEVPRIVATE + 0) |
| 11 | #define SIOCADDTUNNEL (SIOCDEVPRIVATE + 1) |
| 12 | #define SIOCDELTUNNEL (SIOCDEVPRIVATE + 2) |
| 13 | #define SIOCCHGTUNNEL (SIOCDEVPRIVATE + 3) |
YOSHIFUJI Hideaki | 300aaee | 2008-03-24 18:28:39 +0900 | [diff] [blame] | 14 | #define SIOCGETPRL (SIOCDEVPRIVATE + 4) |
Templin, Fred L | fadf6bf | 2008-03-11 18:35:59 -0400 | [diff] [blame] | 15 | #define SIOCADDPRL (SIOCDEVPRIVATE + 5) |
| 16 | #define SIOCDELPRL (SIOCDEVPRIVATE + 6) |
| 17 | #define SIOCCHGPRL (SIOCDEVPRIVATE + 7) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 18 | |
Harvey Harrison | f3a7c66 | 2009-02-14 22:58:35 -0800 | [diff] [blame] | 19 | #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 Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 27 | |
| 28 | struct ip_tunnel_parm |
| 29 | { |
| 30 | char name[IFNAMSIZ]; |
| 31 | int link; |
Al Viro | d5a0a1e | 2006-11-08 00:23:14 -0800 | [diff] [blame] | 32 | __be16 i_flags; |
| 33 | __be16 o_flags; |
| 34 | __be32 i_key; |
| 35 | __be32 o_key; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 36 | struct iphdr iph; |
| 37 | }; |
| 38 | |
Templin, Fred L | fadf6bf | 2008-03-11 18:35:59 -0400 | [diff] [blame] | 39 | /* SIT-mode i_flags */ |
| 40 | #define SIT_ISATAP 0x0001 |
| 41 | |
| 42 | struct ip_tunnel_prl { |
| 43 | __be32 addr; |
| 44 | __u16 flags; |
| 45 | __u16 __reserved; |
YOSHIFUJI Hideaki | 300aaee | 2008-03-24 18:28:39 +0900 | [diff] [blame] | 46 | __u32 datalen; |
Sascha Hlusiak | 6450692 | 2009-05-19 12:56:52 +0000 | [diff] [blame] | 47 | __u32 rs_delay; |
YOSHIFUJI Hideaki | 2b4743b | 2008-06-16 16:48:20 -0700 | [diff] [blame] | 48 | /* data follows */ |
Templin, Fred L | fadf6bf | 2008-03-11 18:35:59 -0400 | [diff] [blame] | 49 | }; |
| 50 | |
| 51 | /* PRL flags */ |
| 52 | #define PRL_DEFAULT 0x0001 |
| 53 | |
Herbert Xu | c19e654 | 2008-10-09 11:59:55 -0700 | [diff] [blame] | 54 | enum |
| 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 Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 72 | #endif /* _IF_TUNNEL_H_ */ |