defaultplugins

package
v1.4.0 Latest Latest
Warning

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

Go to latest
Published: May 24, 2018 License: Apache-2.0 Imports: 48 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
  • set VPP resync strategy

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

Resync Strategy

There are several strategies available for VPP resync:

  • full always performs the full resync of all VPP plugins. This is the default strategy if none is set.
  • optimize-cold-start evaluates the existing configuration in the VPP at first. The state of interfaces is the decision-maker: if there is any interface configured except local0, the resync is performed normally. Otherwise it is skipped. Use it carefully because this strategy does not take into consideration the state of the etcd.

Strategy can be set in defaultplugins.conf:

strategy: full or strategy: optimize

To skip resync completely, start vpp-agent with --skip-vpp-resync parameter. In such a case the resync is skipped (config file resync strategy is not taken into account).

Status Publishers

Status Publishers define list of data syncs to which status is published.

status-publishers: [<datasync>, <datasync2>, ...]

Currently supported data syncs for publishing state: etcd and redis.

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

This section is empty.

Types

type API added in v1.0.8

type API interface {

	// DisableResync for one or more VPP plugins. Use in Init() phase.
	DisableResync(keyPrefix ...string)

	// 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")
	//
	GetSwIfIndexes() ifaceidx.SwIfIndex

	// GetSwIfIndexes gives access to mapping of logical names (used in ETCD configuration) to dhcp_index.
	// This mapping is helpful if other plugins need to know about the DHCP configuration given to interface.
	GetDHCPIndices() ifaceidx.DhcpIndex

	// 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.
	GetBfdSessionIndexes() 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.
	GetBfdAuthKeyIndexes() 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.
	GetBfdEchoFunctionIndexes() idxvpp.NameToIdx

	// 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.
	GetBDIndexes() l2idx.BDIndex

	// 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
	GetFIBIndexes() l2idx.FIBIndexRW

	// 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.
	GetXConnectIndexes() l2idx.XcIndexRW

	// GetAppNsIndexes gives access to mapping of app-namespace logical names (used in ETCD configuration)
	// to their respective indices as assigned by VPP.
	GetAppNsIndexes() nsidx.AppNsIndex

	// DumpACL returns a list of all configured ACLs.
	DumpACL() (acls []*acl.AccessLists_Acl, err error)

	// DumpNat44Global returns the current NAT44 global config
	DumpNat44Global() (*nat.Nat44Global, error)

	// DumpNat44DNat returns the current NAT44 DNAT config
	DumpNat44DNat() (*nat.Nat44DNat, error)

	// GetIPSecSAIndexes
	GetIPSecSAIndexes() idxvpp.NameToIdx

	// GetIPSecSPDIndexes
	GetIPSecSPDIndexes() idxvpp.NameToIdx
}

API of VPP Plugin

type DPConfig added in v1.0.5

