Documentation ¶
Overview ¶
Package ifplugin implements the Interface plugin that handles management of VPP interfaces.
Index ¶
- Constants
- 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
- type InterfaceStateUpdater
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 ¶
This section is empty.
Types ¶
type AFPacketConfigurator ¶
type AFPacketConfigurator struct { Linux interface{} //just flag if nil // 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 { GoVppmux govppmux.API SwIfIndexes ifaceidx.SwIfIndex ServiceLabel servicelabel.ReaderAPI BfdIDSeq uint32 // 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 { GoVppmux govppmux.API ServiceLabel servicelabel.ReaderAPI Linux interface{} //just flag if nil // 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
type InterfaceStateUpdater ¶
type InterfaceStateUpdater struct { 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
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. |
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. |
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 to dump all interfaces configured in VPP.
|
Package vppdump provides helpers to dump all interfaces configured in VPP. |