linux

package
v2.0.0-alpha+incompatible Latest Latest
Warning

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

Go to latest
Published: Oct 15, 2018 License: Apache-2.0 Imports: 24 Imported by: 0

README

Linux Plugin

The linuxplugin is a core Agent Plugin for the management of a subset of the Linux network configuration. Configuration of VETH (virtual ethernet pair) interfaces, linux routes and ARP entries is currently supported. Detailed description can be found in particular READMEs:

In general, the northbound configuration is translated to a sequence of Netlink API calls (using github.com/vishvananda/netlink and github.com/vishvananda/netns libraries).

Documentation

Overview

Package linux implements the Linux plugin that handles management of Linux VETH interfaces.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type API

type API interface {
	// GetLinuxIfIndexes gives access to mapping of logical names (used in ETCD configuration)
	// to corresponding Linux interface indexes. This mapping is especially helpful
	// for plugins that need to watch for newly added or deleted Linux interfaces.
	GetLinuxIfIndexes() ifaceidx.LinuxIfIndex

	// GetLinuxIfIndexes gives access to mapping of logical names (used in ETCD configuration) to corresponding Linux
	// ARP entry indexes. This mapping is especially helpful for plugins that need to watch for newly added or deleted
	// Linux ARP entries.
	GetLinuxARPIndexes() l3idx.LinuxARPIndex

	// GetLinuxIfIndexes gives access to mapping of logical names (used in ETCD configuration) to corresponding Linux
	// route indexes. This mapping is especially helpful for plugins that need to watch for newly added or deleted
	// Linux routes.
	GetLinuxRouteIndexes() l3idx.LinuxRouteIndex

	// GetNamespaceHandler gives access to namespace API which allows plugins to manipulate with linux namespaces
	GetNamespaceHandler() nsplugin.NamespaceAPI
}

API of Linux Plugin

type Config added in v1.8.1

type Config struct {
	Stopwatch bool `json:"stopwatch"`
	Disabled  bool `json:"disabled"`
}

Config holds the linuxplugin configuration.

type DataResyncReq

type DataResyncReq struct {
	// Interfaces is a list af all interfaces that are expected to be in Linux after RESYNC.
	Interfaces []*interfaces.LinuxInterfaces_Interface
	// ARPs is a list af all arp entries that are expected to be in Linux after RESYNC.
	ARPs []*l3.LinuxStaticArpEntries_ArpEntry
	// Routes is a list af all routes that are expected to be in Linux after RESYNC.
	Routes []*l3.LinuxStaticRoutes_Route
}

DataResyncReq is used to transfer expected configuration of the Linux network stack to the plugins.

func NewDataResyncReq

func NewDataResyncReq() *DataResyncReq

NewDataResyncReq is a constructor of object requirements which are expected to be re-synced.

type Deps

type Deps struct {
	infra.PluginDeps
	StatusCheck  statuscheck.PluginStatusWriter
	ServiceLabel servicelabel.ReaderAPI

	Watcher          datasync.KeyValProtoWatcher // injected
	VPP              *vpp.Plugin
	WatchEventsMutex *sync.Mutex
}

Deps groups injected dependencies of plugin so that they do not mix with other plugin fields.

type Option added in v1.8.1

type Option func(*Plugin)

Option is a function that acts on a Plugin to inject Dependencies or configuration

func UseDeps added in v1.8.1

func UseDeps(cb func(*Deps)) Option

UseDeps returns Option that can inject custom dependencies.

type Plugin

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

Plugin implements Plugin interface, therefore it can be loaded with other plugins.

func NewPlugin added in v1.8.1

func NewPlugin(opts ...Option) *Plugin

NewPlugin creates a new Plugin with the provides Options

func (*Plugin) Close

func (plugin *Plugin) Close() error

Close cleans up the resources.

func (*Plugin) GetLinuxARPIndexes

func (plugin *Plugin) GetLinuxARPIndexes() l3idx.LinuxARPIndex

GetLinuxARPIndexes gives access to mapping of logical names (used in ETCD configuration) to corresponding Linux ARP entry indexes.

func (*Plugin) GetLinuxIfIndexes

func (plugin *Plugin) GetLinuxIfIndexes() ifaceidx.LinuxIfIndex

GetLinuxIfIndexes gives access to mapping of logical names (used in ETCD configuration) interface indexes.

func (*Plugin) GetLinuxRouteIndexes

func (plugin *Plugin) GetLinuxRouteIndexes() l3idx.LinuxRouteIndex

GetLinuxRouteIndexes gives access to mapping of logical names (used in ETCD configuration) to corresponding Linux route indexes.

func (*Plugin) GetNamespaceHandler added in v1.8.1

func (plugin *Plugin) GetNamespaceHandler() nsplugin.NamespaceAPI

GetNamespaceHandler gives access to namespace API which allows plugins to manipulate with linux namespaces

func (*Plugin) Init

func (plugin *Plugin) Init() error

Init gets handlers for ETCD and Kafka and delegates them to ifConfigurator.

func (*Plugin) InjectVppIfIndexes

func (plugin *Plugin) InjectVppIfIndexes(indexes ifaceVPP.SwIfIndex)

InjectVppIfIndexes injects VPP interfaces mapping into Linux plugin

Directories

Path Synopsis
ifaceidx
Package ifaceidx implements name-to-index mapping registry and cache for Linux interfaces.
Package ifaceidx implements name-to-index mapping registry and cache for Linux interfaces.
linuxcalls
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.
l3idx
Package l3idx implements name-to-index mapping registry and cache for Linux static arp entries and static routes.
Package l3idx implements name-to-index mapping registry and cache for Linux static arp entries and static routes.
Package model defines the linuxplugin's northbound API.
Package model defines the linuxplugin's northbound API.
l3

Jump to

Keyboard shortcuts

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