type DPConfig struct {
	Mtu              uint32   `json:"mtu"`
	Stopwatch        bool     `json:"stopwatch"`
	Strategy         string   `json:"strategy"`
	StatusPublishers []string `json:"status-publishers"`
}

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.FibTable_FibEntry
	// 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
	// ArpEntries is a list af all ARP entries that are expected to be in VPP after RESYNC.
	ArpEntries []*l3.ArpTable_ArpEntry
	// ProxyArpInterfaces is a list af all proxy ARP interface entries that are expected to be in VPP after RESYNC.
	ProxyArpInterfaces []*l3.ProxyArpInterfaces_InterfaceList
	// ProxyArpRanges is a list af all proxy ARP ranges that are expected to be in VPP after RESYNC.
	ProxyArpRanges []*l3.ProxyArpRanges_RangeList
	// L4Features is a bool flag that is expected to be set in VPP after RESYNC.
	L4Features *l4.L4Features
	// AppNamespaces is a list af all App Namespaces that are expected to be in VPP after RESYNC.
	AppNamespaces []*l4.AppNamespaces_AppNamespace
	// StnRules is a list of all STN Rules that are expected to be in VPP after RESYNC
	StnRules []*stn.STN_Rule
	// NatGlobal is a definition of global NAT config
	Nat44Global *nat.Nat44Global
	// Nat44SNat is a list of all SNAT configurations expected to be in VPP after RESYNC
	Nat44SNat []*nat.Nat44SNat_SNatConfig
	// Nat44DNat is a list of all DNAT configurations expected to be in VPP after RESYNC
	Nat44DNat []*nat.Nat44DNat_DNatConfig
	// IPSecSPDs is a list of all IPSec Security Policy Databases expected to be in VPP after RESYNC
	IPSecSPDs []*ipsec.SecurityPolicyDatabases_SPD
	// IPSecSAs is a list of all IPSec Security Associations expected to be in VPP after RESYNC
	IPSecSAs []*ipsec.SecurityAssociations_SA
	// IPSecTunnels is a list of all IPSec Tunnel interfaces expected to be in VPP after RESYNC
	IPSecTunnels []*ipsec.TunnelInterfaces_Tunnel
	// LocalSids is a list of all segment routing local SIDs expected to be in VPP after RESYNC
	LocalSids []*srv6.LocalSID
	// SrPolicies is a list of all segment routing policies expected to be in VPP after RESYNC
	SrPolicies []*srv6.Policy
	// SrPolicySegments is a list of all segment routing policy segments (with identifiable name) expected to be in VPP after RESYNC
	SrPolicySegments []*srplugin.NamedPolicySegment
	// SrSteerings is a list of all segment routing steerings (with identifiable name) expected to be in VPP after RESYNC
	SrSteerings []*srplugin.NamedSteering
}

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
	GRPCSvc           rpc.GRPCService

	DataSyncs        map[string]datasync.KeyProtoValWriter
	WatchEventsMutex *sync.Mutex
}

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

type ErrCtx

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

ErrCtx is an error context struct which stores an event change with object identifier (name, etc.) and returns an 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 the call to ifStateUpdater.

func (*Plugin) Close

func (plugin *Plugin) Close() error

Close cleans up the resources.

func (*Plugin) DisableResync added in v1.0.8

func (plugin *Plugin) DisableResync(keyPrefix ...string)

DisableResync can be used to disable resync for one or more key prefixes

func (*Plugin) DumpACL added in v1.4.0

func (plugin *Plugin) DumpACL() (acls []*acl.AccessLists_Acl, err error)

DumpACL returns a list of all configured ACL entires

func (*Plugin) DumpNat44DNat added in v1.4.0

func (plugin *Plugin) DumpNat44DNat() (*nat.Nat44DNat, error)

DumpNat44DNat returns the current NAT44 DNAT config

func (*Plugin) DumpNat44Global added in v1.4.0

func (plugin *Plugin) DumpNat44Global() (*nat.Nat44Global, error)

DumpNat44Global returns the current NAT44 global config

func (*Plugin) GetAppNsIndexes added in v1.4.0

func (plugin *Plugin) GetAppNsIndexes() nsidx.AppNsIndex

GetAppNsIndexes gives access to mapping of app-namespace logical names (used in ETCD configuration) to their respective indices as assigned by VPP.

func (*Plugin) GetBDIndexes added in v1.0.8

func (plugin *Plugin) GetBDIndexes() l2idx.BDIndex

GetBDIndexes gives access to mapping of logical names (used in ETCD configuration) as bd_indexes.

func (*Plugin) GetBfdAuthKeyIndexes added in v1.0.8

func (plugin *Plugin) GetBfdAuthKeyIndexes() idxvpp.NameToIdx

GetBfdAuthKeyIndexes gives access to mapping of logical names (used in ETCD configuration) to bfd_auth_keys.

func (*Plugin) GetBfdEchoFunctionIndexes added in v1.0.8

func (plugin *Plugin) GetBfdEchoFunctionIndexes() idxvpp.NameToIdx

GetBfdEchoFunctionIndexes gives access to mapping of logical names (used in ETCD configuration) to bfd_echo_function

func (*Plugin) GetBfdSessionIndexes added in v1.0.8

func (plugin *Plugin) GetBfdSessionIndexes() idxvpp.NameToIdx

GetBfdSessionIndexes gives access to mapping of logical names (used in ETCD configuration) to bfd_session_indexes.

