Reputation: 45
Can eBPF maps be used to share information between two functions?
For example: get process name from one function; and if processname == "something"
drop the packet using XDP.
An example would be appreciated.
Upvotes: 0
Views: 574
Reputation: 9114
Adding two reference links to pchaigno's answer, ebpf.io and Cilium's BPF and XDP reference guide.
Upvotes: 1
Reputation: 13063
BPF maps are used to retain information between two executions of BPF programs. So what you're describing is one possible use case.
Examples of map usage can be found in the Linux samples and in the bcc examples.
Upvotes: 3