tools/bpftool: Remove libbpf_internal.h usage in bpftool
authorAndrii Nakryiko <andriin@fb.com>
Wed, 19 Aug 2020 01:36:05 +0000 (18:36 -0700)
committerAlexei Starovoitov <ast@kernel.org>
Wed, 19 Aug 2020 01:38:25 +0000 (18:38 -0700)
commit7084566a236fbc98beb11430d8d67dd08b2ac151
treeaadfd16122367ca5ea11b4084d12007d8c47ad58
parent029258d7b22894fabcecb1626e1b87d18a6823f4
tools/bpftool: Remove libbpf_internal.h usage in bpftool

Most netlink-related functions were unique to bpftool usage, so I moved them
into net.c. Few functions are still used by both bpftool and libbpf itself
internally, so I've copy-pasted them (libbpf_nl_get_link,
libbpf_netlink_open). It's a bit of duplication of code, but better separation
of libbpf as a library with public API and bpftool, relying on unexposed
functions in libbpf.

Signed-off-by: Andrii Nakryiko <andriin@fb.com>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Link: https://lore.kernel.org/bpf/20200819013607.3607269-3-andriin@fb.com
tools/bpf/bpftool/gen.c
tools/bpf/bpftool/net.c
tools/lib/bpf/libbpf_internal.h
tools/lib/bpf/netlink.c