func (*Plugin) GetDHCPIndices added in v1.4.0

func (plugin *Plugin) GetDHCPIndices() ifaceidx.DhcpIndex

GetDHCPIndices gives access to mapping of logical names (used in ETCD configuration) to dhcp_index. This mapping is helpful if other plugins need to know about the DHCP configuration set by VPP.

func (*Plugin) GetFIBIndexes added in v1.0.8

func (plugin *Plugin) GetFIBIndexes() l2idx.FIBIndexRW

GetFIBIndexes gives access to mapping of logical names (used in ETCD configuration) as fib_indexes.

func (*Plugin) GetIPSecSAIndexes added in v1.4.0

func (plugin *Plugin) GetIPSecSAIndexes() idxvpp.NameToIdx

GetIPSecSAIndexes

func (*Plugin) GetIPSecSPDIndexes added in v1.4.0

func (plugin *Plugin) GetIPSecSPDIndexes() idxvpp.NameToIdx

GetIPSecSPDIndexes

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.

func (*Plugin) GetXConnectIndexes added in v1.0.8

func (plugin *Plugin) GetXConnectIndexes() l2idx.XcIndexRW

GetXConnectIndexes gives access to mapping of logical names (used in ETCD configuration) as xc_indexes.

func (*Plugin) Init

func (plugin *Plugin) Init() error

