vrfidx

package
v2.5.1+incompatible Latest Latest
Warning

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

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

Documentation

Overview

Package vrfidx implements name-to-index mapping registry and cache for VPP VRFs.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type VRFMetadata

type VRFMetadata struct {
	Index    uint32
	Protocol l3.VrfTable_Protocol
}

VRFMetadata collects metadata for VPP VRF used in secondary lookups.

func (*VRFMetadata) GetIndex

func (vrfm *VRFMetadata) GetIndex() uint32

GetIndex returns VRF index.

func (*VRFMetadata) GetProtocol

func (vrfm *VRFMetadata) GetProtocol() l3.VrfTable_Protocol

GetProtocol returns VRF IP protocol.

type VRFMetadataDto

type VRFMetadataDto struct {
	idxmap.NamedMappingEvent
	Metadata *VRFMetadata
}

VRFMetadataDto represents an item sent through watch channel in VRFMetadataIndex. In contrast to NamedMappingGenericEvent, it contains typed VRF metadata.

type VRFMetadataIndex

type VRFMetadataIndex interface {
	// LookupByName retrieves a previously stored metadata of VRF
	// identified by <label>. If there is no VRF associated with the give
	// label in the mapping, the <exists> is returned as *false* and <metadata>
	// as *nil*.
	LookupByName(name string) (metadata *VRFMetadata, exists bool)

	// LookupByVRFIndex retrieves a previously stored VRF identified in
	// VPP by the given <index>.
	// If there is no VRF associated with the given index, <exists> is returned
	// as *false* with <name> and <metadata> both set to empty values.
	LookupByVRFIndex(index uint32) (name string, metadata *VRFMetadata, exists bool)

	// ListAllVRFs returns slice of labels of all VRFs in the mapping.
	ListAllVRFs() (names []string)

	// ListAllVrfMetadata returns a list of VRF metadata - ID/Proto pairs as
	// read from VRF metadata.
	ListAllVrfMetadata() (idList []*VRFMetadata)

	// WatchVRFs allows to subscribe to watch for changes in the VRF mapping.
	WatchVRFs(subscriber string, channel chan<- VRFMetadataDto)
}

VRFMetadataIndex provides read-only access to mapping with VPP VRF metadata. It extends from NameToIndex.

type VRFMetadataIndexRW

type VRFMetadataIndexRW interface {
	VRFMetadataIndex
	idxmap.NamedMappingRW
}

VRFMetadataIndexRW provides read-write access to mapping with VRF metadata.

func NewVRFIndex

func NewVRFIndex(logger logging.Logger, title string) VRFMetadataIndexRW

NewVRFIndex creates a new instance implementing VRFMetadataIndexRW.

Jump to

Keyboard shortcuts

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