tc_em_meta.h 2.0 KB

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