Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Filter ¶
type Filter struct {
// contains filtered or unexported fields
}
Filter is a loaded XDP program and its maps. Close detaches it.
func Attach ¶
Attach loads the XDP filter onto ifaceName. Driver mode first, generic (SKB) as fallback.
func (*Filter) Ban ¶
Ban pins addr until ttl elapses (monotonic clock, same as BPF): the address itself for IPv4, its /64 for IPv6, which is what one user usually holds. ttl <= 0 is forever. XDP then drops that source before its next handshake.
func (*Filter) Mode ¶
Mode is how the filter attached: driver (in the NIC driver, before the kernel allocates for a packet) or generic (after, slower).
func (*Filter) SetBlock ¶
SetBlock replaces the permanent drop list (expire_ns == 0). Runtime bans (expire_ns != 0) stay. The XDP program keeps running.
func (*Filter) SetSYNRate ¶
SetSYNRate changes the SYN limit while XDP runs. Sources keep the tokens they have; they refill at the new rate.