ebpf

package
v1.10.4 Latest Latest
Warning

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

Go to latest
Published: Sep 1, 2021 License: Apache-2.0 Imports: 11 Imported by: 5

Documentation

Overview

Package ebpf provides functions that allow golang programs to interact with ebpf maps by wrapping the cilium/ebpf library. +groupName=pkg

Index

Constants

View Source
const (
	PerCPUHash = ciliumebpf.PerCPUHash

	PinByName = ciliumebpf.PinByName
)

Variables

This section is empty.

Functions

func GetOpenMaps

func GetOpenMaps() []*models.BPFMap

GetOpenMaps returns a slice of all open BPF maps. This is identical to calling GetMap() on all open maps.

Types

type IterateCallback

type IterateCallback func(key, value interface{})

IterateCallback represents the signature of the callback function expected by the IterateWithCallback method, which in turn is used to iterate all the keys/values of a map.

type Map

type Map struct {
	*ciliumebpf.Map
	// contains filtered or unexported fields
}

Map represents an eBPF map.

func GetMap

func GetMap(name string) *Map

GetMap returns the registered map with the given name or absolute path

func NewMap

func NewMap(spec *MapSpec) *Map

NewMap creates a new Map object.

func (*Map) GetModel

func (m *Map) GetModel() *models.BPFMap

GetModel returns a BPF map in the representation served via the API.

func (*Map) IterateWithCallback

func (m *Map) IterateWithCallback(key, value interface{}, cb IterateCallback) error

IterateWithCallback iterates through all the keys/values of a map, passing each key/value pair to the cb callback.

func (*Map) OpenOrCreate

func (m *Map) OpenOrCreate() error

OpenOrCreate tries to open or create the eBPF map identified by the spec in the Map object.

type MapSpec

type MapSpec = ciliumebpf.MapSpec

Jump to

Keyboard shortcuts

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