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: 4 Imported by: 0

Documentation

Overview

Package l3idx implements name-to-index mapping registry and cache for Linux static arp entries and static routes.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type LinuxARPIndex

type LinuxARPIndex 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.LinuxStaticArpEntries_ArpEntry, exists bool)

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

	// LookupNameByHostIfName looks up the interface identified by the name used in HostOs
	LookupNameByHostIfName(hostIfName string) []string

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

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

type LinuxARPIndexDto

type LinuxARPIndexDto struct {
	idxvpp.NameToIdxDtoWithoutMeta
	Metadata *l3.LinuxStaticArpEntries_ArpEntry
}

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

type LinuxARPIndexRW

type LinuxARPIndexRW interface {
	LinuxARPIndex

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

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

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

func NewLinuxARPIndex

func NewLinuxARPIndex(mapping idxvpp.NameToIdxRW) LinuxARPIndexRW

NewLinuxARPIndex creates new instance of linuxArpIndex.

type LinuxRouteIndex

type LinuxRouteIndex 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.LinuxStaticRoutes_Route, exists bool)

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

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

	// LookupNameByHostIfName looks up the interface identified by the name used in HostOs
	LookupNameByHostIfName(hostIfName string) []string

	// LookupRouteByIP looks for static route, which network (destination) contains provided address
	LookupRouteByIP(ns *l3.LinuxStaticRoutes_Route_Namespace, ipAddress string) (*l3.LinuxStaticRoutes_Route, error)

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

LinuxRouteIndex provides read-only access to mapping between software route indexes and route names

type LinuxRouteIndexDto

type LinuxRouteIndexDto struct {
	idxvpp.NameToIdxDtoWithoutMeta
	Metadata *l3.LinuxStaticRoutes_Route
}

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

type LinuxRouteIndexRW

type LinuxRouteIndexRW interface {
	LinuxRouteIndex

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

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

LinuxRouteIndexRW is mapping between software route indexes (used internally in VPP) and routes entry names.

func NewLinuxRouteIndex

func NewLinuxRouteIndex(mapping idxvpp.NameToIdxRW) LinuxRouteIndexRW

NewLinuxRouteIndex creates new instance of linuxRouteIndex.

Jump to

Keyboard shortcuts

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