libbpf: add ability to guess program type based on section name
authorRoman Gushchin <guro@fb.com>
Wed, 13 Dec 2017 15:18:51 +0000 (15:18 +0000)
committerDaniel Borkmann <daniel@iogearbox.net>
Thu, 14 Dec 2017 12:37:13 +0000 (13:37 +0100)
commit583c90097f7271ab90f149b52b9ac2098bf2cbb5
treee373de139565faec82b867167abd5c7aed7e4eac
parentf4e2298e63d24bb7f5cf0f56f72867973cb7e652
libbpf: add ability to guess program type based on section name

The bpf_prog_load() function will guess program type if it's not
specified explicitly. This functionality will be used to implement
loading of different programs without asking a user to specify
the program type. In first order it will be used by bpftool.

Signed-off-by: Roman Gushchin <guro@fb.com>
Cc: Alexei Starovoitov <ast@kernel.org>
Cc: Daniel Borkmann <daniel@iogearbox.net>
Cc: Jakub Kicinski <jakub.kicinski@netronome.com>
Cc: Martin KaFai Lau <kafai@fb.com>
Cc: Quentin Monnet <quentin.monnet@netronome.com>
Cc: David Ahern <dsahern@gmail.com>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
tools/lib/bpf/libbpf.c