Skip to content

Commit dd26b7f

Browse files
4astdavem330
authored andcommitted
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]>
1 parent 3084887 commit dd26b7f

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

tools/lib/bpf/libbpf.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1618,8 +1618,7 @@ int bpf_program__nth_fd(struct bpf_program *prog, int n)
16181618
return fd;
16191619
}
16201620

1621-
static void bpf_program__set_type(struct bpf_program *prog,
1622-
enum bpf_prog_type type)
1621+
void bpf_program__set_type(struct bpf_program *prog, enum bpf_prog_type type)
16231622
{
16241623
prog->type = type;
16251624
}

tools/lib/bpf/libbpf.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
#include <stdint.h>
2626
#include <stdbool.h>
2727
#include <sys/types.h> // for size_t
28+
#include <linux/bpf.h>
2829

2930
enum libbpf_errno {
3031
__LIBBPF_ERRNO__START = 4000,
@@ -185,6 +186,7 @@ int bpf_program__set_sched_cls(struct bpf_program *prog);
185186
int bpf_program__set_sched_act(struct bpf_program *prog);
186187
int bpf_program__set_xdp(struct bpf_program *prog);
187188
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);
188190

189191
bool bpf_program__is_socket_filter(struct bpf_program *prog);
190192
bool bpf_program__is_tracepoint(struct bpf_program *prog);

0 commit comments

Comments
 (0)