On 2017/3/31 10:37, Alexei Starovoitov wrote:
On 3/30/17 7:33 PM, Wangnan (F) wrote:
+void bpf_program__set_type(struct bpf_program *prog, enum
This makes libbpf.h depend on uapi/linux/bpf.h (because of enum
bpf_prog_type), which is not always available.
What about defining another enum inside libbpf.h?
how about just including bpf.h? or making it 'int' instead of enum?
Including either kernel header into libbpf.h makes a lot of trouble,
because kernel header and uapi have many other things we don't need
and may conflict with existing code.
Making it 'int' looks like a backdoor. We still need macro to define
each program type.