summaryrefslogtreecommitdiff
path: root/include/uapi/linux/tc_act/tc_pedit.h
diff options
context:
space:
mode:
authorAmir Vadai <amir@vadai.me>2017-02-07 10:56:08 +0300
committerDavid S. Miller <davem@davemloft.net>2017-02-10 21:18:33 +0300
commit853a14ba4682f820266469979c9297debc05f60c (patch)
tree5475357c2342327746b5f99a67d46f4eb4ef78d3 /include/uapi/linux/tc_act/tc_pedit.h
parent71d0ed7079dffbc5cd0941d77d9b84e04109c9bb (diff)
downloadlinux-853a14ba4682f820266469979c9297debc05f60c.tar.xz
net/act_pedit: Introduce 'add' operation
This command could be useful to inc/dec fields. For example, to forward any TCP packet and decrease its TTL: $ tc filter add dev enp0s9 protocol ip parent ffff: \ flower ip_proto tcp \ action pedit munge ip ttl add 0xff pipe \ action mirred egress redirect dev veth0 In the example above, adding 0xff to this u8 field is actually decreasing it by one, since the operation is masked. Signed-off-by: Amir Vadai <amir@vadai.me> Reviewed-by: Or Gerlitz <ogerlitz@mellanox.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/uapi/linux/tc_act/tc_pedit.h')
-rw-r--r--include/uapi/linux/tc_act/tc_pedit.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/include/uapi/linux/tc_act/tc_pedit.h b/include/uapi/linux/tc_act/tc_pedit.h
index 22f19eeda997..143d2b31a316 100644
--- a/include/uapi/linux/tc_act/tc_pedit.h
+++ b/include/uapi/linux/tc_act/tc_pedit.h
@@ -20,6 +20,7 @@ enum {
enum {
TCA_PEDIT_KEY_EX_HTYPE = 1,
+ TCA_PEDIT_KEY_EX_CMD = 2,
__TCA_PEDIT_KEY_EX_MAX
};
#define TCA_PEDIT_KEY_EX_MAX (__TCA_PEDIT_KEY_EX_MAX - 1)
@@ -38,6 +39,13 @@ enum pedit_header_type {
};
#define TCA_PEDIT_HDR_TYPE_MAX (__PEDIT_HDR_TYPE_MAX - 1)
+enum pedit_cmd {
+ TCA_PEDIT_KEY_EX_CMD_SET = 0,
+ TCA_PEDIT_KEY_EX_CMD_ADD = 1,
+ __PEDIT_CMD_MAX,
+};
+#define TCA_PEDIT_CMD_MAX (__PEDIT_CMD_MAX - 1)
+
struct tc_pedit_key {
__u32 mask; /* AND */
__u32 val; /*XOR */