aboutsummaryrefslogtreecommitdiffstats
path: root/tools/lib/bpf/libbpf.h
diff options
context:
space:
mode:
authorJakub Kicinski <jakub.kicinski@netronome.com>2018-07-10 17:43:02 -0400
committerDaniel Borkmann <daniel@iogearbox.net>2018-07-11 16:13:34 -0400
commit07f2d4eac2a850fc9649b27aa935cdcd263fb1ff (patch)
treebfc4c4d61592997b01393ccc8df1c6becb5c2c64 /tools/lib/bpf/libbpf.h
parentf83fb22c6c68fdbc98c76291c9e12a40d1eb7ca5 (diff)
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 <jakub.kicinski@netronome.com> Reviewed-by: Quentin Monnet <quentin.monnet@netronome.com> Acked-by: Andrey Ignatov <rdna@fb.com> Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Diffstat (limited to 'tools/lib/bpf/libbpf.h')
-rw-r--r--tools/lib/bpf/libbpf.h6
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,
66/* Hide internal to user */ 66/* Hide internal to user */
67struct bpf_object; 67struct bpf_object;
68 68
69struct bpf_object_open_attr {
70 const char *file;
71 enum bpf_prog_type prog_type;
72};
73
69struct bpf_object *bpf_object__open(const char *path); 74struct bpf_object *bpf_object__open(const char *path);
75struct bpf_object *bpf_object__open_xattr(struct bpf_object_open_attr *attr);
70struct bpf_object *bpf_object__open_buffer(void *obj_buf, 76struct bpf_object *bpf_object__open_buffer(void *obj_buf,
71 size_t obj_buf_sz, 77 size_t obj_buf_sz,
72 const char *name); 78 const char *name);