Florian Westphal <fw@xxxxxxxxx> writes: > Add new api function: bpf_program__attach_netfilter. > > It takes a bpf program (netfilter type), and a pointer to a option struct > that contains the desired attachment (protocol family, priority, hook > location, ...). > > It returns a pointer to a 'bpf_link' structure or NULL on error. > > Next patch adds new netfilter_basic test that uses this function to > attach a program to a few pf/hook/priority combinations. > > v2: change name and use bpf_link_create. > > Suggested-by: Andrii Nakryiko <andrii.nakryiko@xxxxxxxxx> > Link: https://lore.kernel.org/bpf/CAEf4BzZrmUv27AJp0dDxBDMY_B8e55-wLs8DUKK69vCWsCG_pQ@xxxxxxxxxxxxxx/ > Link: https://lore.kernel.org/bpf/CAEf4BzZ69YgrQW7DHCJUT_X+GqMq_ZQQPBwopaJJVGFD5=d5Vg@xxxxxxxxxxxxxx/ > Signed-off-by: Florian Westphal <fw@xxxxxxxxx> Reviewed-by: Toke Høiland-Jørgensen <toke@xxxxxxxxxx>