diff options
author | Wang Nan | 2016-11-26 07:03:26 +0000 |
---|---|---|
committer | Arnaldo Carvalho de Melo | 2016-11-29 12:09:41 -0300 |
commit | 10931d2413478239bdceac5546cce85d7a497a4e (patch) | |
tree | 4697e2b409904b420ec00e04d01a186a781da106 /tools/lib/bpf/libbpf.h | |
parent | 9742da0150788e6ea7796372c3e643f876a49741 (diff) |
tools lib bpf: Add private field for bpf_object
Similar to other classes defined in libbpf.h (map and program), allow
'object' class has its own private data.
Signed-off-by: Wang Nan <wangnan0@huawei.com>
Acked-by: Alexei Starovoitov <ast@kernel.org>
Cc: He Kuang <hekuang@huawei.com>
Cc: Joe Stringer <joe@ovn.org>
Cc: Zefan Li <lizefan@huawei.com>
Cc: pi3orama@163.com
Link: http://lkml.kernel.org/r/20161126070354.141764-3-wangnan0@huawei.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools/lib/bpf/libbpf.h')
-rw-r--r-- | tools/lib/bpf/libbpf.h | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/tools/lib/bpf/libbpf.h b/tools/lib/bpf/libbpf.h index dd7a513efb10..0c0b0127e03e 100644 --- a/tools/lib/bpf/libbpf.h +++ b/tools/lib/bpf/libbpf.h @@ -79,6 +79,11 @@ struct bpf_object *bpf_object__next(struct bpf_object *prev); (pos) != NULL; \ (pos) = (tmp), (tmp) = bpf_object__next(tmp)) +typedef void (*bpf_object_clear_priv_t)(struct bpf_object *, void *); +int bpf_object__set_priv(struct bpf_object *obj, void *priv, + bpf_object_clear_priv_t clear_priv); +void *bpf_object__priv(struct bpf_object *prog); + /* Accessors of bpf_program. */ struct bpf_program; struct bpf_program *bpf_program__next(struct bpf_program *prog, |