Files
xdp-project-bpf-examples/pkt-loop-filter/pkt-loop-filter.h
Toke Høiland-Jørgensen 070715cf1c Add pkt-loop-filter example
Add an example to filter looping packets on (for instance) a bond
interface, by recording the egress MAC+VLAN and dropping any packets that
come in on other (related) interfaces with the same MAC+VLAN.

Signed-off-by: Toke Høiland-Jørgensen <toke@redhat.com>
2022-05-20 14:53:14 +02:00

20 lines
317 B
C

#ifndef __PKT_LOOP_FILTER_H__
#define __PKT_LOOP_FILTER_H__
#define NS_PER_SEC 1000000000ULL
#define STATE_LIFETIME (10 * NS_PER_SEC)
struct pkt_loop_key {
__u8 src_mac[6];
__u16 src_vlan;
};
struct pkt_loop_data {
__u64 expiry_time;
__u32 ifindex;
__u32 drops;
};
#endif