defaultplugins

package
v1.0.6 Latest Latest
Warning

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

Go to latest
Published: Oct 18, 2017 License: Apache-2.0 Imports: 28 Imported by: 0

README

Default plugins

Default plugins manage basic configuration of VPP. The management of configuration is split among multiple packages. Detailed description can be found in particular READMEs:

Config file

The default plugins can use configuration file defaultplugins.conf to:

  • set global maximum transmission unit
  • enable/disable stopwatch

To run the vpp-agent with defaultplugins.conf:

vpp-agent --defaultplugins-config=/opt/vpp-agent/dev/defaultplugins.conf

##MTU MTU is used in interface plugin. The value is preferred before global setting which is set to 9000 bytes. Mtu is written in config as follows:

mtu: <value>

##Stopwatch Duration of VPP binary api call during resync can be measured using stopwatch. These data are then logged after every partial resync (interfaces, bridge domains, fib entries etc.). Enable stopwatch in defaultplugins.conf:

stopwatch: true or stopwatch: false

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

Documentation

Overview

Package defaultplugins is the parent package for all "default" VPP-related plugins.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetBDIndexes

func GetBDIndexes() bdidx.BDIndex

GetBDIndexes gives access to mapping of logical names (used in ETCD configuration) as bd_indexes. The mapping consists from the unique Bridge domain name and the bridge domain ID

func GetBfdAuthKeyIndexes

func GetBfdAuthKeyIndexes() idxvpp.NameToIdx

GetBfdAuthKeyIndexes gives access to mapping of logical names (used in ETCD configuration) to bfd_auth_keys. The authentication key has its own unique ID - the value is as a string stored in the mapping. Unique index is generated uint32 number

func GetBfdEchoFunctionIndexes

func GetBfdEchoFunctionIndexes() idxvpp.NameToIdx

GetBfdEchoFunctionIndexes gives access to mapping of logical names (used in ETCD configuration) to bfd_echo_function The echo function uses the interface name as an unique ID - this value is as a string stored in the mapping. The index is generated uint32 number

func GetBfdSessionIndexes

func GetBfdSessionIndexes() idxvpp.NameToIdx

GetBfdSessionIndexes gives access to mapping of logical names (used in ETCD configuration) to bfd_session_indexes. The mapping consists of the interface (its name), generated index and the BFDSessionMeta with an authentication key used for the particular session.

func GetConfiguredInterfaceToBridgeDomainIndexes

func GetConfiguredInterfaceToBridgeDomainIndexes() idxvpp.NameToIdx

GetConfiguredInterfaceToBridgeDomainIndexes gives access to mapping of logical names (used in ETCD configuration) The mapping holds all interface to bridge domain pairs which are currently configured on the VPP. The mapping uses interface name, unique index and a metadata with information about whether the interface is BVI and which bridge domain it belongs to

func GetFIBDesIndexes

func GetFIBDesIndexes() idxvpp.NameToIdx

GetFIBDesIndexes gives access to mapping of logical names (used in ETCD configuration) as fib_des_indexes. The mapping reflects the desired state. FIBs that have been created, but cannot be configured because of missing interface or bridge domain are stored here. If both, interface and bridge domain are created later, stored FIBs will be configured as well. The mapping uses FIBMeta as metadata (the same as above)

func GetFIBIndexes

func GetFIBIndexes() idxvpp.NameToIdx

GetFIBIndexes gives access to mapping of logical names (used in ETCD configuration) as fib_indexes. The FIB's physical address is the name in the mapping. The key is generated. The FIB mapping also contains a metadata, FIBMeta with various info about the Interface/Bridge domain where this fib belongs to: - InterfaceName - Bridge domain name - BVI (bool flag for interface) - Static config

func GetRegisteredInterfaceToBridgeDomainIndexes

func GetRegisteredInterfaceToBridgeDomainIndexes() idxvpp.NameToIdx

GetRegisteredInterfaceToBridgeDomainIndexes gives access to mapping of logical names (used in ETCD configuration). The mapping holds all interface to bridge domain pairs which should be configured on the VPP. The mapping uses the interface name, unique index and a metadata with information about whether the interface is BVI and which bridge domain it belongs to

func GetSwIfIndexes

func GetSwIfIndexes() ifaceidx.SwIfIndex

GetSwIfIndexes gives access to mapping of logical names (used in ETCD configuration) to sw_if_index. This mapping is helpful if other plugins need to configure VPP by the Binary API that uses sw_if_index input.

Example of is_sw_index lookup by logical name of the port "vswitch_ingres" of the network interface

func Init() error {
   swIfIndexes := defaultplugins.GetSwIfIndexes()
   swIfIndexes.LookupByName("vswitch_ingres")

func GetXConnectIndexes

func GetXConnectIndexes() idxvpp.NameToIdx

GetXConnectIndexes gives access to mapping of logical names (used in ETCD configuration) as xc_indexes. The mapping uses the name and the index of receive interface (the one all packets are received on). XConnectMeta is a container for the transmit interface name.

Types

type DPConfig added in v1.0.5

type DPConfig struct {
	Mtu       uint32 `json:"mtu"`
	Stopwatch bool   `json:"stopwatch"`
}

DPConfig holds the defaultpluigns configuration

type DataResyncReq

type DataResyncReq struct {
	// ACLs is a list af all access lists that are expected to be in VPP after RESYNC
	ACLs []*acl.AccessLists_Acl
	// Interfaces is a list af all interfaces that are expected to be in VPP after RESYNC
	Interfaces []*interfaces.Interfaces_Interface
	// SingleHopBFDSession is a list af all BFD sessions that are expected to be in VPP after RESYNC
	SingleHopBFDSession []*bfd.SingleHopBFD_Session
	// SingleHopBFDKey is a list af all BFD authentication keys that are expected to be in VPP after RESYNC
	SingleHopBFDKey []*bfd.SingleHopBFD_Key
	// SingleHopBFDEcho is a list af all BFD echo functions that are expected to be in VPP after RESYNC
	SingleHopBFDEcho []*bfd.SingleHopBFD_EchoFunction
	// BridgeDomains is a list af all BDs that are expected to be in VPP after RESYNC
	BridgeDomains []*l2.BridgeDomains_BridgeDomain
	// FibTableEntries is a list af all FIBs that are expected to be in VPP after RESYNC
	FibTableEntries []*l2.FibTableEntries_FibTableEntry
	// XConnects is a list af all XCons that are expected to be in VPP after RESYNC
	XConnects []*l2.XConnectPairs_XConnectPair
	// StaticRoutes is a list af all Static Routes that are expected to be in VPP after RESYNC
	StaticRoutes []*l3.StaticRoutes_Route
}

DataResyncReq is used to transfer expected configuration of the VPP to the plugins

func NewDataResyncReq

func NewDataResyncReq() *DataResyncReq

NewDataResyncReq is a constructor

type Deps added in v1.0.2

type Deps struct {
	// inject all below
	local.PluginInfraDeps
	Publish           datasync.KeyProtoValWriter
	PublishStatistics datasync.KeyProtoValWriter
	Watch             datasync.KeyValProtoWatcher
	IfStatePub        datasync.KeyProtoValWriter
	GoVppmux          govppmux.API
	Linux             linuxpluginAPI
}

Deps is here to group injected dependencies of plugin to not mix with other plugin fieldsMtu.

type ErrCtx

type ErrCtx struct {
	// contains filtered or unexported fields
}

ErrCtx is an error context struct which stores event change with object identifier (name, etc) and returned error (can be nil)

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) AfterInit

func (plugin *Plugin) AfterInit() error

AfterInit delegates to ifStateUpdater

func (*Plugin) Close

func (plugin *Plugin) Close() error

Close cleans up the resources

func (*Plugin) GetSwIfIndexes added in v1.0.5

func (plugin *Plugin) GetSwIfIndexes() ifaceidx.SwIfIndex

GetSwIfIndexes gives access to mapping of logical names (used in ETCD configuration) to sw_if_index. This mapping is helpful if other plugins need to configure VPP by the Binary API that uses sw_if_index input.

Example of is_sw_index lookup by logical name of the port "vswitch_ingres" of the network interface

func Init() error {
   swIfIndexes := defaultplugins.GetSwIfIndexes()
   swIfIndexes.LookupByName("vswitch_ingres")

func (*Plugin) Init

func (plugin *Plugin) Init() error

Init gets handlers for ETCD, Messaging and delegates them to ifConfigurator & ifStateUpdater

Directories

Path Synopsis
Package aclplugin implements the ACL Plugin that handles management of VPP Access lists.
Package aclplugin implements the ACL Plugin that handles management of VPP Access lists.
Package ifplugin implements the Interface plugin that handles management of VPP interfaces.
Package ifplugin implements the Interface plugin that handles management of VPP interfaces.
Package l2plugin implements the L2 plugin that handles Bridge Domains and L2 FIBs.
Package l2plugin implements the L2 plugin that handles Bridge Domains and L2 FIBs.
Package l3plugin implements the L3 plugin that handles L3 FIBs.
Package l3plugin implements the L3 plugin that handles L3 FIBs.

Jump to

Keyboard shortcuts

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