ebpf

package
v1.0.0 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RequireCapabilities

func RequireCapabilities() error

RequireCapabilities checks for eBPF support and returns an error if not available. This is intended to be called at startup to provide a clear error message.

Types

type Capabilities

type Capabilities struct {
	// KernelVersion is the running kernel version string
	KernelVersion string
	// KernelSupported indicates if the kernel version supports eBPF TC programs
	KernelSupported bool
	// BPFSyscall indicates if the BPF syscall is available
	BPFSyscall bool
	// CanCreatePrograms indicates if we can create eBPF programs
	CanCreatePrograms bool
	// HasCAP_BPF indicates if CAP_BPF capability is available
	HasCAP_BPF bool
	// HasCAP_NET_ADMIN indicates if CAP_NET_ADMIN capability is available
	HasCAP_NET_ADMIN bool
	// Error contains any error encountered during detection
	Error error
}

Capabilities represents the eBPF capabilities of the current environment

func Detect

func Detect() *Capabilities

Detect probes the current environment for eBPF capabilities

func (*Capabilities) IsSupported

func (c *Capabilities) IsSupported() bool

IsSupported returns true if all required eBPF capabilities are available

func (*Capabilities) Summary

func (c *Capabilities) Summary() string

Summary provides a human-readable summary of capabilities

Jump to

Keyboard shortcuts

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