configmap

package
v1.5.11 Latest Latest
Warning

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

Go to latest
Published: Dec 16, 2019 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Overview

Package configmap represents the endpoint's configuration. It is implemented as one array for each endpoint containing one entry. The array can be accessed through the key and points which points to the value EndpointConfig.

Index

Constants

View Source
const (
	// MapNamePrefix is the basename prefix of endpoint config maps.
	MapNamePrefix = "cilium_ep_config_"

	// MaxEntries represents the maximum number of elements in the map
	MaxEntries = 1

	// SkipPolicyIngress causes ingress policy to be skipped.
	SkipPolicyIngress = 1 << 0
	// SkipPolicyEgress causes ingress policy to be skipped.
	SkipPolicyEgress = 1 << 1
)

Variables

This section is empty.

Functions

This section is empty.

Types

type EndpointConfig

type EndpointConfig struct {
	Flags Flags `align:"flags"`
	// NOTE: everything below this comment is not plumbed yet. This will be done
	// through future work. See GH-6273.
	IPv4 types.IPv4 `align:"ipv4Addr"`
	IPv6 types.IPv6 `align:"ipv6Addr"`
	// TODO: put lxcmap.MAC into its own pkg?
	NodeMAC            lxcmap.MAC `align:"node_mac"`
	LXCID              uint16     `align:"lxc_id"`
	LXCIDNB            uint16     `align:"lxc_id_nb"`
	SecurityIdentity   uint32     `align:"identity"`
	SecurityIdentityNB uint32     `align:"identity_nb"`
	Pad                uint32     `align:"pad"`
}

EndpointConfig represents the value of the endpoint's BPF map.

Must be in sync with struct ep_config in <bpf/lib/common.h>

func GetConfig

func GetConfig(e endpoint) *EndpointConfig

GetConfig creates a EndpointConfig structure using the endpoint's configuration. The endpoint parameter should have its mutex held.

func (*EndpointConfig) GetValuePtr

func (cfg *EndpointConfig) GetValuePtr() unsafe.Pointer

GetValuePtr returns the unsafe pointer to the BPF value

func (*EndpointConfig) String

func (cfg *EndpointConfig) String() string

type EndpointConfigMap

type EndpointConfigMap struct {
	*bpf.Map

	Fd int
	// contains filtered or unexported fields
}

EndpointConfigMap is a map type for interfacing with endpoint BPF config.

func OpenMapWithName

func OpenMapWithName(path string) (*EndpointConfigMap, bool, error)

OpenMapWithName attempts to open or create a BPF config map at the specified path with the specified name. On success, it returns a map and whether the map was newly created, or otherwise an error.

func (*EndpointConfigMap) Update

func (m *EndpointConfigMap) Update(value *EndpointConfig) error

Update pushes the configuration options from the specified endpoint into the configuration map.

type Flags

type Flags uint32

Flags is a set of endpoint configuration flags interpreted by BPF code.

Must be in sync with the enum ep_cfg_flag in <bpf/lib/eps.h>

func (Flags) String

func (f Flags) String() string

String converts the specified flags into a human-readable form.

type Key

type Key struct {
	Bits uint32
}

Key is the key used to index into the config map for an endpoint.

Must be in sync with the key of CONFIG_MAP in <bpf/lib/maps.h>

func (*Key) GetKeyPtr

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

GetKeyPtr returns the unsafe pointer to the BPF key

func (*Key) NewValue

func (k *Key) NewValue() bpf.MapValue

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

func (Key) String

func (k Key) String() string

Jump to

Keyboard shortcuts

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