summaryrefslogtreecommitdiffstats
path: root/tools/lib/bpf/libbpf_errno.c
diff options
context:
space:
mode:
authorYonghong Song2018-09-06 01:58:05 +0200
committerAlexei Starovoitov2018-09-07 07:34:08 +0200
commit36f1678d9e0b5d2e0236046d9659e0348b4719a8 (patch)
tree61179eacb8d5baa5f2c9e6331da3f919de1e4b1d /tools/lib/bpf/libbpf_errno.c
parenttools/bpf: move bpf/lib netlink related functions into a new file (diff)
downloadkernel-qcow2-linux-36f1678d9e0b5d2e0236046d9659e0348b4719a8.tar.gz
kernel-qcow2-linux-36f1678d9e0b5d2e0236046d9659e0348b4719a8.tar.xz
kernel-qcow2-linux-36f1678d9e0b5d2e0236046d9659e0348b4719a8.zip
tools/bpf: add more netlink functionalities in lib/bpf
This patch added a few netlink attribute parsing functions and the netlink API functions to query networking links, tc classes, tc qdiscs and tc filters. For example, the following API is to get networking links: int nl_get_link(int sock, unsigned int nl_pid, dump_nlmsg_t dump_link_nlmsg, void *cookie); Note that when the API is called, the user also provided a callback function with the following signature: int (*dump_nlmsg_t)(void *cookie, void *msg, struct nlattr **tb); The "cookie" is the parameter the user passed to the API and will be available for the callback function. The "msg" is the information about the result, e.g., ifinfomsg or tcmsg. The "tb" is the parsed netlink attributes. Signed-off-by: Yonghong Song <yhs@fb.com> Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Diffstat (limited to 'tools/lib/bpf/libbpf_errno.c')
-rw-r--r--tools/lib/bpf/libbpf_errno.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/tools/lib/bpf/libbpf_errno.c b/tools/lib/bpf/libbpf_errno.c
index d9ba851bd7f9..2464ade3b326 100644
--- a/tools/lib/bpf/libbpf_errno.c
+++ b/tools/lib/bpf/libbpf_errno.c
@@ -42,6 +42,7 @@ static const char *libbpf_strerror_table[NR_ERRNO] = {
[ERRCODE_OFFSET(PROGTYPE)] = "Kernel doesn't support this program type",
[ERRCODE_OFFSET(WRNGPID)] = "Wrong pid in netlink message",
[ERRCODE_OFFSET(INVSEQ)] = "Invalid netlink sequence",
+ [ERRCODE_OFFSET(NLPARSE)] = "Incorrect netlink message parsing",
};
int libbpf_strerror(int err, char *buf, size_t size)