if_tunnel.h 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135
  1. #ifndef _UAPI_IF_TUNNEL_H_
  2. #define _UAPI_IF_TUNNEL_H_
  3. #include <linux/types.h>
  4. #include <asm/byteorder.h>
  5. #define SIOCGETTUNNEL (SIOCDEVPRIVATE + 0)
  6. #define SIOCADDTUNNEL (SIOCDEVPRIVATE + 1)
  7. #define SIOCDELTUNNEL (SIOCDEVPRIVATE + 2)
  8. #define SIOCCHGTUNNEL (SIOCDEVPRIVATE + 3)
  9. #define SIOCGETPRL (SIOCDEVPRIVATE + 4)
  10. #define SIOCADDPRL (SIOCDEVPRIVATE + 5)
  11. #define SIOCDELPRL (SIOCDEVPRIVATE + 6)
  12. #define SIOCCHGPRL (SIOCDEVPRIVATE + 7)
  13. #define SIOCGET6RD (SIOCDEVPRIVATE + 8)
  14. #define SIOCADD6RD (SIOCDEVPRIVATE + 9)
  15. #define SIOCDEL6RD (SIOCDEVPRIVATE + 10)
  16. #define SIOCCHG6RD (SIOCDEVPRIVATE + 11)
  17. #define GRE_CSUM __cpu_to_be16(0x8000)
  18. #define GRE_ROUTING __cpu_to_be16(0x4000)
  19. #define GRE_KEY __cpu_to_be16(0x2000)
  20. #define GRE_SEQ __cpu_to_be16(0x1000)
  21. #define GRE_STRICT __cpu_to_be16(0x0800)
  22. #define GRE_REC __cpu_to_be16(0x0700)
  23. #define GRE_FLAGS __cpu_to_be16(0x00F8)
  24. #define GRE_VERSION __cpu_to_be16(0x0007)
  25. struct ip_tunnel_parm {
  26. char name[IFNAMSIZ];
  27. int link;
  28. __be16 i_flags;
  29. __be16 o_flags;
  30. __be32 i_key;
  31. __be32 o_key;
  32. struct iphdr iph;
  33. };
  34. enum {
  35. IFLA_IPTUN_UNSPEC,
  36. IFLA_IPTUN_LINK,
  37. IFLA_IPTUN_LOCAL,
  38. IFLA_IPTUN_REMOTE,
  39. IFLA_IPTUN_TTL,
  40. IFLA_IPTUN_TOS,
  41. IFLA_IPTUN_ENCAP_LIMIT,
  42. IFLA_IPTUN_FLOWINFO,
  43. IFLA_IPTUN_FLAGS,
  44. IFLA_IPTUN_PROTO,
  45. IFLA_IPTUN_PMTUDISC,
  46. IFLA_IPTUN_6RD_PREFIX,
  47. IFLA_IPTUN_6RD_RELAY_PREFIX,
  48. IFLA_IPTUN_6RD_PREFIXLEN,
  49. IFLA_IPTUN_6RD_RELAY_PREFIXLEN,
  50. IFLA_IPTUN_ENCAP_TYPE,
  51. IFLA_IPTUN_ENCAP_FLAGS,
  52. IFLA_IPTUN_ENCAP_SPORT,
  53. IFLA_IPTUN_ENCAP_DPORT,
  54. __IFLA_IPTUN_MAX,
  55. };
  56. #define IFLA_IPTUN_MAX (__IFLA_IPTUN_MAX - 1)
  57. enum tunnel_encap_types {
  58. TUNNEL_ENCAP_NONE,
  59. TUNNEL_ENCAP_FOU,
  60. TUNNEL_ENCAP_GUE,
  61. };
  62. #define TUNNEL_ENCAP_FLAG_CSUM (1<<0)
  63. #define TUNNEL_ENCAP_FLAG_CSUM6 (1<<1)
  64. #define TUNNEL_ENCAP_FLAG_REMCSUM (1<<2)
  65. /* SIT-mode i_flags */
  66. #define SIT_ISATAP 0x0001
  67. struct ip_tunnel_prl {
  68. __be32 addr;
  69. __u16 flags;
  70. __u16 __reserved;
  71. __u32 datalen;
  72. __u32 __reserved2;
  73. /* data follows */
  74. };
  75. /* PRL flags */
  76. #define PRL_DEFAULT 0x0001
  77. struct ip_tunnel_6rd {
  78. struct in6_addr prefix;
  79. __be32 relay_prefix;
  80. __u16 prefixlen;
  81. __u16 relay_prefixlen;
  82. };
  83. enum {
  84. IFLA_GRE_UNSPEC,
  85. IFLA_GRE_LINK,
  86. IFLA_GRE_IFLAGS,
  87. IFLA_GRE_OFLAGS,
  88. IFLA_GRE_IKEY,
  89. IFLA_GRE_OKEY,
  90. IFLA_GRE_LOCAL,
  91. IFLA_GRE_REMOTE,
  92. IFLA_GRE_TTL,
  93. IFLA_GRE_TOS,
  94. IFLA_GRE_PMTUDISC,
  95. IFLA_GRE_ENCAP_LIMIT,
  96. IFLA_GRE_FLOWINFO,
  97. IFLA_GRE_FLAGS,
  98. IFLA_GRE_ENCAP_TYPE,
  99. IFLA_GRE_ENCAP_FLAGS,
  100. IFLA_GRE_ENCAP_SPORT,
  101. IFLA_GRE_ENCAP_DPORT,
  102. IFLA_GRE_COLLECT_METADATA,
  103. __IFLA_GRE_MAX,
  104. };
  105. #define IFLA_GRE_MAX (__IFLA_GRE_MAX - 1)
  106. /* VTI-mode i_flags */
  107. #define VTI_ISVTI ((__force __be16)0x0001)
  108. enum {
  109. IFLA_VTI_UNSPEC,
  110. IFLA_VTI_LINK,
  111. IFLA_VTI_IKEY,
  112. IFLA_VTI_OKEY,
  113. IFLA_VTI_LOCAL,
  114. IFLA_VTI_REMOTE,
  115. __IFLA_VTI_MAX,
  116. };
  117. #define IFLA_VTI_MAX (__IFLA_VTI_MAX - 1)
  118. #endif /* _UAPI_IF_TUNNEL_H_ */