l2idx

package
v1.8.1 Latest Latest
Warning

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

Go to latest
Published: Mar 4, 2019 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Overview

Package l2idx 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 *BdMetadata, exists bool)

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

	// LookupBdForInterface looks up for bridge domain the interface belongs to
	LookupBdForInterface(ifName string) (bdIdx uint32, bd *l2.BridgeDomains_BridgeDomain, bdIf *l2.BridgeDomains_BridgeDomain_Interfaces, exists bool)

	// WatchNameToIdx allows to subscribe for watching changes in bdIndex mapping
	WatchNameToIdx(subscriber string, pluginChannel chan BdChangeDto)
}

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

func Cache

func Cache(watcher datasync.KeyValProtoWatcher) 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, metadata *BdMetadata)

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

	// UpdateMetadata updates metadata in existing bridge domain entry.
	UpdateMetadata(name string, metadata *BdMetadata) (success bool)

	// Clear removes all bridge domains from the mapping.
	Clear()
}

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 BdChangeDto

type BdChangeDto struct {
	idxvpp.NameToIdxDtoWithoutMeta
	Metadata *BdMetadata
}

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

type BdMetadata

type BdMetadata struct {
	BridgeDomain         *l2.BridgeDomains_BridgeDomain
	ConfiguredInterfaces []string
}

BdMetadata is bridge domain metadata and consists from base bridge domain data and a list of interfaces which were (according to L2 bridge domain configurator) already configured as a part of bridge domain

func NewBDMetadata

func NewBDMetadata(bd *l2.BridgeDomains_BridgeDomain, confIfs []string) *BdMetadata

NewBDMetadata returns new instance of metadata

type FIBIndex

type FIBIndex 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.FibTable_FibEntry, exists bool)

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

	// WatchNameToIdx allows to subscribe for watching changes in fibIndex mapping
	WatchNameToIdx(subscriber string, pluginChannel chan FibChangeDto)
}

FIBIndex provides read-only access to mapping between indexes (used internally in VPP) and FIB entries.

type FIBIndexRW

type FIBIndexRW interface {
	FIBIndex

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

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

	// UpdateMetadata updates metadata in existing FIB entry.
	UpdateMetadata(name string, metadata *l2.FibTable_FibEntry) (success bool)

	// Clear removes all FIB entries from the mapping.
	Clear()
}

FIBIndexRW is mapping between indices (used internally in VPP) and FIB entries.

func NewFIBIndex

func NewFIBIndex(mapping idxvpp.NameToIdxRW) FIBIndexRW

NewFIBIndex creates new instance of fibIndex.

type FibChangeDto

type FibChangeDto struct {
	idxvpp.NameToIdxDtoWithoutMeta
	Metadata *l2.FibTable_FibEntry
}

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

type XcChangeDto

type XcChangeDto struct {
	idxvpp.NameToIdxDtoWithoutMeta
	Metadata *l2.XConnectPairs_XConnectPair
}

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

type XcIndex

type XcIndex 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.XConnectPairs_XConnectPair, exists bool)

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

	// WatchNameToIdx allows to subscribe for watching changes in xcIndex mapping
	WatchNameToIdx(subscriber string, pluginChannel chan XcChangeDto)
}

XcIndex provides read-only access to mapping between indexes (used internally in VPP) and cross connects.

type XcIndexRW

type XcIndexRW interface {
	XcIndex

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

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

	// UpdateMetadata updates metadata in existing cross connect entry.
	UpdateMetadata(name string, metadata *l2.XConnectPairs_XConnectPair) (success bool)

	// Clear removes all cross connects from the mapping.
	Clear()
}

XcIndexRW is mapping between indices (used internally in VPP) and cross connect entries.

func NewXcIndex

func NewXcIndex(mapping idxvpp.NameToIdxRW) XcIndexRW

NewXcIndex creates new instance of xcIndex.

Jump to

Keyboard shortcuts

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