bpf

package
v1.1.0 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func LoadTcBpf

func LoadTcBpf() (*ebpf.CollectionSpec, error)

LoadTcBpf returns the embedded CollectionSpec for TcBpf.

func LoadTcBpfObjects

func LoadTcBpfObjects(obj interface{}, opts *ebpf.CollectionOptions) error

LoadTcBpfObjects loads TcBpf and converts it into a struct.

The following types are suitable as obj argument:

*TcBpfObjects
*TcBpfPrograms
*TcBpfMaps

See ebpf.CollectionSpec.LoadAndAssign documentation for details.

Types

type TcBpfLpmKey

type TcBpfLpmKey struct {
	Prefixlen uint32
	Ip        uint32
	// contains filtered or unexported fields
}

type TcBpfLpmKeyV6

type TcBpfLpmKeyV6 struct {
	Prefixlen uint32
	Ip        [16]uint8
	// contains filtered or unexported fields
}

type TcBpfLpmVal

type TcBpfLpmVal struct {
	Action       uint8
	PortSpecific uint8
	Pad          uint16
	// contains filtered or unexported fields
}

type TcBpfMapSpecs

type TcBpfMapSpecs struct {
	MapAuditMode     *ebpf.MapSpec `ebpf:"map_audit_mode"`
	MapCidrs         *ebpf.MapSpec `ebpf:"map_cidrs"`
	MapCidrsV6       *ebpf.MapSpec `ebpf:"map_cidrs_v6"`
	MapDefaultAction *ebpf.MapSpec `ebpf:"map_default_action"`
	MapEvents        *ebpf.MapSpec `ebpf:"map_events"`
	MapPorts         *ebpf.MapSpec `ebpf:"map_ports"`
	MapPortsV6       *ebpf.MapSpec `ebpf:"map_ports_v6"`
	MapSockPid       *ebpf.MapSpec `ebpf:"map_sock_pid"`
}

TcBpfMapSpecs contains maps before they are loaded into the kernel.

It can be passed ebpf.CollectionSpec.Assign.

type TcBpfMaps

type TcBpfMaps struct {
	MapAuditMode     *ebpf.Map `ebpf:"map_audit_mode"`
	MapCidrs         *ebpf.Map `ebpf:"map_cidrs"`
	MapCidrsV6       *ebpf.Map `ebpf:"map_cidrs_v6"`
	MapDefaultAction *ebpf.Map `ebpf:"map_default_action"`
	MapEvents        *ebpf.Map `ebpf:"map_events"`
	MapPorts         *ebpf.Map `ebpf:"map_ports"`
	MapPortsV6       *ebpf.Map `ebpf:"map_ports_v6"`
	MapSockPid       *ebpf.Map `ebpf:"map_sock_pid"`
}

TcBpfMaps contains all maps after they have been loaded into the kernel.

It can be passed to LoadTcBpfObjects or ebpf.CollectionSpec.LoadAndAssign.

func (*TcBpfMaps) Close

func (m *TcBpfMaps) Close() error

type TcBpfObjects

type TcBpfObjects struct {
	TcBpfPrograms
	TcBpfMaps
	TcBpfVariables
}

TcBpfObjects contains all objects after they have been loaded into the kernel.

It can be passed to LoadTcBpfObjects or ebpf.CollectionSpec.LoadAndAssign.

func (*TcBpfObjects) Close

func (o *TcBpfObjects) Close() error

type TcBpfPortKey

type TcBpfPortKey struct {
	Ip    uint32
	Port  uint16
	Proto uint8
	Pad   uint8
	// contains filtered or unexported fields
}

type TcBpfPortKeyV6

type TcBpfPortKeyV6 struct {
	Ip    [16]uint8
	Port  uint16
	Proto uint8
	Pad   uint8
	// contains filtered or unexported fields
}

type TcBpfPortVal

type TcBpfPortVal struct {
	Action uint8
	Pad    [3]uint8
	// contains filtered or unexported fields
}

type TcBpfProgramSpecs

type TcBpfProgramSpecs struct {
	CgConnect4 *ebpf.ProgramSpec `ebpf:"cg_connect4"`
	CgConnect6 *ebpf.ProgramSpec `ebpf:"cg_connect6"`
	CgSendmsg4 *ebpf.ProgramSpec `ebpf:"cg_sendmsg4"`
	CgSendmsg6 *ebpf.ProgramSpec `ebpf:"cg_sendmsg6"`
	TcEgress   *ebpf.ProgramSpec `ebpf:"tc_egress"`
	TcIngress  *ebpf.ProgramSpec `ebpf:"tc_ingress"`
}

TcBpfProgramSpecs contains programs before they are loaded into the kernel.

It can be passed ebpf.CollectionSpec.Assign.

type TcBpfPrograms

type TcBpfPrograms struct {
	CgConnect4 *ebpf.Program `ebpf:"cg_connect4"`
	CgConnect6 *ebpf.Program `ebpf:"cg_connect6"`
	CgSendmsg4 *ebpf.Program `ebpf:"cg_sendmsg4"`
	CgSendmsg6 *ebpf.Program `ebpf:"cg_sendmsg6"`
	TcEgress   *ebpf.Program `ebpf:"tc_egress"`
	TcIngress  *ebpf.Program `ebpf:"tc_ingress"`
}

TcBpfPrograms contains all programs after they have been loaded into the kernel.

It can be passed to LoadTcBpfObjects or ebpf.CollectionSpec.LoadAndAssign.

func (*TcBpfPrograms) Close

func (p *TcBpfPrograms) Close() error

type TcBpfSpecs

TcBpfSpecs contains maps and programs before they are loaded into the kernel.

It can be passed ebpf.CollectionSpec.Assign.

type TcBpfVariableSpecs

type TcBpfVariableSpecs struct {
}

TcBpfVariableSpecs contains global variables before they are loaded into the kernel.

It can be passed ebpf.CollectionSpec.Assign.

type TcBpfVariables

type TcBpfVariables struct {
}

TcBpfVariables contains all global variables after they have been loaded into the kernel.

It can be passed to LoadTcBpfObjects or ebpf.CollectionSpec.LoadAndAssign.

Jump to

Keyboard shortcuts

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