bpf tools: Open eBPF object file and do basic validation
[deliverable/linux.git] / tools / lib / bpf / libbpf.h
CommitLineData
1b76c13e
WN
1/*
2 * Common eBPF ELF object loading operations.
3 *
4 * Copyright (C) 2013-2015 Alexei Starovoitov <ast@kernel.org>
5 * Copyright (C) 2015 Wang Nan <wangnan0@huawei.com>
6 * Copyright (C) 2015 Huawei Inc.
7 */
8#ifndef __BPF_LIBBPF_H
9#define __BPF_LIBBPF_H
10
1a5e3fb1
WN
11#include <stdio.h>
12
b3f59d66
WN
13/*
14 * In include/linux/compiler-gcc.h, __printf is defined. However
15 * it should be better if libbpf.h doesn't depend on Linux header file.
16 * So instead of __printf, here we use gcc attribute directly.
17 */
18typedef int (*libbpf_print_fn_t)(const char *, ...)
19 __attribute__((format(printf, 1, 2)));
20
21void libbpf_set_print(libbpf_print_fn_t warn,
22 libbpf_print_fn_t info,
23 libbpf_print_fn_t debug);
24
1a5e3fb1
WN
25/* Hide internal to user */
26struct bpf_object;
27
28struct bpf_object *bpf_object__open(const char *path);
29void bpf_object__close(struct bpf_object *object);
30
1b76c13e 31#endif
This page took 0.034817 seconds and 5 git commands to generate.