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