xdp

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Dec 18, 2025 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func LoadXdperf

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

LoadXdperf returns the embedded CollectionSpec for Xdperf.

func LoadXdperfObjects

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

LoadXdperfObjects loads Xdperf and converts it into a struct.

The following types are suitable as obj argument:

*XdperfObjects
*XdperfPrograms
*XdperfMaps

See ebpf.CollectionSpec.LoadAndAssign documentation for details.

Types

type XdperfDatarec

type XdperfDatarec struct {
	RxPackets uint64
	RxBytes   uint64
}

type XdperfMapSpecs

type XdperfMapSpecs struct {
	StatsMap *ebpf.MapSpec `ebpf:"stats_map"`
}

XdperfMapSpecs contains maps before they are loaded into the kernel.

It can be passed ebpf.CollectionSpec.Assign.

type XdperfMaps

type XdperfMaps struct {
	StatsMap *ebpf.Map `ebpf:"stats_map"`
}

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

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

func (*XdperfMaps) Close

func (m *XdperfMaps) Close() error

type XdperfObjects

type XdperfObjects struct {
	XdperfPrograms
	XdperfMaps
	XdperfVariables
}

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

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

func (*XdperfObjects) Close

func (o *XdperfObjects) Close() error

type XdperfProgramSpecs

type XdperfProgramSpecs struct {
	XdpCountPackets    *ebpf.ProgramSpec `ebpf:"xdp_count_packets"`
	XdpRedirectNotouch *ebpf.ProgramSpec `ebpf:"xdp_redirect_notouch"`
	XdpTx              *ebpf.ProgramSpec `ebpf:"xdp_tx"`
}

XdperfProgramSpecs contains programs before they are loaded into the kernel.

It can be passed ebpf.CollectionSpec.Assign.

type XdperfPrograms

type XdperfPrograms struct {
	XdpCountPackets    *ebpf.Program `ebpf:"xdp_count_packets"`
	XdpRedirectNotouch *ebpf.Program `ebpf:"xdp_redirect_notouch"`
	XdpTx              *ebpf.Program `ebpf:"xdp_tx"`
}

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

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

func (*XdperfPrograms) Close

func (p *XdperfPrograms) Close() error

type XdperfSpecs

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

It can be passed ebpf.CollectionSpec.Assign.

type XdperfVariableSpecs

type XdperfVariableSpecs struct {
	Ifidx      *ebpf.VariableSpec `ebpf:"ifidx"`
	TargetPort *ebpf.VariableSpec `ebpf:"target_port"`
}

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

It can be passed ebpf.CollectionSpec.Assign.

type XdperfVariables

type XdperfVariables struct {
	Ifidx      *ebpf.Variable `ebpf:"ifidx"`
	TargetPort *ebpf.Variable `ebpf:"target_port"`
}

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

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

Jump to

Keyboard shortcuts

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