bdidx

package
v1.0.8 Latest Latest
Warning

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

Go to latest
Published: Nov 21, 2017 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Overview

Package bdidx implements name-to-index mapping registry and cache for bridge-domains.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IndexMetadata

func IndexMetadata(metaData interface{}) map[string][]string

IndexMetadata creates indices for metadata. Index for IPAddress will be created.

Types

type BDIndex

type BDIndex interface {
	// GetMapping returns internal read-only mapping with metadata of type interface{}.
	GetMapping() idxvpp.NameToIdxRW

	// LookupIdx looks up previously stored item identified by index in mapping.
	LookupIdx(name string) (idx uint32, metadata *l2.BridgeDomains_BridgeDomain, exists bool)

	// LookupName looks up previously stored item identified by name in mapping.
	LookupName(idx uint32) (name string, metadata *l2.BridgeDomains_BridgeDomain, exists bool)

	// LookupNameByIP returns names of items that contains given IP address in metadata
	LookupNameByIfaceName(ifaceName string) []string

	// WatchNameToIdx allows to subscribe for watching changes in bdIndex mapping
	WatchNameToIdx(subscriber core.PluginName, pluginChannel chan ChangeDto)
}

BDIndex provides read-only access to mapping between indices (used internally in VPP) and Bridge Domain names.

func Cache

func Cache(watcher datasync.KeyValProtoWatcher, caller core.PluginName) BDIndex

Cache the network interfaces of a particular agent by watching (ETCD or different transport).

type BDIndexRW

type BDIndexRW interface {
	BDIndex

	// RegisterName adds new item into name-to-index mapping.
	RegisterName(name string, idx uint32, ifMeta *l2.BridgeDomains_BridgeDomain)

	// UnregisterName removes an item identified by name from mapping
	UnregisterName(name string) (idx uint32, metadata *l2.BridgeDomains_BridgeDomain, exists bool)
}

BDIndexRW is mapping between indices (used internally in VPP) and Bridge Domain names.

func NewBDIndex

func NewBDIndex(mapping idxvpp.NameToIdxRW) BDIndexRW

NewBDIndex creates new instance of bdIndex.

type ChangeDto

type ChangeDto struct {
	idxvpp.NameToIdxDtoWithoutMeta
	Metadata *l2.BridgeDomains_BridgeDomain
}

ChangeDto represents an item sent through watch channel in bdIndex. In contrast to NameToIdxDto, it contains typed metadata.

Jump to

Keyboard shortcuts

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