diff options
author | Martin KaFai Lau <kafai@fb.com> | 2017-06-05 21:15:53 +0200 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2017-06-06 21:41:24 +0200 |
commit | 95b9afd3987f91c09151158279e165276a95c597 (patch) | |
tree | f71901b7ceeebc924ad0c68184f4cd4f96511c7c /tools/lib/bpf/bpf.h | |
parent | bpf: Add BPF_OBJ_GET_INFO_BY_FD (diff) | |
download | linux-95b9afd3987f91c09151158279e165276a95c597.tar.xz linux-95b9afd3987f91c09151158279e165276a95c597.zip |
bpf: Test for bpf ID
Add test to exercise the bpf_prog/map id generation,
bpf_(prog|map)_get_next_id(), bpf_(prog|map)_get_fd_by_id() and
bpf_get_obj_info_by_fd().
Signed-off-by: Martin KaFai Lau <kafai@fb.com>
Acked-by: Alexei Starovoitov <ast@fb.com>
Acked-by: Daniel Borkmann <daniel@iogearbox.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'tools/lib/bpf/bpf.h')
-rw-r--r-- | tools/lib/bpf/bpf.h | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/tools/lib/bpf/bpf.h b/tools/lib/bpf/bpf.h index 972bd8333eb7..16de44a14b48 100644 --- a/tools/lib/bpf/bpf.h +++ b/tools/lib/bpf/bpf.h @@ -54,5 +54,10 @@ int bpf_prog_detach(int attachable_fd, enum bpf_attach_type type); int bpf_prog_test_run(int prog_fd, int repeat, void *data, __u32 size, void *data_out, __u32 *size_out, __u32 *retval, __u32 *duration); +int bpf_prog_get_next_id(__u32 start_id, __u32 *next_id); +int bpf_map_get_next_id(__u32 start_id, __u32 *next_id); +int bpf_prog_get_fd_by_id(__u32 id); +int bpf_map_get_fd_by_id(__u32 id); +int bpf_obj_get_info_by_fd(int prog_fd, void *info, __u32 *info_len); #endif |