configmap

package
v1.14.0-snapshot.2 Latest Latest
Warning

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

Go to latest
Published: Apr 28, 2023 License: Apache-2.0 Imports: 5 Imported by: 18

Documentation

Overview

Package config stores runtime configuration state for the Cilium datapath. +groupName=maps

Index

Constants

View Source
const (
	// MapName name of map used to pin map for datapath
	MapName = "cilium_runtime_config"

	// MaxEntries represents the maximum number of config entries.
	// Initially defined as 256, so that downgrade from a future version having more than one
	// entry works without necessarily resizing the map. Entries not known by the datapath
	// version are simply ignored.
	MaxEntries = 256
)

Variables

View Source
var Cell = cell.Module(
	"config-map",
	"eBPF map config contains runtime configuration state for the Cilium datapath",

	cell.Provide(newMap),
)

Cell initializes and manages the config map.

Functions

This section is empty.

Types

type Index

type Index uint32

Index is the index to the runtime config array.

const (
	UTimeOffset Index = iota
	UsedEntries
)

All supported indices in one place. Must be in sync with RUNTIME_CONFIG_ enum in bpf/lib/common.h

func (*Index) DeepCopyMapKey

func (k *Index) DeepCopyMapKey() bpf.MapKey

DeepCopyMapKey returns a deep copy of the map key

func (*Index) GetKeyPtr

func (k *Index) GetKeyPtr() unsafe.Pointer

GetKeyPtr returns the unsafe pointer to the BPF key

func (*Index) NewValue

func (k *Index) NewValue() bpf.MapValue

NewValue returns a new empty instance of the structure representing the BPF map value

func (*Index) String

func (k *Index) String() string

String pretty print the Index

type Map

type Map interface {
	// Update writes the given uint64 value to the bpf map at the given index.
	Update(index Index, val uint64) error
}

Map provides access to the eBPF map configmap.

type MapOut

type MapOut struct {
	cell.Out

	ConfigMap Map
	BpfMap    bpf.BpfMap `group:"bpf-maps"`
}

type Value

type Value uint64

Value is the generic datapath runtime config value.

func (*Value) DeepCopyMapValue

func (v *Value) DeepCopyMapValue() bpf.MapValue

DeepCopyMapValue returns a deep copy of the map value

func (*Value) GetValuePtr

func (v *Value) GetValuePtr() unsafe.Pointer

GetValuePtr returns the unsafe pointer to the BPF value.

func (*Value) String

func (v *Value) String() string

String pretty print the config Value.

Jump to

Keyboard shortcuts

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