dropbox / goebpf

Library to work with eBPF programs from Go
Other
1.14k stars 85 forks source link

adding bpf_fib_lookup struct and enriching xdp_md struct #40

Closed bersoare closed 4 years ago

bersoare commented 4 years ago

added ingress_ifindex, rx_queue_index, egress_ifindex fields to xdp_md struct (https://elixir.bootlin.com/linux/latest/source/include/uapi/linux/bpf.h#L3909) adjusted argument types for bpf_redirect_map prototype (https://man7.org/linux/man-pages/man7/bpf-helpers.7.html) added struct bpf_fib_lookup, as well as the constants for flags and return codes (https://elixir.bootlin.com/linux/latest/source/include/uapi/linux/bpf.h#L4303) added simple example of bpf_fib_lookup and bpf_redirect_map used in conjunction

bersoare commented 4 years ago

thanks for the feedback! just adjusted formatting, added comments and did a small change to the kernel code

waynr commented 3 years ago

@bersoare i was just looking into this example and don't see examples/xdp/bpf_redirect_map/bpf_redirect_map being used anywhere, was that intentionally included in this PR? If so, how/where is it used?

bersoare commented 3 years ago

hey @waynr ,

thanks for pointing out. that is the compiled binary, i included it unintentionally. i will go ahead remove it