diff options
| author | Jakub Kicinski <[email protected]> | 2018-07-10 21:43:02 +0000 |
|---|---|---|
| committer | Daniel Borkmann <[email protected]> | 2018-07-11 20:13:34 +0000 |
| commit | 07f2d4eac2a850fc9649b27aa935cdcd263fb1ff (patch) | |
| tree | bfc4c4d61592997b01393ccc8df1c6becb5c2c64 /tools/lib/bpf/libbpf.h | |
| parent | tools: libbpf: recognize offload neutral maps (diff) | |
| download | kernel-07f2d4eac2a850fc9649b27aa935cdcd263fb1ff.tar.gz kernel-07f2d4eac2a850fc9649b27aa935cdcd263fb1ff.zip | |
tools: libbpf: add extended attributes version of bpf_object__open()
Similarly to bpf_prog_load() users of bpf_object__open() may need
to specify the expected program type. Program type is needed at
open to avoid the kernel version check for program types which don't
require it.
Signed-off-by: Jakub Kicinski <[email protected]>
Reviewed-by: Quentin Monnet <[email protected]>
Acked-by: Andrey Ignatov <[email protected]>
Signed-off-by: Daniel Borkmann <[email protected]>
Diffstat (limited to 'tools/lib/bpf/libbpf.h')
| -rw-r--r-- | tools/lib/bpf/libbpf.h | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/tools/lib/bpf/libbpf.h b/tools/lib/bpf/libbpf.h index 749acf58a5da..e911ad32d02e 100644 --- a/tools/lib/bpf/libbpf.h +++ b/tools/lib/bpf/libbpf.h @@ -66,7 +66,13 @@ void libbpf_set_print(libbpf_print_fn_t warn, /* Hide internal to user */ struct bpf_object; +struct bpf_object_open_attr { + const char *file; + enum bpf_prog_type prog_type; +}; + struct bpf_object *bpf_object__open(const char *path); +struct bpf_object *bpf_object__open_xattr(struct bpf_object_open_attr *attr); struct bpf_object *bpf_object__open_buffer(void *obj_buf, size_t obj_buf_sz, const char *name); |
