tc

package
v1.11.0-cni-plu...-6617031 Latest Latest
Warning

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

Go to latest
Published: Nov 28, 2024 License: Apache-2.0, Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrDeviceNotFound = errors.New("device not found")
View Source
var ErrInterrupted = errors.New("dump interrupted")
View Source
var ErrNoTC = errors.New("no TC program attached")

Functions

func CleanUpProgramsAndPins

func CleanUpProgramsAndPins()

CleanUpProgramsAndPins makes a best effort to remove all our TC BPF programs.

func ConfigureProgram

func ConfigureProgram(m *libbpf.Map, iface string, globalData *libbpf.TcGlobalData) error

func EnsureQdisc

func EnsureQdisc(ifaceName string) (bool, error)

EnsureQdisc makes sure that qdisc is attached to the given interface

func ExecTC

func ExecTC(args ...string) (out string, err error)

func HasQdisc

func HasQdisc(ifaceName string) (bool, error)

func RemoveQdisc

func RemoveQdisc(ifaceName string) error

RemoveQdisc makes sure that there is no qdisc attached to the given interface

Types

type AttachPoint

type AttachPoint struct {
	bpf.AttachPoint

	LogFilter            string
	LogFilterIdx         int
	Type                 tcdefs.EndpointType
	ToOrFrom             tcdefs.ToOrFromEp
	HookLayoutV4         hook.Layout
	HookLayoutV6         hook.Layout
	HostIPv4             net.IP
	HostIPv6             net.IP
	HostTunnelIPv4       net.IP
	HostTunnelIPv6       net.IP
	IntfIPv4             net.IP
	IntfIPv6             net.IP
	FIB                  bool
	ToHostDrop           bool
	DSR                  bool
	DSROptoutCIDRs       bool
	TunnelMTU            uint16
	VXLANPort            uint16
	WgPort               uint16
	Wg6Port              uint16
	ExtToServiceConnmark uint32
	PSNATStart           uint16
	PSNATEnd             uint16
	RPFEnforceOption     uint8
	NATin                uint32
	NATout               uint32
	UDPOnly              bool
	RedirectPeer         bool
}

func (*AttachPoint) AttachProgram

func (ap *AttachPoint) AttachProgram() (bpf.AttachResult, error)

AttachProgram attaches a BPF program from a file to the TC attach point

func (*AttachPoint) Config

func (ap *AttachPoint) Config() string

func (*AttachPoint) ConfigureProgram

func (ap *AttachPoint) ConfigureProgram(m *libbpf.Map) error

func (*AttachPoint) DetachProgram

func (ap *AttachPoint) DetachProgram() error

func (*AttachPoint) IsAttached

func (ap *AttachPoint) IsAttached() (bool, error)

func (*AttachPoint) Log

func (ap *AttachPoint) Log() *log.Entry

func (*AttachPoint) ProgramID

func (ap *AttachPoint) ProgramID() (int, error)

TODO: we should try to not get the program ID via 'tc' binary and rather we should use libbpf to obtain it.

func (*AttachPoint) ProgramName

func (ap *AttachPoint) ProgramName() string

ProgramName returns the name of the program associated with this AttachPoint

type AttachResult

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

func (AttachResult) Handle

func (ar AttachResult) Handle() int

func (AttachResult) Prio

func (ar AttachResult) Prio() int

func (AttachResult) ProgID

func (ar AttachResult) ProgID() int

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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