libbpf

package
v0.0.0-...-21cfbab Latest Latest
Warning

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

Go to latest
Published: Apr 10, 2023 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
	GlobalsIPv6Enabled      uint32 = C.CALI_GLOBALS_IPV6_ENABLED
	GlobalsRPFOptionEnabled uint32 = C.CALI_GLOBALS_RPF_OPTION_ENABLED
	GlobalsRPFOptionStrict  uint32 = C.CALI_GLOBALS_RPF_OPTION_STRICT
	GlobalsNoDSRCidrs       uint32 = C.CALI_GLOBALS_NO_DSR_CIDRS
)

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 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 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) 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) (int, error)

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) 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
	HostIP       uint32
	IntfIP       uint32
	ExtToSvcMark uint32
	Tmtu         uint16
	VxlanPort    uint16
	PSNatStart   uint16
	PSNatLen     uint16
	HostTunnelIP uint32
	Flags        uint32
	WgPort       uint16
	NatIn        uint32
	NatOut       uint32
}

type XDPGlobalData

type XDPGlobalData struct {
	IfaceName string
}

Jump to

Keyboard shortcuts

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