Documentation ¶
Overview ¶
Package ifplugin implements the Interface plugin that handles management of VPP interfaces.
Index ¶
- Constants
- func CheckStn(stnInput *model_stn.StnRule, index ifaceidx.SwIfIndex, log logging.Logger) (*vppcalls.StnRule, error)
- type AFPacketConfigurator
- func (plugin *AFPacketConfigurator) ConfigureAfPacketInterface(afpacket *intf.Interfaces_Interface) (swIndex uint32, pending bool, err error)
- func (plugin *AFPacketConfigurator) DeleteAfPacketInterface(afpacket *intf.Interfaces_Interface) (err error)
- func (plugin *AFPacketConfigurator) Init(vppCh *govppapi.Channel) (err error)
- func (plugin *AFPacketConfigurator) IsPendingAfPacket(iface *intf.Interfaces_Interface) (pending bool)
- func (plugin *AFPacketConfigurator) ModifyAfPacketInterface(newConfig *intf.Interfaces_Interface, oldConfig *intf.Interfaces_Interface) (recreate bool, err error)
- func (plugin *AFPacketConfigurator) ResolveCreatedLinuxInterface(interfaceName string, interfaceIndex uint32) *intf.Interfaces_Interface
- func (plugin *AFPacketConfigurator) ResolveDeletedLinuxInterface(interfaceName string)
- type AfPacketConfig
- type BFDConfigurator
- func (plugin *BFDConfigurator) Close() error
- func (plugin *BFDConfigurator) ConfigureBfdAuthKey(bfdAuthKey *bfd.SingleHopBFD_Key) error
- func (plugin *BFDConfigurator) ConfigureBfdEchoFunction(bfdInput *bfd.SingleHopBFD_EchoFunction) error
- func (plugin *BFDConfigurator) ConfigureBfdSession(bfdInput *bfd.SingleHopBFD_Session) error
- func (plugin *BFDConfigurator) DeleteBfdAuthKey(bfdInput *bfd.SingleHopBFD_Key) error
- func (plugin *BFDConfigurator) DeleteBfdEchoFunction(bfdInput *bfd.SingleHopBFD_EchoFunction) error
- func (plugin *BFDConfigurator) DeleteBfdSession(bfdInput *bfd.SingleHopBFD_Session) error
- func (plugin *BFDConfigurator) Init(bfdSessionIndexes idxvpp.NameToIdxRW, bfdKeyIndexes idxvpp.NameToIdxRW, ...) (err error)
- func (plugin *BFDConfigurator) LookupBfdKeys() error
- func (plugin *BFDConfigurator) LookupBfdSessions() error
- func (plugin *BFDConfigurator) ModifyBfdAuthKey(oldInput *bfd.SingleHopBFD_Key, newInput *bfd.SingleHopBFD_Key) error
- func (plugin *BFDConfigurator) ModifyBfdEchoFunction(oldInput *bfd.SingleHopBFD_EchoFunction, ...) error
- func (plugin *BFDConfigurator) ModifyBfdSession(oldBfdSession *bfd.SingleHopBFD_Session, ...) error
- func (plugin *BFDConfigurator) ResyncAuthKey(bfds []*bfd.SingleHopBFD_Key) error
- func (plugin *BFDConfigurator) ResyncEchoFunction(bfds []*bfd.SingleHopBFD_EchoFunction) error
- func (plugin *BFDConfigurator) ResyncSession(bfds []*bfd.SingleHopBFD_Session) error
- type InterfaceConfigurator
- func (plugin *InterfaceConfigurator) Close() error
- func (plugin *InterfaceConfigurator) ConfigureVPPInterface(iface *intf.Interfaces_Interface) error
- func (plugin *InterfaceConfigurator) DeleteVPPInterface(iface *intf.Interfaces_Interface) (wasError error)
- func (plugin *InterfaceConfigurator) Init(swIfIndexes ifaceidx.SwIfIndexRW, mtu uint32, notifChan chan govppapi.Message) (err error)
- func (plugin *InterfaceConfigurator) LookupVPPInterfaces() error
- func (plugin *InterfaceConfigurator) ModifyVPPInterface(newConfig *intf.Interfaces_Interface, oldConfig *intf.Interfaces_Interface) error
- func (plugin *InterfaceConfigurator) ResolveCreatedLinuxInterface(interfaceName string, interfaceIndex uint32)
- func (plugin *InterfaceConfigurator) ResolveDeletedLinuxInterface(interfaceName string)
- func (plugin *InterfaceConfigurator) Resync(nbIfaces []*intf.Interfaces_Interface) error
- func (plugin *InterfaceConfigurator) VerifyVPPConfigPresence(nbIfaces []*intf.Interfaces_Interface) bool
- type InterfaceStateUpdater
- type StnConfigurator
- func (plugin *StnConfigurator) Add(rule *model_stn.StnRule) error
- func (plugin *StnConfigurator) Close() error
- func (plugin *StnConfigurator) Delete(rule *model_stn.StnRule) error
- func (plugin *StnConfigurator) Init() (err error)
- func (plugin *StnConfigurator) Modify(rule *model_stn.StnRule, rule2 *model_stn.StnRule) error
- func (plugin *StnConfigurator) Resync(stnRules []*stn.StnRule) error
Constants ¶
const ( Drop counterType = 0 Punt = 1 IPv4 = 2 IPv6 = 3 RxNoBuf = 4 RxMiss = 5 RxError = 6 TxError = 7 MPLS = 8 )
constants as defined in the vnet_interface_counter_type_t enum in 'vnet/interface.h'
const ( Rx combinedCounterType = 0 Tx = 1 )
constants as defined in the vnet_interface_counter_type_t enum in 'vnet/interface.h'
Variables ¶
This section is empty.
Functions ¶
Types ¶
type AFPacketConfigurator ¶
type AFPacketConfigurator struct { logging.Logger Linux interface{} //just flag if nil Stopwatch *measure.Stopwatch // from InterfaceConfigurator SwIfIndexes ifaceidx.SwIfIndexRW // contains filtered or unexported fields }
AFPacketConfigurator is used by InterfaceConfigurator to execute afpacket-specific management operations. Most importantly it needs to ensure that Afpacket interface is create AFTER the associated host interface.
func (*AFPacketConfigurator) ConfigureAfPacketInterface ¶
func (plugin *AFPacketConfigurator) ConfigureAfPacketInterface(afpacket *intf.Interfaces_Interface) (swIndex uint32, pending bool, err error)
ConfigureAfPacketInterface creates a new Afpacket interface or marks it as pending if the target host interface doesn't exist yet.
func (*AFPacketConfigurator) DeleteAfPacketInterface ¶
func (plugin *AFPacketConfigurator) DeleteAfPacketInterface(afpacket *intf.Interfaces_Interface) (err error)
DeleteAfPacketInterface removes Afpacket interface from VPP and from the cache.
func (*AFPacketConfigurator) Init ¶
func (plugin *AFPacketConfigurator) Init(vppCh *govppapi.Channel) (err error)
Init members of AFPacketConfigurator.
func (*AFPacketConfigurator) IsPendingAfPacket ¶
func (plugin *AFPacketConfigurator) IsPendingAfPacket(iface *intf.Interfaces_Interface) (pending bool)
IsPendingAfPacket returns true if the given config belongs to pending Afpacket interface.
func (*AFPacketConfigurator) ModifyAfPacketInterface ¶
func (plugin *AFPacketConfigurator) ModifyAfPacketInterface(newConfig *intf.Interfaces_Interface, oldConfig *intf.Interfaces_Interface) (recreate bool, err error)
ModifyAfPacketInterface updates the cache with afpacket configurations and tells InterfaceConfigurator if the interface nees to be recreated for the changes to be applied.
func (*AFPacketConfigurator) ResolveCreatedLinuxInterface ¶
func (plugin *AFPacketConfigurator) ResolveCreatedLinuxInterface(interfaceName string, interfaceIndex uint32) *intf.Interfaces_Interface
ResolveCreatedLinuxInterface reacts to a newly created Linux interface.
func (*AFPacketConfigurator) ResolveDeletedLinuxInterface ¶
func (plugin *AFPacketConfigurator) ResolveDeletedLinuxInterface(interfaceName string)
ResolveDeletedLinuxInterface reacts to a removed Linux interface.
type AfPacketConfig ¶
type AfPacketConfig struct {
// contains filtered or unexported fields
}
AfPacketConfig wraps the proto formatted configuration of an Afpacket interface together with a flag that tells if the interface is waiting for a host interface to get created.
type BFDConfigurator ¶
type BFDConfigurator struct { Log logging.Logger GoVppmux govppmux.API SwIfIndexes ifaceidx.SwIfIndex ServiceLabel servicelabel.ReaderAPI BfdIDSeq uint32 Stopwatch *measure.Stopwatch // timer used to measure and store time // contains filtered or unexported fields }
BFDConfigurator runs in the background in its own goroutine where it watches for any changes in the configuration of interfaces as modelled by the proto file "../model/bfd/bfd.proto" and stored in ETCD under the key "/vnf-agent/{agent-label}/vpp/config/v1/bfd/". Updates received from the northbound API are compared with the VPP run-time configuration and differences are applied through the VPP binary API.
func (*BFDConfigurator) ConfigureBfdAuthKey ¶
func (plugin *BFDConfigurator) ConfigureBfdAuthKey(bfdAuthKey *bfd.SingleHopBFD_Key) error
ConfigureBfdAuthKey crates new authentication key which can be used for BFD session
func (*BFDConfigurator) ConfigureBfdEchoFunction ¶
func (plugin *BFDConfigurator) ConfigureBfdEchoFunction(bfdInput *bfd.SingleHopBFD_EchoFunction) error
ConfigureBfdEchoFunction is used to setup BFD Echo function on existing interface
func (*BFDConfigurator) ConfigureBfdSession ¶
func (plugin *BFDConfigurator) ConfigureBfdSession(bfdInput *bfd.SingleHopBFD_Session) error
ConfigureBfdSession configures bfd session (including authentication if exists). Provided interface has to contain ip address defined in BFD as source
func (*BFDConfigurator) DeleteBfdAuthKey ¶
func (plugin *BFDConfigurator) DeleteBfdAuthKey(bfdInput *bfd.SingleHopBFD_Key) error
DeleteBfdAuthKey removes BFD authentication key but only if it is not used in any BFD session
func (*BFDConfigurator) DeleteBfdEchoFunction ¶
func (plugin *BFDConfigurator) DeleteBfdEchoFunction(bfdInput *bfd.SingleHopBFD_EchoFunction) error
DeleteBfdEchoFunction removes BFD echo function
func (*BFDConfigurator) DeleteBfdSession ¶
func (plugin *BFDConfigurator) DeleteBfdSession(bfdInput *bfd.SingleHopBFD_Session) error
DeleteBfdSession removes BFD session
func (*BFDConfigurator) Init ¶
func (plugin *BFDConfigurator) Init(bfdSessionIndexes idxvpp.NameToIdxRW, bfdKeyIndexes idxvpp.NameToIdxRW, bfdEchoFunctionIndex idxvpp.NameToIdxRW, bfdRemovedAuthIndex idxvpp.NameToIdxRW) (err error)
Init members and channels
func (*BFDConfigurator) LookupBfdKeys ¶
func (plugin *BFDConfigurator) LookupBfdKeys() error
LookupBfdKeys looks up all BFD auth keys and saves their name-to-index mapping
func (*BFDConfigurator) LookupBfdSessions ¶
func (plugin *BFDConfigurator) LookupBfdSessions() error
LookupBfdSessions looks up all BFD sessions and saves their name-to-index mapping
func (*BFDConfigurator) ModifyBfdAuthKey ¶
func (plugin *BFDConfigurator) ModifyBfdAuthKey(oldInput *bfd.SingleHopBFD_Key, newInput *bfd.SingleHopBFD_Key) error
ModifyBfdAuthKey modifies auth key fields. Key which is assigned to one or more BFD session cannot be modified
func (*BFDConfigurator) ModifyBfdEchoFunction ¶
func (plugin *BFDConfigurator) ModifyBfdEchoFunction(oldInput *bfd.SingleHopBFD_EchoFunction, newInput *bfd.SingleHopBFD_EchoFunction) error
ModifyBfdEchoFunction handles echo function changes
func (*BFDConfigurator) ModifyBfdSession ¶
func (plugin *BFDConfigurator) ModifyBfdSession(oldBfdSession *bfd.SingleHopBFD_Session, newBfdSession *bfd.SingleHopBFD_Session) error
ModifyBfdSession modifies BFD session fields. Source and destination IP address for old and new config has to be the same. Authentication is NOT changed here, BFD modify bin api call does not support that
func (*BFDConfigurator) ResyncAuthKey ¶
func (plugin *BFDConfigurator) ResyncAuthKey(bfds []*bfd.SingleHopBFD_Key) error
ResyncAuthKey writes BFD keys to the empty VPP
func (*BFDConfigurator) ResyncEchoFunction ¶
func (plugin *BFDConfigurator) ResyncEchoFunction(bfds []*bfd.SingleHopBFD_EchoFunction) error
ResyncEchoFunction writes BFD echo function to the empty VPP
func (*BFDConfigurator) ResyncSession ¶
func (plugin *BFDConfigurator) ResyncSession(bfds []*bfd.SingleHopBFD_Session) error
ResyncSession writes BFD sessions to the empty VPP
type InterfaceConfigurator ¶
type InterfaceConfigurator struct { Log logging.Logger GoVppmux govppmux.API ServiceLabel servicelabel.ReaderAPI Linux interface{} //just flag if nil Stopwatch *measure.Stopwatch // timer used to measure and store time // contains filtered or unexported fields }
InterfaceConfigurator runs in the background in its own goroutine where it watches for any changes in the configuration of interfaces as modelled by the proto file "../model/interfaces/interfaces.proto" and stored in ETCD under the key "/vnf-agent/{vnf-agent}/vpp/config/v1interface". Updates received from the northbound API are compared with the VPP run-time configuration and differences are applied through the VPP binary API.
func (*InterfaceConfigurator) Close ¶
func (plugin *InterfaceConfigurator) Close() error
Close GOVPP channel
func (*InterfaceConfigurator) ConfigureVPPInterface ¶
func (plugin *InterfaceConfigurator) ConfigureVPPInterface(iface *intf.Interfaces_Interface) error
ConfigureVPPInterface reacts to a new northbound VPP interface config by creating and configuring the interface in the VPP network stack through the VPP binary API.
func (*InterfaceConfigurator) DeleteVPPInterface ¶
func (plugin *InterfaceConfigurator) DeleteVPPInterface(iface *intf.Interfaces_Interface) (wasError error)
DeleteVPPInterface reacts to a removed NB configuration of a VPP interface. It results in the interface being removed from VPP.
func (*InterfaceConfigurator) Init ¶
func (plugin *InterfaceConfigurator) Init(swIfIndexes ifaceidx.SwIfIndexRW, mtu uint32, notifChan chan govppapi.Message) (err error)
Init members (channels...) and start go routines
func (*InterfaceConfigurator) LookupVPPInterfaces ¶
func (plugin *InterfaceConfigurator) LookupVPPInterfaces() error
LookupVPPInterfaces looks up all VPP interfaces and saves their name-to-index mapping and state information.
func (*InterfaceConfigurator) ModifyVPPInterface ¶
func (plugin *InterfaceConfigurator) ModifyVPPInterface(newConfig *intf.Interfaces_Interface, oldConfig *intf.Interfaces_Interface) error
ModifyVPPInterface applies changes in the NB configuration of a VPP interface into the running VPP through the VPP binary API.
func (*InterfaceConfigurator) ResolveCreatedLinuxInterface ¶
func (plugin *InterfaceConfigurator) ResolveCreatedLinuxInterface(interfaceName string, interfaceIndex uint32)
ResolveCreatedLinuxInterface reacts to a newly created Linux interface.
func (*InterfaceConfigurator) ResolveDeletedLinuxInterface ¶
func (plugin *InterfaceConfigurator) ResolveDeletedLinuxInterface(interfaceName string)
ResolveDeletedLinuxInterface reacts to a removed Linux interface.
func (*InterfaceConfigurator) Resync ¶
func (plugin *InterfaceConfigurator) Resync(nbIfaces []*intf.Interfaces_Interface) error
Resync writes interfaces to the empty VPP
- resyncs the VPP - temporary: (checks wether sw_if_indexes are not obsolate - this will be swapped with master ID) - deletes obsolate status data
func (*InterfaceConfigurator) VerifyVPPConfigPresence ¶ added in v1.0.7
func (plugin *InterfaceConfigurator) VerifyVPPConfigPresence(nbIfaces []*intf.Interfaces_Interface) bool
VerifyVPPConfigPresence dumps VPP interface configuration on the vpp. If there are any interfaces configured (except the local0), it returns false (do not interrupt the resto of the resync), otherwise returns true
type InterfaceStateUpdater ¶
type InterfaceStateUpdater struct { Log logging.Logger GoVppmux govppmux.API // contains filtered or unexported fields }
InterfaceStateUpdater holds state data of all VPP interfaces.
func (*InterfaceStateUpdater) AfterInit ¶
func (plugin *InterfaceStateUpdater) AfterInit() (err error)
AfterInit subscribes for watching VPP notifications on previously initialized channel
func (*InterfaceStateUpdater) Close ¶
func (plugin *InterfaceStateUpdater) Close() error
Close unsubscribes from interface state notifications from VPP & GOVPP channel
type StnConfigurator ¶ added in v1.0.8
type StnConfigurator struct { Log logging.Logger GoVppmux govppmux.API StnIndexes idxvpp.NameToIdxRW StnIndexSeq uint32 SwIfIndexes ifaceidx.SwIfIndex Stopwatch *measure.Stopwatch // contains filtered or unexported fields }
StnConfigurator runs in the background in its own goroutine where it watches for any changes in the configuration of interfaces as modelled by the proto file "../model/stn/stn.proto" and stored in ETCD under the key "vpp/config/v1/stn/rules/".
func (*StnConfigurator) Add ¶ added in v1.0.8
func (plugin *StnConfigurator) Add(rule *model_stn.StnRule) error
Add create a new STN rule
func (*StnConfigurator) Close ¶ added in v1.0.8
func (plugin *StnConfigurator) Close() error
Close GOVPP channel
func (*StnConfigurator) Delete ¶ added in v1.0.8
func (plugin *StnConfigurator) Delete(rule *model_stn.StnRule) error
Delete removes STN rule
func (*StnConfigurator) Init ¶ added in v1.0.8
func (plugin *StnConfigurator) Init() (err error)
Init initializes ARP configurator
Source Files ¶
Directories ¶
Path | Synopsis |
---|---|
Package binapi is the parent for packages that define various ifplugin southbound APIs.
|
Package binapi is the parent for packages that define various ifplugin southbound APIs. |
af_packet
Code generated by govpp binapi-generator DO NOT EDIT.
|
Code generated by govpp binapi-generator DO NOT EDIT. |
bfd
Package bfd represents the VPP binary API of the 'bfd' VPP module.
|
Package bfd represents the VPP binary API of the 'bfd' VPP module. |
interfaces
Code generated by govpp binapi-generator DO NOT EDIT.
|
Code generated by govpp binapi-generator DO NOT EDIT. |
ip
Code generated by govpp binapi-generator DO NOT EDIT.
|
Code generated by govpp binapi-generator DO NOT EDIT. |
memif
Code generated by govpp binapi-generator DO NOT EDIT.
|
Code generated by govpp binapi-generator DO NOT EDIT. |
stats
Code generated by govpp binapi-generator DO NOT EDIT.
|
Code generated by govpp binapi-generator DO NOT EDIT. |
stn
Code generated by govpp binapi-generator DO NOT EDIT.
|
Code generated by govpp binapi-generator DO NOT EDIT. |
tap
Code generated by govpp binapi-generator DO NOT EDIT.
|
Code generated by govpp binapi-generator DO NOT EDIT. |
vpe
Code generated by govpp binapi-generator DO NOT EDIT.
|
Code generated by govpp binapi-generator DO NOT EDIT. |
vxlan
Code generated by govpp binapi-generator DO NOT EDIT.
|
Code generated by govpp binapi-generator DO NOT EDIT. |
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. |
Package model is the parent for packages that define various if plugin northbound APIs generated from protobuf data models.
|
Package model is the parent for packages that define various if plugin northbound APIs generated from protobuf data models. |
bfd
Package bfd is a generated protocol buffer package.
|
Package bfd is a generated protocol buffer package. |
interfaces
Package interfaces is a generated protocol buffer package.
|
Package interfaces is a generated protocol buffer package. |
stn
Package stn is a generated protocol buffer package.
|
Package stn is a generated protocol buffer package. |
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. |
Package vppdump provides helpers for dumping all interfaces configured in VPP.
|
Package vppdump provides helpers for dumping all interfaces configured in VPP. |