Documentation ¶
Index ¶
- type ErrXDPLinkClose
- type XDPLink
- func (l *XDPLink) AddIPv4Redirect(addr *net.UDPAddr, cids ...[]byte) error
- func (l *XDPLink) Attach(iface *net.Interface) error
- func (l *XDPLink) AttachPort(port uint16) error
- func (l *XDPLink) Close() error
- func (l *XDPLink) DetachPort(port uint16) error
- func (l *XDPLink) ReadRejectedCID(fn func(cid []byte) error) error
- func (l *XDPLink) RemoveIPv4Redirect(cids ...[]byte) error
- func (l *XDPLink) SetReadDeadline(deadline time.Time) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ErrXDPLinkClose ¶
type ErrXDPLinkClose struct {
Errors []error
}
ErrXDPLinkClose is an error when closing fails (which can fail in multiple errors).
func (ErrXDPLinkClose) Error ¶
func (e ErrXDPLinkClose) Error() string
type XDPLink ¶
type XDPLink struct {
// contains filtered or unexported fields
}
XDPLink lets you interact with Quicpipe's eBPF XDP filter.
func Open ¶
Open loads the eBPF code. You should call Attach and AttachPort to load the code on an interface and activate it on a UDP port.
func (*XDPLink) AddIPv4Redirect ¶
AddIPv4Redirect adds the UDP address to the IPv4 redirect map of the eBPF filter for all of the provided CIDs. The UDP address is assumed to be IPv4.
func (*XDPLink) AttachPort ¶
AttachPort activates the eBPF filter on the provided UDP port on all attached interfaces.
func (*XDPLink) Close ¶
Close closes the eBPF XDP filter, releasing it from all attached interfaces.
func (*XDPLink) DetachPort ¶
DetachPort deactivates the eBPF filter on the provided UDP port on all attached interfaces.
func (*XDPLink) ReadRejectedCID ¶
ReadRejectedCID reads a single CID from the rejected CID ring buffer. It waits until the read dedline set with SetReadDeadline. Once a CID is available, the provided callback is called. The CID bytes are available only for the duration of the function!
func (*XDPLink) RemoveIPv4Redirect ¶
RemoveIPv4Redirect removes any redirects assigned to the provided CIDs.