diff options
author | Alexei Starovoitov <ast@plumgrid.com> | 2015-03-26 22:53:57 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2015-03-29 16:26:54 -0400 |
commit | 608cd71a9c7c9db76e78a792c5a4101e12fea43f (patch) | |
tree | 9824e0795f923a6370e53799f84e8ad13764cb23 /include | |
parent | 7836b16c0dd1d3039ccc35ceeff6d75401fbba8c (diff) |
tc: bpf: generalize pedit action
existing TC action 'pedit' can munge any bits of the packet.
Generalize it for use in bpf programs attached as cls_bpf and act_bpf via
bpf_skb_store_bytes() helper function.
Signed-off-by: Alexei Starovoitov <ast@plumgrid.com>
Reviewed-by: Jiri Pirko <jiri@resnulli.us>
Acked-by: Daniel Borkmann <daniel@iogearbox.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include')
-rw-r--r-- | include/linux/bpf.h | 1 | ||||
-rw-r--r-- | include/uapi/linux/bpf.h | 1 |
2 files changed, 2 insertions, 0 deletions
diff --git a/include/linux/bpf.h b/include/linux/bpf.h index 280a315de8d6..d5cda067115a 100644 --- a/include/linux/bpf.h +++ b/include/linux/bpf.h | |||
@@ -59,6 +59,7 @@ enum bpf_arg_type { | |||
59 | ARG_PTR_TO_STACK, /* any pointer to eBPF program stack */ | 59 | ARG_PTR_TO_STACK, /* any pointer to eBPF program stack */ |
60 | ARG_CONST_STACK_SIZE, /* number of bytes accessed from stack */ | 60 | ARG_CONST_STACK_SIZE, /* number of bytes accessed from stack */ |
61 | 61 | ||
62 | ARG_PTR_TO_CTX, /* pointer to context */ | ||
62 | ARG_ANYTHING, /* any (initialized) argument is ok */ | 63 | ARG_ANYTHING, /* any (initialized) argument is ok */ |
63 | }; | 64 | }; |
64 | 65 | ||
diff --git a/include/uapi/linux/bpf.h b/include/uapi/linux/bpf.h index 27dc4ec58840..74aab6e0d964 100644 --- a/include/uapi/linux/bpf.h +++ b/include/uapi/linux/bpf.h | |||
@@ -168,6 +168,7 @@ enum bpf_func_id { | |||
168 | BPF_FUNC_map_delete_elem, /* int map_delete_elem(&map, &key) */ | 168 | BPF_FUNC_map_delete_elem, /* int map_delete_elem(&map, &key) */ |
169 | BPF_FUNC_get_prandom_u32, /* u32 prandom_u32(void) */ | 169 | BPF_FUNC_get_prandom_u32, /* u32 prandom_u32(void) */ |
170 | BPF_FUNC_get_smp_processor_id, /* u32 raw_smp_processor_id(void) */ | 170 | BPF_FUNC_get_smp_processor_id, /* u32 raw_smp_processor_id(void) */ |
171 | BPF_FUNC_skb_store_bytes, /* int skb_store_bytes(skb, offset, from, len) */ | ||
171 | __BPF_FUNC_MAX_ID, | 172 | __BPF_FUNC_MAX_ID, |
172 | }; | 173 | }; |
173 | 174 | ||