aboutsummaryrefslogtreecommitdiffstats
path: root/tools/lib/bpf/libbpf.h
diff options
context:
space:
mode:
authorAndrii Nakryiko <[email protected]>2019-10-21 03:38:57 +0000
committerDaniel Borkmann <[email protected]>2019-10-21 12:49:12 +0000
commitf1eead9e3ceef67b98be4b55ed1bfcfa4497b7db (patch)
treea07798031fd8a292c208edb054e46d24d44c6bad /tools/lib/bpf/libbpf.h
parenttools: Sync if_link.h (diff)
downloadkernel-f1eead9e3ceef67b98be4b55ed1bfcfa4497b7db.tar.gz
kernel-f1eead9e3ceef67b98be4b55ed1bfcfa4497b7db.zip
libbpf: Add bpf_program__get_{type, expected_attach_type) APIs
There are bpf_program__set_type() and bpf_program__set_expected_attach_type(), but no corresponding getters, which seems rather incomplete. Fix this. Signed-off-by: Andrii Nakryiko <[email protected]> Signed-off-by: Daniel Borkmann <[email protected]> Link: https://lore.kernel.org/bpf/[email protected]
Diffstat (limited to 'tools/lib/bpf/libbpf.h')
-rw-r--r--tools/lib/bpf/libbpf.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/tools/lib/bpf/libbpf.h b/tools/lib/bpf/libbpf.h
index 53ce212764e0..0fdf086beba7 100644
--- a/tools/lib/bpf/libbpf.h
+++ b/tools/lib/bpf/libbpf.h
@@ -302,8 +302,13 @@ LIBBPF_API int bpf_program__set_sched_cls(struct bpf_program *prog);
LIBBPF_API int bpf_program__set_sched_act(struct bpf_program *prog);
LIBBPF_API int bpf_program__set_xdp(struct bpf_program *prog);
LIBBPF_API int bpf_program__set_perf_event(struct bpf_program *prog);
+
+LIBBPF_API enum bpf_prog_type bpf_program__get_type(struct bpf_program *prog);
LIBBPF_API void bpf_program__set_type(struct bpf_program *prog,
enum bpf_prog_type type);
+
+LIBBPF_API enum bpf_attach_type
+bpf_program__get_expected_attach_type(struct bpf_program *prog);
LIBBPF_API void
bpf_program__set_expected_attach_type(struct bpf_program *prog,
enum bpf_attach_type type);