l3idx

package
v1.9.0-alpha Latest Latest
Warning

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

Go to latest
Published: Dec 12, 2018 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ARPIndex

type ARPIndex 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 *l3.ArpTable_ArpEntry, exists bool)

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

	// LookupNamesByInterface returns names of items that contains given interface name in metadata
	LookupNamesByInterface(ifName string) []*l3.ArpTable_ArpEntry

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

ARPIndex provides read-only access to mapping between software ARP indexes and ARP names

type ARPIndexDto

type ARPIndexDto struct {
	idxvpp.NameToIdxDtoWithoutMeta
	Metadata *l3.ArpTable_ArpEntry
}

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

type ARPIndexRW

type ARPIndexRW interface {
	ARPIndex

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

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

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

ARPIndexRW is mapping between software ARP indexes (used internally in VPP) and ARP entry names.

func NewARPIndex

func NewARPIndex(mapping idxvpp.NameToIdxRW) ARPIndexRW

NewARPIndex creates new instance of ArpIndex.

type ArpIndex

type ArpIndex struct {
	// contains filtered or unexported fields
}

ArpIndex is type-safe implementation of mapping between Software ARP index and ARP name.

func (*ArpIndex) Clear

func (arpIndex *ArpIndex) Clear()

Clear removes all ARP entries from the cache.

func (*ArpIndex) GetMapping

func (arpIndex *ArpIndex) GetMapping() idxvpp.NameToIdxRW

GetMapping returns internal read-only mapping. It is used in tests to inspect the content of the ArpIndex.

func (*ArpIndex) LookupIdx

func (arpIndex *ArpIndex) LookupIdx(name string) (idx uint32, metadata *l3.ArpTable_ArpEntry, exists bool)

LookupIdx looks up previously stored item identified by index in mapping.

func (*ArpIndex) LookupName

func (arpIndex *ArpIndex) LookupName(idx uint32) (name string, metadata *l3.ArpTable_ArpEntry, exists bool)

LookupName looks up previously stored item identified by name in mapping.

func (*ArpIndex) LookupNamesByInterface

func (arpIndex *ArpIndex) LookupNamesByInterface(ifName string) []*l3.ArpTable_ArpEntry

LookupNamesByInterface returns all names related to the provided interface

func (*ArpIndex) RegisterName

func (arpIndex *ArpIndex) RegisterName(name string, idx uint32, ifMeta *l3.ArpTable_ArpEntry)

RegisterName adds new item into name-to-index mapping.

func (*ArpIndex) UnregisterName

func (arpIndex *ArpIndex) UnregisterName(name string) (idx uint32, metadata *l3.ArpTable_ArpEntry, exists bool)

UnregisterName removes an item identified by name from mapping

func (*ArpIndex) WatchNameToIdx

func (arpIndex *ArpIndex) WatchNameToIdx(subscriber string, pluginChannel chan ARPIndexDto)

WatchNameToIdx allows to subscribe for watching changes in SwIfIndex mapping

type RouteIndex

type RouteIndex interface {
	// GetMapping returns internal read-only mapping with metadata of l3.StaticRoutes_Route type.
	GetMapping() idxvpp.NameToIdxRW

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

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

	// LookupRouteAndIDByOutgoingIfc returns structure with route name and data which contains specified ifName
	// in metadata as outgoing interface
	LookupRouteAndIDByOutgoingIfc(ifName string) []StaticRoutesRouteAndIdx
}

RouteIndex provides read-only access to mapping between routes data and route names

type RouteIndexRW

type RouteIndexRW interface {
	RouteIndex

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

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

	// Clear removes all Routes from the mapping.
	Clear()
}

RouteIndexRW is mapping between routes data (metadata) and routes entry names.

func NewRouteIndex

func NewRouteIndex(mapping idxvpp.NameToIdxRW) RouteIndexRW

NewRouteIndex creates new instance of routeIndex.

type StaticRoutesRouteAndIdx

type StaticRoutesRouteAndIdx struct {
	Route   *l3.StaticRoutes_Route
	RouteID string
}

StaticRoutesRouteAndIdx is used for associating route with route name in func return value It is used as container to return more values

Jump to

Keyboard shortcuts

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