ebpf

package
v0.3.0-rc.1 Latest Latest
Warning

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

Go to latest
Published: Oct 6, 2026 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BpfConn

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

func (*BpfConn) Close

func (bc *BpfConn) Close() error

func (*BpfConn) LocalAddr

func (bc *BpfConn) LocalAddr() net.Addr

func (*BpfConn) Read

func (bc *BpfConn) Read(b []byte) (n int, err error)

func (*BpfConn) RemoteAddr

func (bc *BpfConn) RemoteAddr() net.Addr

func (*BpfConn) SetDeadline

func (bc *BpfConn) SetDeadline(t time.Time) error

func (*BpfConn) SetReadDeadline

func (bc *BpfConn) SetReadDeadline(t time.Time) error

func (*BpfConn) SetWriteDeadline

func (bc *BpfConn) SetWriteDeadline(t time.Time) error

func (*BpfConn) Write

func (bc *BpfConn) Write(b []byte) (n int, err error)

type BpfCount

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

BpfCount employs ratelimiting using an EBPF layer. It requires root priviliges to work.

func NewBPFCount

func NewBPFCount(iface *net.Interface) (*BpfCount, error)

func (*BpfCount) Attach

func (bc *BpfCount) Attach(conn net.Conn, id uuid.UUID, addr string) (net.Conn, error)

func (*BpfCount) AttachmentState added in v0.3.0

func (bc *BpfCount) AttachmentState() string

AttachmentState reads the two owned TCX links, without sending packets or changing their configuration. Link.Info can succeed after detach: the kernel then reports ifindex zero. Presence requires the expected hook and program on the configured interface. It proves attachment at observation time, not that traffic is policed. Sessions finish before the node closes these handles.

func (*BpfCount) Close

func (bc *BpfCount) Close() error

func (*BpfCount) DeleteExecLimit

func (bc *BpfCount) DeleteExecLimit(id uuid.UUID) error

func (*BpfCount) DeleteLimit

func (bc *BpfCount) DeleteLimit(addr netutil.IPv6, id uuid.UUID) error

func (*BpfCount) Detach

func (bc *BpfCount) Detach(addr string, id uuid.UUID, ipv6 netutil.IPv6) error

func (*BpfCount) SetExecLimit

func (bc *BpfCount) SetExecLimit(id uuid.UUID, limit bitrate.Bitrate) error

func (*BpfCount) SetLimit

func (bc *BpfCount) SetLimit(addr string, id uuid.UUID, limit bitrate.Bitrate) error

func (*BpfCount) Type

func (f *BpfCount) Type() string

Jump to

Keyboard shortcuts

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