libbpf

package
v0.0.0-...-d216c5d Latest Latest
Warning

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

Go to latest
Published: Nov 1, 2024 License: 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
)

Variables

This section is empty.

Functions

func CTLBSetGlobals

func CTLBSetGlobals(m *Map, udpNotSeen time.Duration, excludeUDP bool) error

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

func TcSetGlobals

func TcSetGlobals(
	m *Map,
	globalData *TcGlobalData,
) error

func XDPSetGlobals

func XDPSetGlobals(
	m *Map,
	globalData *XDPGlobalData,
) error

Types

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
	NatIn          uint32
	NatOut         uint32
	LogFilterJmp   uint32
	Jumps          [40]uint32

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

type XDPGlobalData

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

Jump to

Keyboard shortcuts

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