ipcache

package
v1.16.0-rc.0 Latest Latest
Warning

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

Go to latest
Published: Jun 17, 2024 License: Apache-2.0 Imports: 13 Imported by: 4

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() Map { return ipcacheMap.IPCacheMap() },
		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) *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)

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