ipcache

package
v1.11.11 Latest Latest
Warning

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

Go to latest
Published: Nov 16, 2022 License: Apache-2.0 Imports: 17 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

This section is empty.

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.

One listener is shared between callers of OnIPIdentityCacheChange() and the controller launched from OnIPIdentityCacheGC(). However, The listener is not updated after initialization so no locking is provided for access.

func NewListener

func NewListener(d datapath, 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, cidr net.IPNet,
	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.

func (*BPFListener) OnIPIdentityCacheGC

func (l *BPFListener) OnIPIdentityCacheGC()

OnIPIdentityCacheGC spawns a controller which synchronizes the BPF IPCache Map with the in-memory IP-Identity cache.

Jump to

Keyboard shortcuts

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