Merge tag 'xtensa-20180225' of git://github.com/jcmvbkbc/linux-xtensa
[cris-mirror.git] / include / uapi / linux / tc_act / tc_pedit.h
blob162d1094c41c09ca832c0139474f99b62e6a4aaf
1 /* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2 #ifndef __LINUX_TC_PED_H
3 #define __LINUX_TC_PED_H
5 #include <linux/types.h>
6 #include <linux/pkt_cls.h>
8 #define TCA_ACT_PEDIT 7
10 enum {
11 TCA_PEDIT_UNSPEC,
12 TCA_PEDIT_TM,
13 TCA_PEDIT_PARMS,
14 TCA_PEDIT_PAD,
15 TCA_PEDIT_PARMS_EX,
16 TCA_PEDIT_KEYS_EX,
17 TCA_PEDIT_KEY_EX,
18 __TCA_PEDIT_MAX
20 #define TCA_PEDIT_MAX (__TCA_PEDIT_MAX - 1)
22 enum {
23 TCA_PEDIT_KEY_EX_HTYPE = 1,
24 TCA_PEDIT_KEY_EX_CMD = 2,
25 __TCA_PEDIT_KEY_EX_MAX
27 #define TCA_PEDIT_KEY_EX_MAX (__TCA_PEDIT_KEY_EX_MAX - 1)
29 /* TCA_PEDIT_KEY_EX_HDR_TYPE_NETWROK is a special case for legacy users. It
30 * means no specific header type - offset is relative to the network layer
32 enum pedit_header_type {
33 TCA_PEDIT_KEY_EX_HDR_TYPE_NETWORK = 0,
34 TCA_PEDIT_KEY_EX_HDR_TYPE_ETH = 1,
35 TCA_PEDIT_KEY_EX_HDR_TYPE_IP4 = 2,
36 TCA_PEDIT_KEY_EX_HDR_TYPE_IP6 = 3,
37 TCA_PEDIT_KEY_EX_HDR_TYPE_TCP = 4,
38 TCA_PEDIT_KEY_EX_HDR_TYPE_UDP = 5,
39 __PEDIT_HDR_TYPE_MAX,
41 #define TCA_PEDIT_HDR_TYPE_MAX (__PEDIT_HDR_TYPE_MAX - 1)
43 enum pedit_cmd {
44 TCA_PEDIT_KEY_EX_CMD_SET = 0,
45 TCA_PEDIT_KEY_EX_CMD_ADD = 1,
46 __PEDIT_CMD_MAX,
48 #define TCA_PEDIT_CMD_MAX (__PEDIT_CMD_MAX - 1)
50 struct tc_pedit_key {
51 __u32 mask; /* AND */
52 __u32 val; /*XOR */
53 __u32 off; /*offset */
54 __u32 at;
55 __u32 offmask;
56 __u32 shift;
59 struct tc_pedit_sel {
60 tc_gen;
61 unsigned char nkeys;
62 unsigned char flags;
63 struct tc_pedit_key keys[0];
65 #define tc_pedit tc_pedit_sel
67 #endif