diff options
| author | Alexei Starovoitov <[email protected]> | 2017-03-31 04:45:40 +0000 |
|---|---|---|
| committer | David S. Miller <[email protected]> | 2017-04-01 19:45:57 +0000 |
| commit | dd26b7f54a08fd1a9fd804b51b9fce8e16628349 (patch) | |
| tree | d1bc1b8e946bbbaadd726ac30ef2b01a9c67207d /tools/lib | |
| parent | tools/lib/bpf: add support for BPF_PROG_TEST_RUN command (diff) | |
| download | kernel-dd26b7f54a08fd1a9fd804b51b9fce8e16628349.tar.gz kernel-dd26b7f54a08fd1a9fd804b51b9fce8e16628349.zip | |
tools/lib/bpf: expose bpf_program__set_type()
expose bpf_program__set_type() to set program type
Signed-off-by: Alexei Starovoitov <[email protected]>
Acked-by: Daniel Borkmann <[email protected]>
Acked-by: Martin KaFai Lau <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
Diffstat (limited to 'tools/lib')
| -rw-r--r-- | tools/lib/bpf/libbpf.c | 3 | ||||
| -rw-r--r-- | tools/lib/bpf/libbpf.h | 2 |
2 files changed, 3 insertions, 2 deletions
diff --git a/tools/lib/bpf/libbpf.c b/tools/lib/bpf/libbpf.c index ac6eb863b2a4..1a2c07eb7795 100644 --- a/tools/lib/bpf/libbpf.c +++ b/tools/lib/bpf/libbpf.c @@ -1618,8 +1618,7 @@ int bpf_program__nth_fd(struct bpf_program *prog, int n) return fd; } -static void bpf_program__set_type(struct bpf_program *prog, - enum bpf_prog_type type) +void bpf_program__set_type(struct bpf_program *prog, enum bpf_prog_type type) { prog->type = type; } diff --git a/tools/lib/bpf/libbpf.h b/tools/lib/bpf/libbpf.h index b30394f9947a..32c7252f734e 100644 --- a/tools/lib/bpf/libbpf.h +++ b/tools/lib/bpf/libbpf.h @@ -25,6 +25,7 @@ #include <stdint.h> #include <stdbool.h> #include <sys/types.h> // for size_t +#include <linux/bpf.h> enum libbpf_errno { __LIBBPF_ERRNO__START = 4000, @@ -185,6 +186,7 @@ int bpf_program__set_sched_cls(struct bpf_program *prog); int bpf_program__set_sched_act(struct bpf_program *prog); int bpf_program__set_xdp(struct bpf_program *prog); int bpf_program__set_perf_event(struct bpf_program *prog); +void bpf_program__set_type(struct bpf_program *prog, enum bpf_prog_type type); bool bpf_program__is_socket_filter(struct bpf_program *prog); bool bpf_program__is_tracepoint(struct bpf_program *prog); |
