if_tunnel.h 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  1. #ifndef _IF_TUNNEL_H_
  2. #define _IF_TUNNEL_H_
  3. #include <linux/types.h>
  4. #include <asm/byteorder.h>
  5. #ifdef __KERNEL__
  6. #include <linux/ip.h>
  7. #include <linux/in6.h>
  8. #endif
  9. #define SIOCGETTUNNEL (SIOCDEVPRIVATE + 0)
  10. #define SIOCADDTUNNEL (SIOCDEVPRIVATE + 1)
  11. #define SIOCDELTUNNEL (SIOCDEVPRIVATE + 2)
  12. #define SIOCCHGTUNNEL (SIOCDEVPRIVATE + 3)
  13. #define SIOCGETPRL (SIOCDEVPRIVATE + 4)
  14. #define SIOCADDPRL (SIOCDEVPRIVATE + 5)
  15. #define SIOCDELPRL (SIOCDEVPRIVATE + 6)
  16. #define SIOCCHGPRL (SIOCDEVPRIVATE + 7)
  17. #define SIOCGET6RD (SIOCDEVPRIVATE + 8)
  18. #define SIOCADD6RD (SIOCDEVPRIVATE + 9)
  19. #define SIOCDEL6RD (SIOCDEVPRIVATE + 10)
  20. #define SIOCCHG6RD (SIOCDEVPRIVATE + 11)
  21. #define GRE_CSUM __cpu_to_be16(0x8000)
  22. #define GRE_ROUTING __cpu_to_be16(0x4000)
  23. #define GRE_KEY __cpu_to_be16(0x2000)
  24. #define GRE_SEQ __cpu_to_be16(0x1000)
  25. #define GRE_STRICT __cpu_to_be16(0x0800)
  26. #define GRE_REC __cpu_to_be16(0x0700)
  27. #define GRE_FLAGS __cpu_to_be16(0x00F8)
  28. #define GRE_VERSION __cpu_to_be16(0x0007)
  29. struct ip_tunnel_parm {
  30. char name[IFNAMSIZ];
  31. int link;
  32. __be16 i_flags;
  33. __be16 o_flags;
  34. __be32 i_key;
  35. __be32 o_key;
  36. struct iphdr iph;
  37. };
  38. /* SIT-mode i_flags */
  39. #define SIT_ISATAP 0x0001
  40. struct ip_tunnel_prl {
  41. __be32 addr;
  42. __u16 flags;
  43. __u16 __reserved;
  44. __u32 datalen;
  45. __u32 __reserved2;
  46. /* data follows */
  47. };
  48. /* PRL flags */
  49. #define PRL_DEFAULT 0x0001
  50. struct ip_tunnel_6rd {
  51. struct in6_addr prefix;
  52. __be32 relay_prefix;
  53. __u16 prefixlen;
  54. __u16 relay_prefixlen;
  55. };
  56. enum {
  57. IFLA_GRE_UNSPEC,
  58. IFLA_GRE_LINK,
  59. IFLA_GRE_IFLAGS,
  60. IFLA_GRE_OFLAGS,
  61. IFLA_GRE_IKEY,
  62. IFLA_GRE_OKEY,
  63. IFLA_GRE_LOCAL,
  64. IFLA_GRE_REMOTE,
  65. IFLA_GRE_TTL,
  66. IFLA_GRE_TOS,
  67. IFLA_GRE_PMTUDISC,
  68. __IFLA_GRE_MAX,
  69. };
  70. #define IFLA_GRE_MAX (__IFLA_GRE_MAX - 1)
  71. #endif /* _IF_TUNNEL_H_ */