xdp

package
v0.0.0-...-b764354 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 2, 2023 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Namespace = "enet"
	BpfFsPath = "/sys/fs/bpf"
)
View Source
const (
	EnetProgName = "enet_prog"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Hook

type Hook struct {
	// contains filtered or unexported fields
}

Hook provides a set of operations that allow for managing the execution of the XDP program including attaching it on the network interface, or removing the program from the interface.

func NewHook

func NewHook(pinPath string) (*Hook, error)

NewHook constructs a new instance of the XDP hook from provided XDP code.

func (*Hook) Attach

func (h *Hook) Attach(device string, mode link.XDPAttachFlags) error

Attach loads the XDP program to specified interface.

func (*Hook) BPFObject

func (h *Hook) BPFObject() bpfObjects

func (*Hook) Close

func (h *Hook) Close() error

Close closes the underlying eBPF module by disposing any allocated resources.

func (*Hook) Remove

func (h *Hook) Remove() error

Remove unloads the XDP program from the interface.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL