objs

package
v0.0.0-...-efe6fa3 Latest Latest
Warning

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

Go to latest
Published: Jul 6, 2025 License: GPL-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func LoadBpf

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

LoadBpf returns the embedded CollectionSpec for Bpf.

func LoadBpfObjects

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

LoadBpfObjects loads Bpf and converts it into a struct.

The following types are suitable as obj argument:

*BpfObjects
*BpfPrograms
*BpfMaps

See ebpf.CollectionSpec.LoadAndAssign documentation for details.

Types

type BpfIpInfo

type BpfIpInfo struct {
	Kind uint8
	Mac  [6]uint8

	Ifindex uint32
	// contains filtered or unexported fields
}

type BpfMapSpecs

type BpfMapSpecs struct {
	IpInfo   *ebpf.MapSpec `ebpf:"ip_info"`
	NatTable *ebpf.MapSpec `ebpf:"nat_table"`
	QnameMap *ebpf.MapSpec `ebpf:"qname_map"`
	Sockhash *ebpf.MapSpec `ebpf:"sockhash"`
}

BpfMapSpecs contains maps before they are loaded into the kernel.

It can be passed ebpf.CollectionSpec.Assign.

type BpfMaps

type BpfMaps struct {
	IpInfo   *ebpf.Map `ebpf:"ip_info"`
	NatTable *ebpf.Map `ebpf:"nat_table"`
	QnameMap *ebpf.Map `ebpf:"qname_map"`
	Sockhash *ebpf.Map `ebpf:"sockhash"`
}

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

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

func (*BpfMaps) Close

func (m *BpfMaps) Close() error

type BpfNatKey

type BpfNatKey struct {
	SrcIp   uint32
	DstIp   uint32
	SrcPort uint16
	DstPort uint16
	Proto   uint8
	// contains filtered or unexported fields
}

type BpfNatValue

type BpfNatValue struct {
	NewSrcIp   uint32
	NewSrcPort uint16
	// contains filtered or unexported fields
}

type BpfObjects

type BpfObjects struct {
	BpfPrograms
	BpfMaps
	BpfVariables
}

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

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

func (*BpfObjects) Close

func (o *BpfObjects) Close() error

type BpfProgramSpecs

type BpfProgramSpecs struct {
	ExternalTcxEgress  *ebpf.ProgramSpec `ebpf:"external_tcx_egress"`
	ExternalTcxIngress *ebpf.ProgramSpec `ebpf:"external_tcx_ingress"`
	NetkitPeer         *ebpf.ProgramSpec `ebpf:"netkit_peer"`
	NetkitPrimary      *ebpf.ProgramSpec `ebpf:"netkit_primary"`
	ProgMsgVerdict     *ebpf.ProgramSpec `ebpf:"prog_msg_verdict"`
	SockopsLogger      *ebpf.ProgramSpec `ebpf:"sockops_logger"`
	TapTcxEgress       *ebpf.ProgramSpec `ebpf:"tap_tcx_egress"`
	TapTcxIngress      *ebpf.ProgramSpec `ebpf:"tap_tcx_ingress"`
	XdpProg            *ebpf.ProgramSpec `ebpf:"xdp_prog"`
}

BpfProgramSpecs contains programs before they are loaded into the kernel.

It can be passed ebpf.CollectionSpec.Assign.

type BpfPrograms

type BpfPrograms struct {
	ExternalTcxEgress  *ebpf.Program `ebpf:"external_tcx_egress"`
	ExternalTcxIngress *ebpf.Program `ebpf:"external_tcx_ingress"`
	NetkitPeer         *ebpf.Program `ebpf:"netkit_peer"`
	NetkitPrimary      *ebpf.Program `ebpf:"netkit_primary"`
	ProgMsgVerdict     *ebpf.Program `ebpf:"prog_msg_verdict"`
	SockopsLogger      *ebpf.Program `ebpf:"sockops_logger"`
	TapTcxEgress       *ebpf.Program `ebpf:"tap_tcx_egress"`
	TapTcxIngress      *ebpf.Program `ebpf:"tap_tcx_ingress"`
	XdpProg            *ebpf.Program `ebpf:"xdp_prog"`
}

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

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

func (*BpfPrograms) Close

func (p *BpfPrograms) Close() error

type BpfQnameKey

type BpfQnameKey struct{ Qname [256]uint8 }

type BpfSockKey

type BpfSockKey struct {
	RemoteIp4  uint32
	LocalIp4   uint32
	RemotePort uint32
	LocalPort  uint32
	Family     uint32
}

type BpfSpecs

type BpfSpecs struct {
	BpfProgramSpecs
	BpfMapSpecs
	BpfVariableSpecs
}

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

It can be passed ebpf.CollectionSpec.Assign.

type BpfVariableSpecs

type BpfVariableSpecs struct {
	DefaultMac *ebpf.VariableSpec `ebpf:"default_mac"`
}

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

It can be passed ebpf.CollectionSpec.Assign.

type BpfVariables

type BpfVariables struct {
	DefaultMac *ebpf.Variable `ebpf:"default_mac"`
}

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

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

Jump to

Keyboard shortcuts

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