nodemap

package
v1.17.0-pre.0 Latest Latest
Warning

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

Go to latest
Published: Sep 5, 2024 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Overview

+groupName=maps

Index

Constants

View Source
const (
	MapName           = "cilium_node_map"
	DefaultMaxEntries = 16384
)
View Source
const (
	MapNameV2 = "cilium_node_map_v2"
)

Variables

View Source
var Cell = cell.Module(
	"node-map",
	"eBPF map which contains information about node IDs and their IP addresses",

	cell.Provide(newNodeMap),
	cell.Config(defaultConfig),
)

Cell provides the nodemap.MapV2 which contains information about node IDs, SPIs, and their IP addresses.

Functions

This section is empty.

Types

type Config added in v1.15.4

type Config struct {
	NodeMapMax uint32 `mapstructure:"bpf-node-map-max"`
}

func (Config) Flags added in v1.15.4

func (c Config) Flags(fs *pflag.FlagSet)

type Map

type Map interface {
	// Update inserts or updates the node map object associated with the provided
	// IP and node id.
	Update(ip net.IP, nodeID uint16) error

	// Delete deletes the node map object associated with the provided
	// IP.
	Delete(ip net.IP) error

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

	// Size returns what how many entries the node map is configured to hold.
	Size() uint32
}

Map provides access to the eBPF map node.

func LoadNodeMap

func LoadNodeMap() (Map, error)

LoadNodeMap loads the pre-initialized node map for access. This should only be used from components which aren't capable of using hive - mainly the Cilium CLI. It needs to initialized beforehand via the Cilium Agent.

type MapV2 added in v1.16.0

type MapV2 interface {
	// Update inserts or updates the node map object associated with the provided
	// IP, node id, and SPI.
	Update(ip net.IP, nodeID uint16, SPI uint8) error

	// Delete deletes the node map object associated with the provided
	// IP.
	Delete(ip net.IP) error

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

	// Size returns what how many entries the node map is configured to hold.
	Size() uint32
}

MapV2 provides access to the eBPF map node.

MapV2 will mirror all writes into MapV1.

func LoadNodeMapV2 added in v1.16.0

func LoadNodeMapV2() (MapV2, error)

LoadNodeMap loads the pre-initialized node map for access. This should only be used from components which aren't capable of using hive - mainly the Cilium CLI. It needs to initialized beforehand via the Cilium Agent.

type NodeIterateCallback

type NodeIterateCallback func(*NodeKey, *NodeValue)

NodeIterateCallback 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 node map.

type NodeIterateCallbackV2 added in v1.16.0

type NodeIterateCallbackV2 func(*NodeKey, *NodeValueV2)

NodeIterateCallback 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 node map.

type NodeKey

type NodeKey struct {
	Pad1   uint16 `align:"pad1"`
	Pad2   uint8  `align:"pad2"`
	Family uint8  `align:"family"`
	// represents both IPv6 and IPv4 (in the lowest four bytes)
	IP types.IPv6 `align:"$union0"`
}

func (*NodeKey) String

func (k *NodeKey) String() string

type NodeValue

type NodeValue struct {
	NodeID uint16
}

type NodeValueV2 added in v1.16.0

type NodeValueV2 struct {
	NodeID uint16
	SPI    uint8
	Pad    uint8
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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