ifplugin

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

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DefaultPlugin = *NewPlugin()

DefaultPlugin is a default instance of IfPlugin.

Functions

This section is empty.

Types

type API

type API interface {
	// GetInterfaceIndex gives read-only access to map with metadata of all configured
	// linux interfaces.
	GetInterfaceIndex() ifaceidx.LinuxIfMetadataIndex
}

API defines methods exposed by Linux-IfPlugin.

type Config

type Config struct {
	Disabled      bool `json:"disabled"`
	GoRoutinesCnt int  `json:"go-routines-count"`
}

Config holds the ifplugin configuration.

type Deps

type Deps struct {
	infra.PluginDeps
	ServiceLabel servicelabel.ReaderAPI
	KVScheduler  kvs.KVScheduler
	NsPlugin     nsplugin.API
	AddrAlloc    netalloc.AddressAllocator
	VppIfPlugin  descriptor.VPPIfPluginAPI /* mandatory if TAP_TO_VPP interfaces are used */
}

Deps lists dependencies of the interface plugin.

type IfPlugin

type IfPlugin struct {
	Deps
	// contains filtered or unexported fields
}

IfPlugin configures Linux VETH and TAP interfaces using Netlink API.

func NewPlugin

func NewPlugin(opts ...Option) *IfPlugin

NewPlugin creates a new Plugin with the provides Options

func (*IfPlugin) Close

func (p *IfPlugin) Close() error

Close stops watching of the default network namespace.

func (*IfPlugin) GetInterfaceIndex

func (p *IfPlugin) GetInterfaceIndex() ifaceidx.LinuxIfMetadataIndex

GetInterfaceIndex gives read-only access to map with metadata of all configured linux interfaces.

func (*IfPlugin) Init

func (p *IfPlugin) Init() error

Init registers interface-related descriptors and starts watching of the default network namespace for interface changes.

type Option

type Option func(*IfPlugin)

Option is a function that can be used in NewPlugin to customize Plugin.

func UseDeps

func UseDeps(f func(*Deps)) Option

UseDeps returns Option that can inject custom dependencies.

Directories

Path Synopsis
Package ifaceidx implements name-to-index mapping for Linux interfaces.
Package ifaceidx implements name-to-index mapping for Linux interfaces.
Package linuxcalls contains wrappers over Netlink APIs related to Linux VETH interfaces or Linux interfaces in general.
Package linuxcalls contains wrappers over Netlink APIs related to Linux VETH interfaces or Linux interfaces in general.

Jump to

Keyboard shortcuts

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