Init gets handlers for ETCD and 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.
vppcalls
Package vppcalls contains wrappers over VPP ACL binary APIs.
Package vppcalls contains wrappers over VPP ACL binary APIs.
vppdump
Package vppdump provides helpers to dump ACLs configured in VPP - per interface and total.
Package vppdump provides helpers to dump ACLs configured in VPP - per interface and total.
common
bin_api
Package binapi defines southbound API of the default plugins.
Package binapi defines southbound API of the default plugins.
bin_api/acl
Code generated by govpp binapi-generator DO NOT EDIT.
Code generated by govpp binapi-generator DO NOT EDIT.
bin_api/af_packet
Code generated by govpp binapi-generator DO NOT EDIT.
Code generated by govpp binapi-generator DO NOT EDIT.
bin_api/bfd
Code generated by govpp binapi-generator DO NOT EDIT.
Code generated by govpp binapi-generator DO NOT EDIT.
bin_api/dhcp
Code generated by govpp binapi-generator DO NOT EDIT.
Code generated by govpp binapi-generator DO NOT EDIT.
bin_api/interfaces
Code generated by govpp binapi-generator DO NOT EDIT.
Code generated by govpp binapi-generator DO NOT EDIT.
bin_api/ip
Code generated by govpp binapi-generator DO NOT EDIT.
Code generated by govpp binapi-generator DO NOT EDIT.
bin_api/ipsec
Code generated by govpp binapi-generator DO NOT EDIT.
Code generated by govpp binapi-generator DO NOT EDIT.
bin_api/l2
Code generated by govpp binapi-generator DO NOT EDIT.
Code generated by govpp binapi-generator DO NOT EDIT.
bin_api/memif
Code generated by govpp binapi-generator DO NOT EDIT.
Code generated by govpp binapi-generator DO NOT EDIT.
bin_api/nat
Code generated by govpp binapi-generator DO NOT EDIT.
Code generated by govpp binapi-generator DO NOT EDIT.
bin_api/session
Code generated by govpp binapi-generator DO NOT EDIT.
Code generated by govpp binapi-generator DO NOT EDIT.
bin_api/sr
Code generated by govpp binapi-generator DO NOT EDIT.
Code generated by govpp binapi-generator DO NOT EDIT.
bin_api/stats
Code generated by govpp binapi-generator DO NOT EDIT.
Code generated by govpp binapi-generator DO NOT EDIT.
bin_api/stn
Code generated by govpp binapi-generator DO NOT EDIT.
Code generated by govpp binapi-generator DO NOT EDIT.
bin_api/tap
Code generated by govpp binapi-generator DO NOT EDIT.
Code generated by govpp binapi-generator DO NOT EDIT.
bin_api/tapv2
Code generated by govpp binapi-generator DO NOT EDIT.
Code generated by govpp binapi-generator DO NOT EDIT.
bin_api/vpe
Code generated by govpp binapi-generator DO NOT EDIT.
Code generated by govpp binapi-generator DO NOT EDIT.
bin_api/vxlan
Code generated by govpp binapi-generator DO NOT EDIT.
Code generated by govpp binapi-generator DO NOT EDIT.
model
Package model defines the northbound API of the default plugins.
Package model defines the northbound API of the default plugins.
model/acl
Package acl is a generated protocol buffer package.
Package acl is a generated protocol buffer package.
model/bfd
Package bfd is a generated protocol buffer package.
Package bfd is a generated protocol buffer package.
model/interfaces
Package interfaces is a generated protocol buffer package.
Package interfaces is a generated protocol buffer package.
model/ipsec
Package ipsec is a generated protocol buffer package.
Package ipsec is a generated protocol buffer package.
model/l2
Package l2 is a generated protocol buffer package.
Package l2 is a generated protocol buffer package.
model/l3
Package l3 is a generated protocol buffer package.
Package l3 is a generated protocol buffer package.
model/l4
Package l4 is a generated protocol buffer package.
Package l4 is a generated protocol buffer package.
model/nat
Package nat is a generated protocol buffer package.
Package nat is a generated protocol buffer package.
model/rpc
Package model is the parent for packages defining various GRPC services generated from protobuf data models.
Package model is the parent for packages defining various GRPC services generated from protobuf data models.
model/srv6
Package srv6 is a generated protocol buffer package.
Package srv6 is a generated protocol buffer package.
model/stn
Package stn is a generated protocol buffer package.
Package stn is a generated protocol buffer package.
Package ifplugin implements the Interface plugin that handles management of VPP interfaces.
Package ifplugin implements the Interface plugin that handles management of VPP interfaces.
ifaceidx
Package ifaceidx implements name-to-index mapping registry and cache for VPP interfaces.
Package ifaceidx implements name-to-index mapping registry and cache for VPP interfaces.
vppcalls
Package vppcalls contains wrappers over VPP binary APIs for all supported interface types.
Package vppcalls contains wrappers over VPP binary APIs for all supported interface types.
vppdump
Package vppdump provides helpers for dumping all interfaces configured in VPP.
Package vppdump provides helpers for dumping all interfaces configured in VPP.
Package ipsecplugin implements the IPSec plugin that handles management of IPSec for VPP.
Package ipsecplugin implements the IPSec plugin that handles management of IPSec for VPP.
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.
l2idx
Package bdidx implements name-to-index mapping registry and cache for bridge-domains.
Package bdidx implements name-to-index mapping registry and cache for bridge-domains.
vppcalls
Package vppcalls contains wrappers over VPP binary APIs for bridge-domains, and L2 FIBs and XConnect pairs.
Package vppcalls contains wrappers over VPP binary APIs for bridge-domains, and L2 FIBs and XConnect pairs.
vppdump
Package vppdump provides helpers for dumping all bridge-domains, L2 FIBs and XConnect pairs configured in VPP.
Package vppdump provides helpers for dumping all bridge-domains, L2 FIBs and XConnect pairs configured in VPP.
Package l3plugin implements the L3 plugin that handles L3 FIBs.
Package l3plugin implements the L3 plugin that handles L3 FIBs.
vppcalls
Package vppcalls contains wrappers over VPP binary APIs for L3 FIBs.
Package vppcalls contains wrappers over VPP binary APIs for L3 FIBs.
vppdump
Package vppdump provides helpers for dumping all L3 FIBs configured in VPP.
Package vppdump provides helpers for dumping all L3 FIBs configured in VPP.
nsidx
Package nsidx implements name-to-index mapping registry and cache for app namespaces
Package nsidx implements name-to-index mapping registry and cache for app namespaces
cache
Package cache contains caches for certain modeled types.
Package cache contains caches for certain modeled types.
vppcalls
Package vppcalls contains wrappers over VPP binary APIs to simplify their usage
Package vppcalls contains wrappers over VPP binary APIs to simplify their usage

Jump to

Keyboard shortcuts

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