libbpf

package
v1.11.0-cni-plu...-5eac417 Latest Latest
Warning

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

Go to latest
Published: Mar 12, 2025 License: Apache-2.0, Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// Set when IPv6 is enabled to configure bpf dataplane accordingly
	GlobalsRPFOptionEnabled uint32 = C.CALI_GLOBALS_RPF_OPTION_ENABLED
	GlobalsRPFOptionStrict  uint32 = C.CALI_GLOBALS_RPF_OPTION_STRICT
	GlobalsNoDSRCidrs       uint32 = C.CALI_GLOBALS_NO_DSR_CIDRS
	GlobalsLoUDPOnly        uint32 = C.CALI_GLOBALS_LO_UDP_ONLY
	GlobalsRedirectPeer     uint32 = C.CALI_GLOBALS_REDIRECT_PEER
	GlobalsFlowLogsEnabled  uint32 = C.CALI_GLOBALS_FLOWLOGS_ENABLED
)

Variables

This section is empty.

Functions

func CreateQDisc

func CreateQDisc(ifName string) error

func DetachClassifier

func DetachClassifier(ifindex, handle, pref int, ingress bool) error

func DetachXDP

func DetachXDP(ifName string, mode uint) error

func GetXDPProgramID

func GetXDPProgramID(ifName string) (int, error)

func NumPossibleCPUs

func NumPossibleCPUs() (int, error)

func ObjGet

func ObjGet(path string) (int, error)

func ObjPin

func ObjPin(fd int, path string) error

func QueryClassifier

func QueryClassifier(ifindex, handle, pref int, ingress bool) (int, error)

func RemoveQDisc

func RemoveQDisc(ifName string) error

Types

type CTCleanupGlobalData

type CTCleanupGlobalData struct {
	CreationGracePeriod time.Duration
	TCPSynSent          time.Duration
	TCPEstablished      time.Duration
	TCPFinsSeen         time.Duration
	TCPResetSeen        time.Duration
	UDPTimeout          time.Duration
	GenericTimeout      time.Duration
	ICMPTimeout         time.Duration
}

func (*CTCleanupGlobalData) Set

func (c *CTCleanupGlobalData) Set(m *Map) error

type CTLBGlobalData

type CTLBGlobalData struct {
	UDPNotSeen time.Duration
	ExcludeUDP bool
}

func (*CTLBGlobalData) Set

func (c *CTLBGlobalData) Set(m *Map) error

type GlobalData

type GlobalData interface {
	Set(m *Map) error
}
type Link struct {
	// contains filtered or unexported fields
}

func (*Link) Close

func (l *Link) Close() error

type Map

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

func (*Map) IsJumpMap

func (m *Map) IsJumpMap() bool

func (*Map) IsMapInternal

func (m *Map) IsMapInternal() bool

func (*Map) KeySize

func (m *Map) KeySize() int

func (*Map) MaxEntries

func (m *Map) MaxEntries() int

func (*Map) Name

func (m *Map) Name() string

func (*Map) NextMap

func (m *Map) NextMap() (*Map, error)

NextMap returns the successive maps given the first map. Returns nil, no error at the end of the list.

func (*Map) SetPinPath

func (m *Map) SetPinPath(path string) error

func (*Map) SetSize

func (m *Map) SetSize(size int) error

func (*Map) Type

func (m *Map) Type() int

func (*Map) ValueSize

func (m *Map) ValueSize() int

type Obj

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

func OpenObject

func OpenObject(filename string) (*Obj, error)

func (*Obj) AttachCGroup

func (o *Obj) AttachCGroup(cgroup, progName string) (*Link, error)

func (*Obj) AttachClassifier

func (o *Obj) AttachClassifier(secName, ifName string, ingress bool, prio int) (int, int, int, error)

AttachClassifier return the program id and pref and handle of the qdisc

func (*Obj) AttachXDP

func (o *Obj) AttachXDP(ifName, progName string, oldID int, mode uint) (int, error)

func (*Obj) Close

func (o *Obj) Close() error

func (*Obj) FirstMap

func (o *Obj) FirstMap() (*Map, error)

FirstMap returns first bpf map of the object. Returns error if the map is nil.

func (*Obj) Load

func (o *Obj) Load() error

func (*Obj) Pin

func (o *Obj) Pin(path string) error

func (*Obj) PinMaps

func (o *Obj) PinMaps(path string) error

func (*Obj) PinPrograms

func (o *Obj) PinPrograms(path string) error

func (*Obj) ProgramFD

func (o *Obj) ProgramFD(secname string) (int, error)

func (*Obj) Unpin

func (o *Obj) Unpin(path string) error

func (*Obj) UnpinPrograms

func (o *Obj) UnpinPrograms(path string) error

func (*Obj) UpdateJumpMap

func (o *Obj) UpdateJumpMap(mapName, progName string, mapIndex int) error

type QdiskHook

type QdiskHook string
const (
	QdiskIngress QdiskHook = "ingress"
	QdiskEgress  QdiskHook = "egress"
)

type TcGlobalData

type TcGlobalData struct {
	IfaceName      string
	HostIPv4       [16]byte
	IntfIPv4       [16]byte
	ExtToSvcMark   uint32
	Tmtu           uint16
	VxlanPort      uint16
	PSNatStart     uint16
	PSNatLen       uint16
	HostTunnelIPv4 [16]byte
	Flags          uint32
	WgPort         uint16
	Wg6Port        uint16
	Profiling      uint16
	NatIn          uint32
	NatOut         uint32
	LogFilterJmp   uint32
	Jumps          [40]uint32

	HostIPv6       [16]byte
	IntfIPv6       [16]byte
	HostTunnelIPv6 [16]byte
	JumpsV6        [40]uint32
}

func (*TcGlobalData) Set

func (t *TcGlobalData) Set(m *Map) error

type XDPGlobalData

type XDPGlobalData struct {
	IfaceName string
	Jumps     [16]uint32
	JumpsV6   [16]uint32
}

func (*XDPGlobalData) Set

func (x *XDPGlobalData) Set(m *Map) error

Jump to

Keyboard shortcuts

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