Re: [PATCH net-next 4/6] tools/lib/bpf: expose bpf_program__set_type()
From: Wangnan (F) <hidden>
Date: 2017-03-31 02:49:08
From: Wangnan (F) <hidden>
Date: 2017-03-31 02:49:08
On 2017/3/31 10:37, Alexei Starovoitov wrote:
On 3/30/17 7:33 PM, Wangnan (F) wrote:quoted
quoted
+void bpf_program__set_type(struct bpf_program *prog, enum bpf_prog_type type);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. Thank you.