ifaceidx

package
v1.0.4 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IndexMetadata

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

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

Types

type SwIfIdxDto

type SwIfIdxDto struct {
	idxvpp.NameToIdxDtoWithoutMeta
	Metadata *intf.Interfaces_Interface
}

SwIfIdxDto represents an item sent through watch channel in swIfIndex. In contrast to NameToIdxDto it contains typed metadata.

type SwIfIndex

type SwIfIndex 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 *intf.Interfaces_Interface, exists bool)

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

	// LookupNameByIP returns name of items that contains given IP address in metadata
	LookupNameByIP(ip string) []string

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

SwIfIndex provides read-only access to mapping between software interface indexes (used internally in VPP) and interface names.

func Cache

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

Cache the network interfaces of a particular agent by watching (ETCD or different transport) Beware: the indexes in cache do not correspond to the real indexes.

type SwIfIndexRW

type SwIfIndexRW interface {
	SwIfIndex

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

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

SwIfIndexRW is mapping between software interface indexes (used internally in VPP) and interface names.

func NewSwIfIndex

func NewSwIfIndex(mapping idxvpp.NameToIdxRW) SwIfIndexRW

NewSwIfIndex creates new instance of swIfIndex.

Jump to

Keyboard shortcuts

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