tc_em_meta.h 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  1. /* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
  2. #ifndef __LINUX_TC_EM_META_H
  3. #define __LINUX_TC_EM_META_H
  4. #include <linux/types.h>
  5. #include <linux/pkt_cls.h>
  6. enum {
  7. TCA_EM_META_UNSPEC,
  8. TCA_EM_META_HDR,
  9. TCA_EM_META_LVALUE,
  10. TCA_EM_META_RVALUE,
  11. __TCA_EM_META_MAX
  12. };
  13. #define TCA_EM_META_MAX (__TCA_EM_META_MAX - 1)
  14. struct tcf_meta_val {
  15. __u16 kind;
  16. __u8 shift;
  17. __u8 op;
  18. };
  19. #define TCF_META_TYPE_MASK (0xf << 12)
  20. #define TCF_META_TYPE(kind) (((kind) & TCF_META_TYPE_MASK) >> 12)
  21. #define TCF_META_ID_MASK 0x7ff
  22. #define TCF_META_ID(kind) ((kind) & TCF_META_ID_MASK)
  23. enum {
  24. TCF_META_TYPE_VAR,
  25. TCF_META_TYPE_INT,
  26. __TCF_META_TYPE_MAX
  27. };
  28. #define TCF_META_TYPE_MAX (__TCF_META_TYPE_MAX - 1)
  29. enum {
  30. TCF_META_ID_VALUE,
  31. TCF_META_ID_RANDOM,
  32. TCF_META_ID_LOADAVG_0,
  33. TCF_META_ID_LOADAVG_1,
  34. TCF_META_ID_LOADAVG_2,
  35. TCF_META_ID_DEV,
  36. TCF_META_ID_PRIORITY,
  37. TCF_META_ID_PROTOCOL,
  38. TCF_META_ID_PKTTYPE,
  39. TCF_META_ID_PKTLEN,
  40. TCF_META_ID_DATALEN,
  41. TCF_META_ID_MACLEN,
  42. TCF_META_ID_NFMARK,
  43. TCF_META_ID_TCINDEX,
  44. TCF_META_ID_RTCLASSID,
  45. TCF_META_ID_RTIIF,
  46. TCF_META_ID_SK_FAMILY,
  47. TCF_META_ID_SK_STATE,
  48. TCF_META_ID_SK_REUSE,
  49. TCF_META_ID_SK_BOUND_IF,
  50. TCF_META_ID_SK_REFCNT,
  51. TCF_META_ID_SK_SHUTDOWN,
  52. TCF_META_ID_SK_PROTO,
  53. TCF_META_ID_SK_TYPE,
  54. TCF_META_ID_SK_RCVBUF,
  55. TCF_META_ID_SK_RMEM_ALLOC,
  56. TCF_META_ID_SK_WMEM_ALLOC,
  57. TCF_META_ID_SK_OMEM_ALLOC,
  58. TCF_META_ID_SK_WMEM_QUEUED,
  59. TCF_META_ID_SK_RCV_QLEN,
  60. TCF_META_ID_SK_SND_QLEN,
  61. TCF_META_ID_SK_ERR_QLEN,
  62. TCF_META_ID_SK_FORWARD_ALLOCS,
  63. TCF_META_ID_SK_SNDBUF,
  64. TCF_META_ID_SK_ALLOCS,
  65. __TCF_META_ID_SK_ROUTE_CAPS, /* unimplemented but in ABI already */
  66. TCF_META_ID_SK_HASH,
  67. TCF_META_ID_SK_LINGERTIME,
  68. TCF_META_ID_SK_ACK_BACKLOG,
  69. TCF_META_ID_SK_MAX_ACK_BACKLOG,
  70. TCF_META_ID_SK_PRIO,
  71. TCF_META_ID_SK_RCVLOWAT,
  72. TCF_META_ID_SK_RCVTIMEO,
  73. TCF_META_ID_SK_SNDTIMEO,
  74. TCF_META_ID_SK_SENDMSG_OFF,
  75. TCF_META_ID_SK_WRITE_PENDING,
  76. TCF_META_ID_VLAN_TAG,
  77. TCF_META_ID_RXHASH,
  78. __TCF_META_ID_MAX
  79. };
  80. #define TCF_META_ID_MAX (__TCF_META_ID_MAX - 1)
  81. struct tcf_meta_hdr {
  82. struct tcf_meta_val left;
  83. struct tcf_meta_val right;
  84. };
  85. #endif