blob: a7646554129299bff7ba189506bd51cea406ec1d [file] [log] [blame]
Wang Nane3ed2fe2015-07-01 02:14:03 +00001/*
2 * common eBPF ELF 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_BPF_H
9#define __BPF_BPF_H
10
11#include <linux/bpf.h>
12
13int bpf_create_map(enum bpf_map_type map_type, int key_size, int value_size,
14 int max_entries);
15
Wang Nan7bf98362015-07-01 02:14:06 +000016/* Recommend log buffer size */
17#define BPF_LOG_BUF_SIZE 65536
18int bpf_load_program(enum bpf_prog_type type, struct bpf_insn *insns,
19 size_t insns_cnt, char *license,
20 u32 kern_version, char *log_buf,
21 size_t log_buf_sz);
22
He Kuang43798bf2015-11-24 13:36:08 +000023int bpf_map_update_elem(int fd, void *key, void *value,
24 u64 flags);
Wang Nane3ed2fe2015-07-01 02:14:03 +000025#endif