ipcache

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: 9 Imported by: 20

Documentation

Overview

+groupName=maps

Index

Constants

View Source
const (
	// MaxEntries is the maximum number of keys that can be present in the
	// RemoteEndpointMap.
	MaxEntries = 512000

	// Name is the canonical name for the IPCache map on the filesystem.
	Name = "cilium_ipcache"
)

Variables

This section is empty.

Functions

func Reopen added in v1.5.0

func Reopen() error

Reopen attempts to close and re-open the IPCache map at the standard path on the filesystem.

Types

type Key

type Key struct {
	Prefixlen uint32 `align:"lpm_key"`
	Pad1      uint16 `align:"pad1"`
	ClusterID uint8  `align:"cluster_id"`
	Family    uint8  `align:"family"`
	// represents both IPv6 and IPv4 (in the lowest four bytes)
	IP types.IPv6 `align:"$union0"`
}

Key implements the bpf.MapKey interface.

Must be in sync with struct ipcache_key in <bpf/lib/maps.h> +k8s:deepcopy-gen=true +k8s:deepcopy-gen:interfaces=github.com/cilium/cilium/pkg/bpf.MapKey

func NewKey

func NewKey(ip net.IP, mask net.IPMask, clusterID uint8) Key

NewKey returns an Key based on the provided IP address, mask, and ClusterID. The address family is automatically detected

func (*Key) DeepCopy added in v1.5.1

func (in *Key) DeepCopy() *Key

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Key.

func (*Key) DeepCopyInto added in v1.5.1

func (in *Key) DeepCopyInto(out *Key)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*Key) DeepCopyMapKey added in v1.5.1

func (in *Key) DeepCopyMapKey() bpf.MapKey

DeepCopyMapKey is an autogenerated deepcopy function, copying the receiver, creating a new bpf.MapKey.

func (*Key) GetKeyPtr added in v1.5.0

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

GetKeyPtr returns the unsafe pointer to the BPF key

func (Key) IPNet added in v1.10.10

func (k Key) IPNet() *net.IPNet

func (Key) NewValue added in v1.5.0

func (k Key) NewValue() bpf.MapValue

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

func (Key) Prefix

func (k Key) Prefix() netip.Prefix

func (Key) String

func (k Key) String() string

type Map

type Map struct {
	bpf.Map
}

Map represents an IPCache BPF map.

func IPCacheMap

func IPCacheMap() *Map

IPCacheMap gets the ipcache Map singleton. If it has not already been done, this also initializes the Map.

func NewMap

func NewMap(name string) *Map

NewMap instantiates a Map.

func (*Map) GetMaxPrefixLengths

func (m *Map) GetMaxPrefixLengths() (ipv6, ipv4 int)

GetMaxPrefixLengths determines how many unique prefix lengths are supported simultaneously based on the underlying BPF map type in use.

type RemoteEndpointInfo

type RemoteEndpointInfo struct {
	SecurityIdentity uint32     `align:"sec_identity"`
	TunnelEndpoint   types.IPv4 `align:"tunnel_endpoint"`
	NodeID           uint16     `align:"node_id"`
	Key              uint8      `align:"key"`
}

RemoteEndpointInfo implements the bpf.MapValue interface. It contains the security identity of a remote endpoint. +k8s:deepcopy-gen=true +k8s:deepcopy-gen:interfaces=github.com/cilium/cilium/pkg/bpf.MapValue

func (*RemoteEndpointInfo) DeepCopy added in v1.5.1

func (in *RemoteEndpointInfo) DeepCopy() *RemoteEndpointInfo

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RemoteEndpointInfo.

func (*RemoteEndpointInfo) DeepCopyInto added in v1.5.1

func (in *RemoteEndpointInfo) DeepCopyInto(out *RemoteEndpointInfo)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*RemoteEndpointInfo) DeepCopyMapValue added in v1.5.1

func (in *RemoteEndpointInfo) DeepCopyMapValue() bpf.MapValue

DeepCopyMapValue is an autogenerated deepcopy function, copying the receiver, creating a new bpf.MapValue.

func (*RemoteEndpointInfo) GetValuePtr added in v1.5.0

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

GetValuePtr returns the unsafe pointer to the BPF value.

func (*RemoteEndpointInfo) String

func (v *RemoteEndpointInfo) String() string

Jump to

Keyboard shortcuts

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