bpf

package
v0.0.0-...-1c9ed06 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AttachRootCgroup

func AttachRootCgroup(prg *ebpf.Program, attachType ebpf.AttachType) (link.Link, error)

func AttachTcxToInterfaces

func AttachTcxToInterfaces(ifaces []net.Interface, prg *ebpf.Program, attachType ebpf.AttachType) ([]link.Link, map[int]net.Interface, error)

func LoadNetLedger

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

LoadNetLedger returns the embedded CollectionSpec for NetLedger.

func LoadNetLedgerObjects

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

LoadNetLedgerObjects loads NetLedger and converts it into a struct.

The following types are suitable as obj argument:

*NetLedgerObjects
*NetLedgerPrograms
*NetLedgerMaps

See ebpf.CollectionSpec.LoadAndAssign documentation for details.

func LoadTests

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

LoadTests returns the embedded CollectionSpec for Tests.

func LoadTestsObjects

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

LoadTestsObjects loads Tests and converts it into a struct.

The following types are suitable as obj argument:

*TestsObjects
*TestsPrograms
*TestsMaps

See ebpf.CollectionSpec.LoadAndAssign documentation for details.

func ManageTCXLinks(ifacesMap map[int]net.Interface, activeLinks []link.Link, prg *ebpf.Program, attachType ebpf.AttachType) (chan struct{}, error)

Types

type NetLedgerConnMeta

type NetLedgerConnMeta struct {
	CgroupId     uint64
	LastSeen     uint64
	PodInitiated uint8
	Established  uint8
	// contains filtered or unexported fields
}

type NetLedgerConnStats

type NetLedgerConnStats struct {
	CgroupId      uint64
	TxBytes       uint64
	RxBytes       uint64
	SrcIp4        uint32
	DstIp4        uint32
	SrcPort       uint16
	DstPort       uint16
	Proto         uint8
	ConnDirection uint8
	PodInitiated  uint8
	// contains filtered or unexported fields
}

type NetLedgerMapSpecs

type NetLedgerMapSpecs struct {
	ConnMeta  *ebpf.MapSpec `ebpf:"conn_meta"`
	ConnStats *ebpf.MapSpec `ebpf:"conn_stats"`
}

NetLedgerMapSpecs contains maps before they are loaded into the kernel.

It can be passed ebpf.CollectionSpec.Assign.

type NetLedgerMaps

type NetLedgerMaps struct {
	ConnMeta  *ebpf.Map `ebpf:"conn_meta"`
	ConnStats *ebpf.Map `ebpf:"conn_stats"`
}

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

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

func (*NetLedgerMaps) Close

func (m *NetLedgerMaps) Close() error

type NetLedgerObjects

type NetLedgerObjects struct {
	NetLedgerPrograms
	NetLedgerMaps
	NetLedgerVariables
}

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

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

func (*NetLedgerObjects) Close

func (o *NetLedgerObjects) Close() error

type NetLedgerProgramSpecs

type NetLedgerProgramSpecs struct {
	CgConnect4 *ebpf.ProgramSpec `ebpf:"cg_connect4"`
	CgEgress   *ebpf.ProgramSpec `ebpf:"cg_egress"`
	CgIngress  *ebpf.ProgramSpec `ebpf:"cg_ingress"`
	TcpSockops *ebpf.ProgramSpec `ebpf:"tcp_sockops"`
}

NetLedgerProgramSpecs contains programs before they are loaded into the kernel.

It can be passed ebpf.CollectionSpec.Assign.

type NetLedgerPrograms

type NetLedgerPrograms struct {
	CgConnect4 *ebpf.Program `ebpf:"cg_connect4"`
	CgEgress   *ebpf.Program `ebpf:"cg_egress"`
	CgIngress  *ebpf.Program `ebpf:"cg_ingress"`
	TcpSockops *ebpf.Program `ebpf:"tcp_sockops"`
}

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

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

func (*NetLedgerPrograms) Close

func (p *NetLedgerPrograms) Close() error

type NetLedgerSpecs

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

It can be passed ebpf.CollectionSpec.Assign.

type NetLedgerVariableSpecs

type NetLedgerVariableSpecs struct {
}

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

It can be passed ebpf.CollectionSpec.Assign.

type NetLedgerVariables

type NetLedgerVariables struct {
}

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

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

type TestsEvent

type TestsEvent struct {
	Pid   uint32
	Saddr uint32
	Daddr uint32
	Sport uint16
	Dport uint16
	Comm  [16]int8
	// contains filtered or unexported fields
}

type TestsMapSpecs

type TestsMapSpecs struct {
	Events *ebpf.MapSpec `ebpf:"events"`
}

TestsMapSpecs contains maps before they are loaded into the kernel.

It can be passed ebpf.CollectionSpec.Assign.

type TestsMaps

type TestsMaps struct {
	Events *ebpf.Map `ebpf:"events"`
}

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

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

func (*TestsMaps) Close

func (m *TestsMaps) Close() error

type TestsObjects

type TestsObjects struct {
	TestsPrograms
	TestsMaps
	TestsVariables
}

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

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

func (*TestsObjects) Close

func (o *TestsObjects) Close() error

type TestsProgramSpecs

type TestsProgramSpecs struct {
	HandleTcpConnect *ebpf.ProgramSpec `ebpf:"handle_tcp_connect"`
}

TestsProgramSpecs contains programs before they are loaded into the kernel.

It can be passed ebpf.CollectionSpec.Assign.

type TestsPrograms

type TestsPrograms struct {
	HandleTcpConnect *ebpf.Program `ebpf:"handle_tcp_connect"`
}

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

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

func (*TestsPrograms) Close

func (p *TestsPrograms) Close() error

type TestsSpecs

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

It can be passed ebpf.CollectionSpec.Assign.

type TestsVariableSpecs

type TestsVariableSpecs struct {
}

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

It can be passed ebpf.CollectionSpec.Assign.

type TestsVariables

type TestsVariables struct {
}

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

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

Jump to

Keyboard shortcuts

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