Help us shape the future of Go! Take the 2026 Go Developer Survey

ipcache

package
v1.20.4 Latest Latest
Warning

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

Go to latest
Published: Oct 23, 2026 License: Apache-2.0 Imports: 17 Imported by: 7

Documentation

Overview

Package ipcache provides a BPF datapath implementation of the IPCache store. It depends on details from pkg/ipcache (which handles IPCache events), as well as (indirectly) details such as the KVstore. It is kept distinct from pkg/maps/ipcache, which only deals with low-level BPF details of the underlying map.

Index

Constants

This section is empty.

Variables

View Source
var Cell = cell.Module(
	"ipcache-bpf-listener",
	"IPCache BPF Listener",

	cell.Provide(NewListener),
	cell.ProvidePrivate(
		func(reg *metrics.Registry) Map { return ipcacheMap.IPCacheMap(reg) },
		func(agent monitorAgent.Agent) monitorNotify { return agent },
	),

	cell.Invoke(func(listener *BPFListener, ipc *ipcache.IPCache) { ipc.AddListener(listener) }),
)

Cell is a cell that provides and registers the listener which synchronizes the userspace ipcache with the corresponding BPF map.

Functions

This section is empty.

Types

type BPFListener

type BPFListener struct {
	// contains filtered or unexported fields
}

BPFListener implements the ipcache.IPIdentityMappingBPFListener interface with an IPCache store that is backed by BPF maps.

func NewListener

func NewListener(m Map, mn monitorNotify, tunnelConf tunnel.Config, logger *slog.Logger, localNodeStore *node.LocalNodeStore) *BPFListener

NewListener returns a new listener to push IPCache entries into BPF maps.

func (*BPFListener) OnIPIdentityCacheChange

func (l *BPFListener) OnIPIdentityCacheChange(modType ipcache.CacheModification, cidrCluster cmtypes.PrefixCluster,
	oldHostIP, newHostIP net.IP, oldID *ipcache.Identity, newID ipcache.Identity,
	encryptKey uint8, k8sMeta *ipcache.K8sMetadata, endpointFlags uint8)

OnIPIdentityCacheChange is called whenever there is a change of state in the IPCache (pkg/ipcache). TODO (FIXME): GH-3161.

'oldIPIDPair' is ignored here, because in the BPF maps an update for the IP->ID mapping will replace any existing contents; knowledge of the old pair is not required to upsert the new pair.

type Map added in v1.15.0

type Map interface {
	Update(key bpf.MapKey, value bpf.MapValue) error
	Delete(key bpf.MapKey) error
}

Jump to

Keyboard shortcuts

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