summaryrefslogtreecommitdiffstats
path: root/tools/lib/bpf/libbpf.h
diff options
context:
space:
mode:
authorEric Leblond <eric@regit.org>2018-01-30 21:55:01 +0100
committerAlexei Starovoitov <ast@kernel.org>2018-02-02 17:53:48 -0800
commit949abbe88436c000cc63fce2bdfeb48b7d06a7df (patch)
tree0c92cc22fd100260e510f79695e64dbb554eeb8d /tools/lib/bpf/libbpf.h
parentdc2b9f19e3bdaa87a7c3d123b8bba8a42d96d942 (diff)
downloadlinux-949abbe88436c000cc63fce2bdfeb48b7d06a7df.tar.gz
linux-949abbe88436c000cc63fce2bdfeb48b7d06a7df.tar.bz2
linux-949abbe88436c000cc63fce2bdfeb48b7d06a7df.zip
libbpf: add function to setup XDP
Most of the code is taken from set_link_xdp_fd() in bpf_load.c and slightly modified to be library compliant. Signed-off-by: Eric Leblond <eric@regit.org> Acked-by: Alexei Starovoitov <ast@kernel.org> Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Diffstat (limited to 'tools/lib/bpf/libbpf.h')
-rw-r--r--tools/lib/bpf/libbpf.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/tools/lib/bpf/libbpf.h b/tools/lib/bpf/libbpf.h
index 6e20003109e0..e42f96900318 100644
--- a/tools/lib/bpf/libbpf.h
+++ b/tools/lib/bpf/libbpf.h
@@ -42,6 +42,8 @@ enum libbpf_errno {
LIBBPF_ERRNO__PROG2BIG, /* Program too big */
LIBBPF_ERRNO__KVER, /* Incorrect kernel version */
LIBBPF_ERRNO__PROGTYPE, /* Kernel doesn't support this program type */
+ LIBBPF_ERRNO__WRNGPID, /* Wrong pid in netlink message */
+ LIBBPF_ERRNO__INVSEQ, /* Invalid netlink sequence */
__LIBBPF_ERRNO__END,
};
@@ -246,4 +248,6 @@ long libbpf_get_error(const void *ptr);
int bpf_prog_load(const char *file, enum bpf_prog_type type,
struct bpf_object **pobj, int *prog_fd);
+
+int bpf_set_link_xdp_fd(int ifindex, int fd, __u32 flags);
#endif