ifaceidx

package
v2.2.0+incompatible Latest Latest
Warning

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

Go to latest
Published: Aug 27, 2019 License: Apache-2.0 Imports: 5 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package ifaceidx implements name-to-index mapping for Linux interfaces.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type LinuxIfMetadata

type LinuxIfMetadata struct {
	LinuxIfIndex int
	VPPTapName   string // empty for VETHs
	Namespace    *linux_namespace.NetNamespace
}

LinuxIfMetadata collects metadata for Linux interface used in secondary lookups.

type LinuxIfMetadataIndex

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

	// LookupByVPPTap retrieves a previously configured TAP_TO_VPP interface
	// by the logical name of the associated VPP-side of the TAP.
	// If there is no such interface, <exists> is returned as *false* with <name>
	// and <metadata> both set to empty values.
	LookupByVPPTap(vppTapName string) (name string, metadata *LinuxIfMetadata, exists bool)

	// ListAllInterfaces returns slice of names of all interfaces in the mapping.
	ListAllInterfaces() (names []string)

	// WatchInterfaces allows to subscribe to watch for changes in the mapping
	// of interface metadata.
	WatchInterfaces(subscriber string, channel chan<- LinuxIfMetadataIndexDto)
}

LinuxIfMetadataIndex provides read-only access to mapping with Linux interface metadata. It extends from NameToIndex.

type LinuxIfMetadataIndexDto

type LinuxIfMetadataIndexDto struct {
	idxmap.NamedMappingEvent
	Metadata *LinuxIfMetadata
}

LinuxIfMetadataIndexDto represents an item sent through watch channel in LinuxIfMetadataIndex. In contrast to NamedMappingGenericEvent, it contains typed interface metadata.

type LinuxIfMetadataIndexRW

type LinuxIfMetadataIndexRW interface {
	LinuxIfMetadataIndex
	idxmap.NamedMappingRW
}

LinuxIfMetadataIndexRW provides read-write access to mapping with interface metadata.

func NewLinuxIfIndex

func NewLinuxIfIndex(logger logging.Logger, title string) LinuxIfMetadataIndexRW

NewLinuxIfIndex creates a new instance implementing LinuxIfMetadataIndexRW.

Jump to

Keyboard shortcuts

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