From c5dcf2c8ea0a104143f6ffdcb8ef2816c1f2cc33 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Maciej=20=C5=BBenczykowski?= Date: Tue, 27 Sep 2022 23:13:21 +0000 Subject: [PATCH] add bpf_for_each_map_elem() helper definition MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit See 5.12+ kernel's include/uapi/linux/bpf.h (note that since bpf is 64-bit, int and long are the same thing) Test: TreeHugger Signed-off-by: Maciej Żenczykowski Change-Id: Ib340a619645ad5ab8e41ff76cb7b51671f496bc5 --- staticlibs/native/bpf_headers/include/bpf/bpf_helpers.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/staticlibs/native/bpf_headers/include/bpf/bpf_helpers.h b/staticlibs/native/bpf_headers/include/bpf/bpf_helpers.h index 35d9f31d1e..6eb8aa7f45 100644 --- a/staticlibs/native/bpf_headers/include/bpf/bpf_helpers.h +++ b/staticlibs/native/bpf_headers/include/bpf/bpf_helpers.h @@ -138,6 +138,10 @@ static int (*bpf_map_update_elem_unsafe)(const struct bpf_map_def* map, const vo static int (*bpf_map_delete_elem_unsafe)(const struct bpf_map_def* map, const void* key) = (void*)BPF_FUNC_map_delete_elem; +static int (*bpf_for_each_map_elem)(const struct bpf_map_def* map, void *callback_fn, + void *callback_ctx, unsigned long long flags) = (void*) + BPF_FUNC_for_each_map_elem; + #define BPF_ANNOTATE_KV_PAIR(name, type_key, type_val) \ struct ____btf_map_##name { \ type_key key; \