1 /* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2 #ifndef __LINUX_PKT_CLS_H
3 #define __LINUX_PKT_CLS_H
5 #include <linux/types.h>
6 #include <linux/pkt_sched.h>
8 #define TC_COOKIE_MAX_SIZE 16
10 /* Action attributes */
21 TCA_ACT_USED_HW_STATS,
26 /* See other TCA_ACT_FLAGS_ * flags in include/net/act_api.h. */
27 #define TCA_ACT_FLAGS_NO_PERCPU_STATS (1 << 0) /* Don't use percpu allocator for
30 #define TCA_ACT_FLAGS_SKIP_HW (1 << 1) /* don't offload action to HW */
31 #define TCA_ACT_FLAGS_SKIP_SW (1 << 2) /* don't use action in SW */
34 * When user does not pass the attribute, he does not care.
35 * It is the same as if he would pass the attribute with
36 * all supported bits set.
37 * In case no bits are set, user is not interested in getting any HW statistics.
39 #define TCA_ACT_HW_STATS_IMMEDIATE (1 << 0) /* Means that in dump, user
40 * gets the current HW stats
41 * state from the device
42 * queried at the dump time.
44 #define TCA_ACT_HW_STATS_DELAYED (1 << 1) /* Means that in dump, user gets
45 * HW stats that might be out of date
46 * for some time, maybe couple of
47 * seconds. This is the case when
48 * driver polls stats updates
49 * periodically or when it gets async
50 * stats update from the device.
53 #define TCA_ACT_MAX __TCA_ACT_MAX
54 #define TCA_OLD_COMPAT (TCA_ACT_MAX+1)
55 #define TCA_ACT_MAX_PRIO 32
56 #define TCA_ACT_BIND 1
57 #define TCA_ACT_NOBIND 0
58 #define TCA_ACT_UNBIND 1
59 #define TCA_ACT_NOUNBIND 0
60 #define TCA_ACT_REPLACE 1
61 #define TCA_ACT_NOREPLACE 0
63 #define TC_ACT_UNSPEC (-1)
65 #define TC_ACT_RECLASSIFY 1
68 #define TC_ACT_STOLEN 4
69 #define TC_ACT_QUEUED 5
70 #define TC_ACT_REPEAT 6
71 #define TC_ACT_REDIRECT 7
72 #define TC_ACT_TRAP 8 /* For hw path, this means "trap to cpu"
73 * and don't further process the frame
74 * in hardware. For sw path, this is
75 * equivalent of TC_ACT_STOLEN - drop
76 * the skb and act like everything
79 #define TC_ACT_VALUE_MAX TC_ACT_TRAP
81 /* There is a special kind of actions called "extended actions",
82 * which need a value parameter. These have a local opcode located in
83 * the highest nibble, starting from 1. The rest of the bits
84 * are used to carry the value. These two parts together make
87 #define __TC_ACT_EXT_SHIFT 28
88 #define __TC_ACT_EXT(local) ((local) << __TC_ACT_EXT_SHIFT)
89 #define TC_ACT_EXT_VAL_MASK ((1 << __TC_ACT_EXT_SHIFT) - 1)
90 #define TC_ACT_EXT_OPCODE(combined) ((combined) & (~TC_ACT_EXT_VAL_MASK))
91 #define TC_ACT_EXT_CMP(combined, opcode) (TC_ACT_EXT_OPCODE(combined) == opcode)
93 #define TC_ACT_JUMP __TC_ACT_EXT(1)
94 #define TC_ACT_GOTO_CHAIN __TC_ACT_EXT(2)
95 #define TC_ACT_EXT_OPCODE_MAX TC_ACT_GOTO_CHAIN
97 /* These macros are put here for binary compatibility with userspace apps that
98 * make use of them. For kernel code and new userspace apps, use the TCA_ID_*
101 #define TCA_ACT_GACT 5
102 #define TCA_ACT_IPT 6
103 #define TCA_ACT_PEDIT 7
104 #define TCA_ACT_MIRRED 8
105 #define TCA_ACT_NAT 9
106 #define TCA_ACT_XT 10
107 #define TCA_ACT_SKBEDIT 11
108 #define TCA_ACT_VLAN 12
109 #define TCA_ACT_BPF 13
110 #define TCA_ACT_CONNMARK 14
111 #define TCA_ACT_SKBMOD 15
112 #define TCA_ACT_CSUM 16
113 #define TCA_ACT_TUNNEL_KEY 17
114 #define TCA_ACT_SIMP 22
115 #define TCA_ACT_IFE 25
116 #define TCA_ACT_SAMPLE 26
118 /* Action type identifiers*/
122 TCA_ID_GACT = TCA_ACT_GACT,
123 TCA_ID_IPT = TCA_ACT_IPT,
124 TCA_ID_PEDIT = TCA_ACT_PEDIT,
125 TCA_ID_MIRRED = TCA_ACT_MIRRED,
126 TCA_ID_NAT = TCA_ACT_NAT,
127 TCA_ID_XT = TCA_ACT_XT,
128 TCA_ID_SKBEDIT = TCA_ACT_SKBEDIT,
129 TCA_ID_VLAN = TCA_ACT_VLAN,
130 TCA_ID_BPF = TCA_ACT_BPF,
131 TCA_ID_CONNMARK = TCA_ACT_CONNMARK,
132 TCA_ID_SKBMOD = TCA_ACT_SKBMOD,
133 TCA_ID_CSUM = TCA_ACT_CSUM,
134 TCA_ID_TUNNEL_KEY = TCA_ACT_TUNNEL_KEY,
135 TCA_ID_SIMP = TCA_ACT_SIMP,
136 TCA_ID_IFE = TCA_ACT_IFE,
137 TCA_ID_SAMPLE = TCA_ACT_SAMPLE,
142 /* other actions go here */
146 #define TCA_ID_MAX __TCA_ID_MAX
151 #define TC_POLICE_UNSPEC TC_ACT_UNSPEC
152 #define TC_POLICE_OK TC_ACT_OK
153 #define TC_POLICE_RECLASSIFY TC_ACT_RECLASSIFY
154 #define TC_POLICE_SHOT TC_ACT_SHOT
155 #define TC_POLICE_PIPE TC_ACT_PIPE
160 struct tc_ratespec rate;
161 struct tc_ratespec peakrate;
196 TCA_POLICE_PEAKRATE64,
197 TCA_POLICE_PKTRATE64,
198 TCA_POLICE_PKTBURST64,
200 #define TCA_POLICE_RESULT TCA_POLICE_RESULT
203 #define TCA_POLICE_MAX (__TCA_POLICE_MAX - 1)
205 /* tca flags definitions */
206 #define TCA_CLS_FLAGS_SKIP_HW (1 << 0) /* don't offload filter to HW */
207 #define TCA_CLS_FLAGS_SKIP_SW (1 << 1) /* don't use filter in SW */
208 #define TCA_CLS_FLAGS_IN_HW (1 << 2) /* filter is offloaded to HW */
209 #define TCA_CLS_FLAGS_NOT_IN_HW (1 << 3) /* filter isn't offloaded to HW */
210 #define TCA_CLS_FLAGS_VERBOSE (1 << 4) /* verbose logging */
214 #define TC_U32_HTID(h) ((h)&0xFFF00000)
215 #define TC_U32_USERHTID(h) (TC_U32_HTID(h)>>20)
216 #define TC_U32_HASH(h) (((h)>>12)&0xFF)
217 #define TC_U32_NODE(h) ((h)&0xFFF)
218 #define TC_U32_KEY(h) ((h)&0xFFFFF)
219 #define TC_U32_UNSPEC 0
220 #define TC_U32_ROOT (0xFFF00000)
239 #define TCA_U32_MAX (__TCA_U32_MAX - 1)
250 unsigned char offshift;
259 struct tc_u32_key keys[];
276 #define TC_U32_TERMINAL 1
277 #define TC_U32_OFFSET 2
278 #define TC_U32_VAROFFSET 4
281 #define TC_U32_MAXDEPTH 8
297 #define TCA_RSVP_MAX (__TCA_RSVP_MAX - 1 )
305 struct tc_rsvp_pinfo {
306 struct tc_rsvp_gpi dpi;
307 struct tc_rsvp_gpi spi;
327 #define TCA_ROUTE4_MAX (__TCA_ROUTE4_MAX - 1)
337 TCA_FW_ACT, /* used by CONFIG_NET_CLS_ACT */
342 #define TCA_FW_MAX (__TCA_FW_MAX - 1)
344 /* TC index filter */
351 TCA_TCINDEX_FALL_THROUGH,
358 #define TCA_TCINDEX_MAX (__TCA_TCINDEX_MAX - 1)
374 FLOW_KEY_NFCT_PROTO_SRC,
375 FLOW_KEY_NFCT_PROTO_DST,
384 #define FLOW_KEY_MAX (__FLOW_KEY_MAX - 1)
408 #define TCA_FLOW_MAX (__TCA_FLOW_MAX - 1)
412 struct tc_basic_pcnt {
428 #define TCA_BASIC_MAX (__TCA_BASIC_MAX - 1)
431 /* Cgroup classifier */
441 #define TCA_CGROUP_MAX (__TCA_CGROUP_MAX - 1)
445 #define TCA_BPF_FLAG_ACT_DIRECT (1 << 0)
463 #define TCA_BPF_MAX (__TCA_BPF_MAX - 1)
465 /* Flower classifier */
472 TCA_FLOWER_KEY_ETH_DST, /* ETH_ALEN */
473 TCA_FLOWER_KEY_ETH_DST_MASK, /* ETH_ALEN */
474 TCA_FLOWER_KEY_ETH_SRC, /* ETH_ALEN */
475 TCA_FLOWER_KEY_ETH_SRC_MASK, /* ETH_ALEN */
476 TCA_FLOWER_KEY_ETH_TYPE, /* be16 */
477 TCA_FLOWER_KEY_IP_PROTO, /* u8 */
478 TCA_FLOWER_KEY_IPV4_SRC, /* be32 */
479 TCA_FLOWER_KEY_IPV4_SRC_MASK, /* be32 */
480 TCA_FLOWER_KEY_IPV4_DST, /* be32 */
481 TCA_FLOWER_KEY_IPV4_DST_MASK, /* be32 */
482 TCA_FLOWER_KEY_IPV6_SRC, /* struct in6_addr */
483 TCA_FLOWER_KEY_IPV6_SRC_MASK, /* struct in6_addr */
484 TCA_FLOWER_KEY_IPV6_DST, /* struct in6_addr */
485 TCA_FLOWER_KEY_IPV6_DST_MASK, /* struct in6_addr */
486 TCA_FLOWER_KEY_TCP_SRC, /* be16 */
487 TCA_FLOWER_KEY_TCP_DST, /* be16 */
488 TCA_FLOWER_KEY_UDP_SRC, /* be16 */
489 TCA_FLOWER_KEY_UDP_DST, /* be16 */
492 TCA_FLOWER_KEY_VLAN_ID, /* be16 */
493 TCA_FLOWER_KEY_VLAN_PRIO, /* u8 */
494 TCA_FLOWER_KEY_VLAN_ETH_TYPE, /* be16 */
496 TCA_FLOWER_KEY_ENC_KEY_ID, /* be32 */
497 TCA_FLOWER_KEY_ENC_IPV4_SRC, /* be32 */
498 TCA_FLOWER_KEY_ENC_IPV4_SRC_MASK,/* be32 */
499 TCA_FLOWER_KEY_ENC_IPV4_DST, /* be32 */
500 TCA_FLOWER_KEY_ENC_IPV4_DST_MASK,/* be32 */
501 TCA_FLOWER_KEY_ENC_IPV6_SRC, /* struct in6_addr */
502 TCA_FLOWER_KEY_ENC_IPV6_SRC_MASK,/* struct in6_addr */
503 TCA_FLOWER_KEY_ENC_IPV6_DST, /* struct in6_addr */
504 TCA_FLOWER_KEY_ENC_IPV6_DST_MASK,/* struct in6_addr */
506 TCA_FLOWER_KEY_TCP_SRC_MASK, /* be16 */
507 TCA_FLOWER_KEY_TCP_DST_MASK, /* be16 */
508 TCA_FLOWER_KEY_UDP_SRC_MASK, /* be16 */
509 TCA_FLOWER_KEY_UDP_DST_MASK, /* be16 */
510 TCA_FLOWER_KEY_SCTP_SRC_MASK, /* be16 */
511 TCA_FLOWER_KEY_SCTP_DST_MASK, /* be16 */
513 TCA_FLOWER_KEY_SCTP_SRC, /* be16 */
514 TCA_FLOWER_KEY_SCTP_DST, /* be16 */
516 TCA_FLOWER_KEY_ENC_UDP_SRC_PORT, /* be16 */
517 TCA_FLOWER_KEY_ENC_UDP_SRC_PORT_MASK, /* be16 */
518 TCA_FLOWER_KEY_ENC_UDP_DST_PORT, /* be16 */
519 TCA_FLOWER_KEY_ENC_UDP_DST_PORT_MASK, /* be16 */
521 TCA_FLOWER_KEY_FLAGS, /* be32 */
522 TCA_FLOWER_KEY_FLAGS_MASK, /* be32 */
524 TCA_FLOWER_KEY_ICMPV4_CODE, /* u8 */
525 TCA_FLOWER_KEY_ICMPV4_CODE_MASK,/* u8 */
526 TCA_FLOWER_KEY_ICMPV4_TYPE, /* u8 */
527 TCA_FLOWER_KEY_ICMPV4_TYPE_MASK,/* u8 */
528 TCA_FLOWER_KEY_ICMPV6_CODE, /* u8 */
529 TCA_FLOWER_KEY_ICMPV6_CODE_MASK,/* u8 */
530 TCA_FLOWER_KEY_ICMPV6_TYPE, /* u8 */
531 TCA_FLOWER_KEY_ICMPV6_TYPE_MASK,/* u8 */
533 TCA_FLOWER_KEY_ARP_SIP, /* be32 */
534 TCA_FLOWER_KEY_ARP_SIP_MASK, /* be32 */
535 TCA_FLOWER_KEY_ARP_TIP, /* be32 */
536 TCA_FLOWER_KEY_ARP_TIP_MASK, /* be32 */
537 TCA_FLOWER_KEY_ARP_OP, /* u8 */
538 TCA_FLOWER_KEY_ARP_OP_MASK, /* u8 */
539 TCA_FLOWER_KEY_ARP_SHA, /* ETH_ALEN */
540 TCA_FLOWER_KEY_ARP_SHA_MASK, /* ETH_ALEN */
541 TCA_FLOWER_KEY_ARP_THA, /* ETH_ALEN */
542 TCA_FLOWER_KEY_ARP_THA_MASK, /* ETH_ALEN */
544 TCA_FLOWER_KEY_MPLS_TTL, /* u8 - 8 bits */
545 TCA_FLOWER_KEY_MPLS_BOS, /* u8 - 1 bit */
546 TCA_FLOWER_KEY_MPLS_TC, /* u8 - 3 bits */
547 TCA_FLOWER_KEY_MPLS_LABEL, /* be32 - 20 bits */
549 TCA_FLOWER_KEY_TCP_FLAGS, /* be16 */
550 TCA_FLOWER_KEY_TCP_FLAGS_MASK, /* be16 */
552 TCA_FLOWER_KEY_IP_TOS, /* u8 */
553 TCA_FLOWER_KEY_IP_TOS_MASK, /* u8 */
554 TCA_FLOWER_KEY_IP_TTL, /* u8 */
555 TCA_FLOWER_KEY_IP_TTL_MASK, /* u8 */
557 TCA_FLOWER_KEY_CVLAN_ID, /* be16 */
558 TCA_FLOWER_KEY_CVLAN_PRIO, /* u8 */
559 TCA_FLOWER_KEY_CVLAN_ETH_TYPE, /* be16 */
561 TCA_FLOWER_KEY_ENC_IP_TOS, /* u8 */
562 TCA_FLOWER_KEY_ENC_IP_TOS_MASK, /* u8 */
563 TCA_FLOWER_KEY_ENC_IP_TTL, /* u8 */
564 TCA_FLOWER_KEY_ENC_IP_TTL_MASK, /* u8 */
566 TCA_FLOWER_KEY_ENC_OPTS,
567 TCA_FLOWER_KEY_ENC_OPTS_MASK,
569 TCA_FLOWER_IN_HW_COUNT,
571 TCA_FLOWER_KEY_PORT_SRC_MIN, /* be16 */
572 TCA_FLOWER_KEY_PORT_SRC_MAX, /* be16 */
573 TCA_FLOWER_KEY_PORT_DST_MIN, /* be16 */
574 TCA_FLOWER_KEY_PORT_DST_MAX, /* be16 */
576 TCA_FLOWER_KEY_CT_STATE, /* u16 */
577 TCA_FLOWER_KEY_CT_STATE_MASK, /* u16 */
578 TCA_FLOWER_KEY_CT_ZONE, /* u16 */
579 TCA_FLOWER_KEY_CT_ZONE_MASK, /* u16 */
580 TCA_FLOWER_KEY_CT_MARK, /* u32 */
581 TCA_FLOWER_KEY_CT_MARK_MASK, /* u32 */
582 TCA_FLOWER_KEY_CT_LABELS, /* u128 */
583 TCA_FLOWER_KEY_CT_LABELS_MASK, /* u128 */
585 TCA_FLOWER_KEY_MPLS_OPTS,
587 TCA_FLOWER_KEY_HASH, /* u32 */
588 TCA_FLOWER_KEY_HASH_MASK, /* u32 */
590 TCA_FLOWER_KEY_NUM_OF_VLANS, /* u8 */
592 TCA_FLOWER_KEY_PPPOE_SID, /* be16 */
593 TCA_FLOWER_KEY_PPP_PROTO, /* be16 */
595 TCA_FLOWER_KEY_L2TPV3_SID, /* be32 */
597 TCA_FLOWER_L2_MISS, /* u8 */
599 TCA_FLOWER_KEY_CFM, /* nested */
601 TCA_FLOWER_KEY_SPI, /* be32 */
602 TCA_FLOWER_KEY_SPI_MASK, /* be32 */
607 #define TCA_FLOWER_MAX (__TCA_FLOWER_MAX - 1)
610 TCA_FLOWER_KEY_CT_FLAGS_NEW = 1 << 0, /* Beginning of a new connection. */
611 TCA_FLOWER_KEY_CT_FLAGS_ESTABLISHED = 1 << 1, /* Part of an existing connection. */
612 TCA_FLOWER_KEY_CT_FLAGS_RELATED = 1 << 2, /* Related to an established connection. */
613 TCA_FLOWER_KEY_CT_FLAGS_TRACKED = 1 << 3, /* Conntrack has occurred. */
614 TCA_FLOWER_KEY_CT_FLAGS_INVALID = 1 << 4, /* Conntrack is invalid. */
615 TCA_FLOWER_KEY_CT_FLAGS_REPLY = 1 << 5, /* Packet is in the reply direction. */
616 __TCA_FLOWER_KEY_CT_FLAGS_MAX,
620 TCA_FLOWER_KEY_ENC_OPTS_UNSPEC,
621 TCA_FLOWER_KEY_ENC_OPTS_GENEVE, /* Nested
622 * TCA_FLOWER_KEY_ENC_OPT_GENEVE_
625 TCA_FLOWER_KEY_ENC_OPTS_VXLAN, /* Nested
626 * TCA_FLOWER_KEY_ENC_OPT_VXLAN_
629 TCA_FLOWER_KEY_ENC_OPTS_ERSPAN, /* Nested
630 * TCA_FLOWER_KEY_ENC_OPT_ERSPAN_
633 TCA_FLOWER_KEY_ENC_OPTS_GTP, /* Nested
634 * TCA_FLOWER_KEY_ENC_OPT_GTP_
637 __TCA_FLOWER_KEY_ENC_OPTS_MAX,
640 #define TCA_FLOWER_KEY_ENC_OPTS_MAX (__TCA_FLOWER_KEY_ENC_OPTS_MAX - 1)
643 TCA_FLOWER_KEY_ENC_OPT_GENEVE_UNSPEC,
644 TCA_FLOWER_KEY_ENC_OPT_GENEVE_CLASS, /* u16 */
645 TCA_FLOWER_KEY_ENC_OPT_GENEVE_TYPE, /* u8 */
646 TCA_FLOWER_KEY_ENC_OPT_GENEVE_DATA, /* 4 to 128 bytes */
648 __TCA_FLOWER_KEY_ENC_OPT_GENEVE_MAX,
651 #define TCA_FLOWER_KEY_ENC_OPT_GENEVE_MAX \
652 (__TCA_FLOWER_KEY_ENC_OPT_GENEVE_MAX - 1)
655 TCA_FLOWER_KEY_ENC_OPT_VXLAN_UNSPEC,
656 TCA_FLOWER_KEY_ENC_OPT_VXLAN_GBP, /* u32 */
657 __TCA_FLOWER_KEY_ENC_OPT_VXLAN_MAX,
660 #define TCA_FLOWER_KEY_ENC_OPT_VXLAN_MAX \
661 (__TCA_FLOWER_KEY_ENC_OPT_VXLAN_MAX - 1)
664 TCA_FLOWER_KEY_ENC_OPT_ERSPAN_UNSPEC,
665 TCA_FLOWER_KEY_ENC_OPT_ERSPAN_VER, /* u8 */
666 TCA_FLOWER_KEY_ENC_OPT_ERSPAN_INDEX, /* be32 */
667 TCA_FLOWER_KEY_ENC_OPT_ERSPAN_DIR, /* u8 */
668 TCA_FLOWER_KEY_ENC_OPT_ERSPAN_HWID, /* u8 */
669 __TCA_FLOWER_KEY_ENC_OPT_ERSPAN_MAX,
672 #define TCA_FLOWER_KEY_ENC_OPT_ERSPAN_MAX \
673 (__TCA_FLOWER_KEY_ENC_OPT_ERSPAN_MAX - 1)
676 TCA_FLOWER_KEY_ENC_OPT_GTP_UNSPEC,
677 TCA_FLOWER_KEY_ENC_OPT_GTP_PDU_TYPE, /* u8 */
678 TCA_FLOWER_KEY_ENC_OPT_GTP_QFI, /* u8 */
680 __TCA_FLOWER_KEY_ENC_OPT_GTP_MAX,
683 #define TCA_FLOWER_KEY_ENC_OPT_GTP_MAX \
684 (__TCA_FLOWER_KEY_ENC_OPT_GTP_MAX - 1)
687 TCA_FLOWER_KEY_MPLS_OPTS_UNSPEC,
688 TCA_FLOWER_KEY_MPLS_OPTS_LSE,
689 __TCA_FLOWER_KEY_MPLS_OPTS_MAX,
692 #define TCA_FLOWER_KEY_MPLS_OPTS_MAX (__TCA_FLOWER_KEY_MPLS_OPTS_MAX - 1)
695 TCA_FLOWER_KEY_MPLS_OPT_LSE_UNSPEC,
696 TCA_FLOWER_KEY_MPLS_OPT_LSE_DEPTH,
697 TCA_FLOWER_KEY_MPLS_OPT_LSE_TTL,
698 TCA_FLOWER_KEY_MPLS_OPT_LSE_BOS,
699 TCA_FLOWER_KEY_MPLS_OPT_LSE_TC,
700 TCA_FLOWER_KEY_MPLS_OPT_LSE_LABEL,
701 __TCA_FLOWER_KEY_MPLS_OPT_LSE_MAX,
704 #define TCA_FLOWER_KEY_MPLS_OPT_LSE_MAX \
705 (__TCA_FLOWER_KEY_MPLS_OPT_LSE_MAX - 1)
708 TCA_FLOWER_KEY_FLAGS_IS_FRAGMENT = (1 << 0),
709 TCA_FLOWER_KEY_FLAGS_FRAG_IS_FIRST = (1 << 1),
713 TCA_FLOWER_KEY_CFM_OPT_UNSPEC,
714 TCA_FLOWER_KEY_CFM_MD_LEVEL,
715 TCA_FLOWER_KEY_CFM_OPCODE,
716 __TCA_FLOWER_KEY_CFM_OPT_MAX,
719 #define TCA_FLOWER_KEY_CFM_OPT_MAX (__TCA_FLOWER_KEY_CFM_OPT_MAX - 1)
721 #define TCA_FLOWER_MASK_FLAGS_RANGE (1 << 0) /* Range-based match */
723 /* Match-all classifier */
725 struct tc_matchall_pcnt {
731 TCA_MATCHALL_CLASSID,
739 #define TCA_MATCHALL_MAX (__TCA_MATCHALL_MAX - 1)
741 /* Extended Matches */
743 struct tcf_ematch_tree_hdr {
749 TCA_EMATCH_TREE_UNSPEC,
751 TCA_EMATCH_TREE_LIST,
752 __TCA_EMATCH_TREE_MAX
754 #define TCA_EMATCH_TREE_MAX (__TCA_EMATCH_TREE_MAX - 1)
756 struct tcf_ematch_hdr {
760 __u16 pad; /* currently unused */
764 * 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5
765 * +-----------------------+-+-+---+
767 * +-----------------------+-+-+---+
769 * R(2) ::= relation to next ematch
770 * where: 0 0 END (last ematch)
773 * 1 1 Unused (invalid)
774 * I(1) ::= invert result
775 * S(1) ::= simple payload
777 #define TCF_EM_REL_END 0
778 #define TCF_EM_REL_AND (1<<0)
779 #define TCF_EM_REL_OR (1<<1)
780 #define TCF_EM_INVERT (1<<2)
781 #define TCF_EM_SIMPLE (1<<3)
783 #define TCF_EM_REL_MASK 3
784 #define TCF_EM_REL_VALID(v) (((v) & TCF_EM_REL_MASK) != TCF_EM_REL_MASK)
792 #define TCF_LAYER_MAX (__TCF_LAYER_MAX - 1)
794 /* Ematch type assignments
795 * 1..32767 Reserved for ematches inside kernel tree
796 * 32768..65535 Free to use, not reliable
798 #define TCF_EM_CONTAINER 0
800 #define TCF_EM_NBYTE 2
802 #define TCF_EM_META 4
803 #define TCF_EM_TEXT 5
804 #define TCF_EM_VLAN 6
805 #define TCF_EM_CANID 7
806 #define TCF_EM_IPSET 8