linux

package
v1.5.1 Latest Latest
Warning

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

Go to latest
Published: Jul 20, 2018 License: Apache-2.0 Imports: 22 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).

Config file

Stopwatch

Duration of the linux netlink procedure can be measured using stopwatch feature. These data are logged after every event(any resync, interfaces, routes, etc.). Enable stopwatch in linux.conf:

stopwatch: true or stopwatch: false

Stopwatch is disabled by default (if there is no config available).

Documentation

Overview

Package linuxplugin 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
}

API of Linux Plugin

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 {
	local.PluginInfraDeps                             // injected
	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 LinuxConfig

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

LinuxConfig holds the linuxplugin configuration.

type Plugin

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

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

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) 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.
interfaces
Package interfaces is a generated protocol buffer package.
Package interfaces is a generated protocol buffer package.
l3
Package l3 is a generated protocol buffer package.
Package l3 is a generated protocol buffer package.

Jump to

Keyboard shortcuts

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