diff options
author | Alexei Starovoitov <ast@fb.com> | 2017-03-31 00:45:40 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2017-04-01 15:45:57 -0400 |
commit | dd26b7f54a08fd1a9fd804b51b9fce8e16628349 (patch) | |
tree | d1bc1b8e946bbbaadd726ac30ef2b01a9c67207d /tools/lib | |
parent | 3084887378f5271daedd52cc3372cb8011ad39b6 (diff) |
tools/lib/bpf: expose bpf_program__set_type()
expose bpf_program__set_type() to set program type
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Acked-by: Daniel Borkmann <daniel@iogearbox.net>
Acked-by: Martin KaFai Lau <kafai@fb.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
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) | |||
1618 | return fd; | 1618 | return fd; |
1619 | } | 1619 | } |
1620 | 1620 | ||
1621 | static void bpf_program__set_type(struct bpf_program *prog, | 1621 | void bpf_program__set_type(struct bpf_program *prog, enum bpf_prog_type type) |
1622 | enum bpf_prog_type type) | ||
1623 | { | 1622 | { |
1624 | prog->type = type; | 1623 | prog->type = type; |
1625 | } | 1624 | } |
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 @@ | |||
25 | #include <stdint.h> | 25 | #include <stdint.h> |
26 | #include <stdbool.h> | 26 | #include <stdbool.h> |
27 | #include <sys/types.h> // for size_t | 27 | #include <sys/types.h> // for size_t |
28 | #include <linux/bpf.h> | ||
28 | 29 | ||
29 | enum libbpf_errno { | 30 | enum libbpf_errno { |
30 | __LIBBPF_ERRNO__START = 4000, | 31 | __LIBBPF_ERRNO__START = 4000, |
@@ -185,6 +186,7 @@ int bpf_program__set_sched_cls(struct bpf_program *prog); | |||
185 | int bpf_program__set_sched_act(struct bpf_program *prog); | 186 | int bpf_program__set_sched_act(struct bpf_program *prog); |
186 | int bpf_program__set_xdp(struct bpf_program *prog); | 187 | int bpf_program__set_xdp(struct bpf_program *prog); |
187 | int bpf_program__set_perf_event(struct bpf_program *prog); | 188 | int bpf_program__set_perf_event(struct bpf_program *prog); |
189 | void bpf_program__set_type(struct bpf_program *prog, enum bpf_prog_type type); | ||
188 | 190 | ||
189 | bool bpf_program__is_socket_filter(struct bpf_program *prog); | 191 | bool bpf_program__is_socket_filter(struct bpf_program *prog); |
190 | bool bpf_program__is_tracepoint(struct bpf_program *prog); | 192 | bool bpf_program__is_tracepoint(struct bpf_program *prog); |