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> |
Brian Haley | 125a77e | 2009-10-07 13:57:10 -0700 | [diff] [blame] | 8 | #include <linux/in6.h> |
David S. Miller | 0afd4a2 | 2009-02-02 13:27:44 -0800 | [diff] [blame] | 9 | #endif |
Masahide NAKAMURA | 6fd8bb8 | 2007-01-23 22:17:23 -0800 | [diff] [blame] | 10 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 11 | #define SIOCGETTUNNEL (SIOCDEVPRIVATE + 0) |
| 12 | #define SIOCADDTUNNEL (SIOCDEVPRIVATE + 1) |
| 13 | #define SIOCDELTUNNEL (SIOCDEVPRIVATE + 2) |
| 14 | #define SIOCCHGTUNNEL (SIOCDEVPRIVATE + 3) |
YOSHIFUJI Hideaki | 300aaee | 2008-03-24 18:28:39 +0900 | [diff] [blame] | 15 | #define SIOCGETPRL (SIOCDEVPRIVATE + 4) |
Templin, Fred L | fadf6bf | 2008-03-11 18:35:59 -0400 | [diff] [blame] | 16 | #define SIOCADDPRL (SIOCDEVPRIVATE + 5) |
| 17 | #define SIOCDELPRL (SIOCDEVPRIVATE + 6) |
| 18 | #define SIOCCHGPRL (SIOCDEVPRIVATE + 7) |
YOSHIFUJI Hideaki / 吉藤英明 | fa857af | 2009-09-22 23:43:14 +0000 | [diff] [blame] | 19 | #define SIOCGET6RD (SIOCDEVPRIVATE + 8) |
| 20 | #define SIOCADD6RD (SIOCDEVPRIVATE + 9) |
| 21 | #define SIOCDEL6RD (SIOCDEVPRIVATE + 10) |
| 22 | #define SIOCCHG6RD (SIOCDEVPRIVATE + 11) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 23 | |
Harvey Harrison | f3a7c66 | 2009-02-14 22:58:35 -0800 | [diff] [blame] | 24 | #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 Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 32 | |
Eric Dumazet | d94d9fe | 2009-11-04 09:50:58 -0800 | [diff] [blame] | 33 | struct ip_tunnel_parm { |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 34 | char name[IFNAMSIZ]; |
| 35 | int link; |
Al Viro | d5a0a1e | 2006-11-08 00:23:14 -0800 | [diff] [blame] | 36 | __be16 i_flags; |
| 37 | __be16 o_flags; |
| 38 | __be32 i_key; |
| 39 | __be32 o_key; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 40 | struct iphdr iph; |
| 41 | }; |
| 42 | |
Templin, Fred L | fadf6bf | 2008-03-11 18:35:59 -0400 | [diff] [blame] | 43 | /* SIT-mode i_flags */ |
| 44 | #define SIT_ISATAP 0x0001 |
| 45 | |
| 46 | struct ip_tunnel_prl { |
| 47 | __be32 addr; |
| 48 | __u16 flags; |
| 49 | __u16 __reserved; |
YOSHIFUJI Hideaki | 300aaee | 2008-03-24 18:28:39 +0900 | [diff] [blame] | 50 | __u32 datalen; |
Sascha Hlusiak | d1f8297 | 2009-09-26 20:28:07 -0700 | [diff] [blame] | 51 | __u32 __reserved2; |
YOSHIFUJI Hideaki | 2b4743b | 2008-06-16 16:48:20 -0700 | [diff] [blame] | 52 | /* data follows */ |
Templin, Fred L | fadf6bf | 2008-03-11 18:35:59 -0400 | [diff] [blame] | 53 | }; |
| 54 | |
| 55 | /* PRL flags */ |
| 56 | #define PRL_DEFAULT 0x0001 |
| 57 | |
YOSHIFUJI Hideaki / 吉藤英明 | fa857af | 2009-09-22 23:43:14 +0000 | [diff] [blame] | 58 | struct ip_tunnel_6rd { |
| 59 | struct in6_addr prefix; |
| 60 | __be32 relay_prefix; |
| 61 | __u16 prefixlen; |
| 62 | __u16 relay_prefixlen; |
| 63 | }; |
| 64 | |
Eric Dumazet | d94d9fe | 2009-11-04 09:50:58 -0800 | [diff] [blame] | 65 | enum { |
Herbert Xu | c19e654 | 2008-10-09 11:59:55 -0700 | [diff] [blame] | 66 | 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 Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 82 | #endif /* _IF_TUNNEL_H_ */ |