Documentation ¶
Overview ¶
Package ifplugin implements the Interface plugin that handles management of VPP interfaces.
Index ¶
- Constants
- func AuthKeyIdentifier(id uint32) string
- func GetIdMappingIdentifier(mapping *nat.Nat44DNat_DNatConfig_IdentityMapping) string
- func GetStMappingIdentifier(mapping *nat.Nat44DNat_DNatConfig_StaticMapping) string
- func StnIdentifier(iface string) string
- type AFPacketConfigurator
- func (plugin *AFPacketConfigurator) ConfigureAfPacketInterface(afpacket *intf.Interfaces_Interface) (swIndex uint32, pending bool, err error)
- func (plugin *AFPacketConfigurator) DeleteAfPacketInterface(afpacket *intf.Interfaces_Interface, ifIdx uint32) (err error)
- func (plugin *AFPacketConfigurator) GetAfPacketStatusByHost(hostIf string) (exists, pending bool, ifData *intf.Interfaces_Interface)
- func (plugin *AFPacketConfigurator) GetAfPacketStatusByName(name string) (exists, pending bool, ifData *intf.Interfaces_Interface)
- func (plugin *AFPacketConfigurator) GetHostInterfacesEntry(hostIf string) bool
- func (plugin *AFPacketConfigurator) Init(logger logging.Logger, vppCh govppapi.Channel, linux interface{}, ...) (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, hostIfName string, interfaceIndex uint32) *intf.Interfaces_Interface
- func (plugin *AFPacketConfigurator) ResolveDeletedLinuxInterface(interfaceName, hostIfName string, ifIdx uint32)
- 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) DumpBFDAuthKeys() ([]*bfd.SingleHopBFD_Key, error)
- func (plugin *BFDConfigurator) DumpBfdSessions() ([]*bfd.SingleHopBFD_Session, error)
- func (plugin *BFDConfigurator) GetBfdEchoFunctionIndexes() idxvpp.NameToIdxRW
- func (plugin *BFDConfigurator) GetBfdKeyIndexes() idxvpp.NameToIdxRW
- func (plugin *BFDConfigurator) GetBfdSessionIndexes() idxvpp.NameToIdxRW
- func (plugin *BFDConfigurator) Init(logger logging.PluginLogger, goVppMux govppmux.API, ...) (err 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(oldBfdInput *bfd.SingleHopBFD_Session, newBfdInput *bfd.SingleHopBFD_Session) error
- func (plugin *BFDConfigurator) ResyncAuthKey(nbKeys []*bfd.SingleHopBFD_Key) error
- func (plugin *BFDConfigurator) ResyncEchoFunction(echoFunctions []*bfd.SingleHopBFD_EchoFunction) error
- func (plugin *BFDConfigurator) ResyncSession(nbSessions []*bfd.SingleHopBFD_Session) error
- type InterfaceConfigurator
- func (plugin *InterfaceConfigurator) Close() error
- func (plugin *InterfaceConfigurator) ConfigureVPPInterface(iface *intf.Interfaces_Interface) (err error)
- func (plugin *InterfaceConfigurator) DeleteVPPInterface(iface *intf.Interfaces_Interface) (wasError error)
- func (plugin *InterfaceConfigurator) GetDHCPIndexes() ifaceidx.DhcpIndexRW
- func (plugin *InterfaceConfigurator) GetSwIfIndexes() ifaceidx.SwIfIndexRW
- func (plugin *InterfaceConfigurator) Init(logger logging.PluginLogger, goVppMux govppmux.API, linux interface{}, ...) (err error)
- func (plugin *InterfaceConfigurator) IsMulticastVxLanIfCached(ifName string) bool
- func (plugin *InterfaceConfigurator) IsSocketFilenameCached(filename string) bool
- func (plugin *InterfaceConfigurator) IsUnnumberedIfCached(ifName string) bool
- func (plugin *InterfaceConfigurator) ModifyVPPInterface(newConfig *intf.Interfaces_Interface, oldConfig *intf.Interfaces_Interface) error
- func (plugin *InterfaceConfigurator) PropagateIfDetailsToStatus() error
- func (plugin *InterfaceConfigurator) ResolveCreatedLinuxInterface(interfaceName, hostIfName string, interfaceIndex uint32)
- func (plugin *InterfaceConfigurator) ResolveDeletedLinuxInterface(interfaceName, hostIfName string, ifIdx uint32)
- func (plugin *InterfaceConfigurator) Resync(nbIfs []*intf.Interfaces_Interface) (errs []error)
- func (plugin *InterfaceConfigurator) VerifyVPPConfigPresence(nbIfaces []*intf.Interfaces_Interface) bool
- type InterfaceStateUpdater
- type NatConfigurator
- func (plugin *NatConfigurator) Close() error
- func (plugin *NatConfigurator) ConfigureDNat(dNat *nat.Nat44DNat_DNatConfig) error
- func (plugin *NatConfigurator) ConfigureSNat(sNat *nat.Nat44SNat_SNatConfig) error
- func (plugin *NatConfigurator) DeleteDNat(dNat *nat.Nat44DNat_DNatConfig) error
- func (plugin *NatConfigurator) DeleteNatGlobalConfig(config *nat.Nat44Global) (err error)
- func (plugin *NatConfigurator) DeleteSNat(sNat *nat.Nat44SNat_SNatConfig) error
- func (plugin *NatConfigurator) DumpNatDNat() (*nat.Nat44DNat, error)
- func (plugin *NatConfigurator) DumpNatGlobal() (*nat.Nat44Global, error)
- func (plugin *NatConfigurator) GetGlobalNat() *nat.Nat44Global
- func (plugin *NatConfigurator) Init(logger logging.PluginLogger, goVppMux govppmux.API, ...) (err error)
- func (plugin *NatConfigurator) IsDNatLabelIdMappingRegistered(id string) bool
- func (plugin *NatConfigurator) IsDNatLabelRegistered(label string) bool
- func (plugin *NatConfigurator) IsDNatLabelStMappingRegistered(id string) bool
- func (plugin *NatConfigurator) IsInNotDisabledIfCache(ifName string) bool
- func (plugin *NatConfigurator) IsInNotEnabledIfCache(ifName string) bool
- func (plugin *NatConfigurator) ModifyDNat(oldDNat, newDNat *nat.Nat44DNat_DNatConfig) error
- func (plugin *NatConfigurator) ModifyNatGlobalConfig(oldConfig, newConfig *nat.Nat44Global) (err error)
- func (plugin *NatConfigurator) ModifySNat(oldSNat, newSNat *nat.Nat44SNat_SNatConfig) error
- func (plugin *NatConfigurator) ResolveCreatedInterface(ifName string, ifIdx uint32) error
- func (plugin *NatConfigurator) ResolveDeletedInterface(ifName string, ifIdx uint32) error
- func (plugin *NatConfigurator) ResyncDNat(nbDNatConfig []*nat.Nat44DNat_DNatConfig) error
- func (plugin *NatConfigurator) ResyncNatGlobal(nbGlobal *nat.Nat44Global) error
- func (plugin *NatConfigurator) ResyncSNat(sNatConf []*nat.Nat44SNat_SNatConfig) error
- func (plugin *NatConfigurator) SetNatGlobalConfig(config *nat.Nat44Global) error
- type StnConfigurator
- func (plugin *StnConfigurator) Add(rule *modelStn.STN_Rule) error
- func (plugin *StnConfigurator) Close() error
- func (plugin *StnConfigurator) Delete(rule *modelStn.STN_Rule) error
- func (plugin *StnConfigurator) Dump() ([]*stn.StnRulesDetails, error)
- func (plugin *StnConfigurator) IndexExistsFor(name string) bool
- func (plugin *StnConfigurator) Init(logger logging.PluginLogger, goVppMux govppmux.API, ...) (err error)
- func (plugin *StnConfigurator) Modify(ruleOld *modelStn.STN_Rule, ruleNew *modelStn.STN_Rule) error
- func (plugin *StnConfigurator) ResolveCreatedInterface(interfaceName string)
- func (plugin *StnConfigurator) ResolveDeletedInterface(interfaceName string)
- func (plugin *StnConfigurator) Resync(nbStnRules []*stn.STN_Rule) error
- func (plugin *StnConfigurator) UnstoredIndexExistsFor(name string) bool
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 ¶
func AuthKeyIdentifier ¶
Generates common identifier for authentication key
func GetIdMappingIdentifier ¶
func GetIdMappingIdentifier(mapping *nat.Nat44DNat_DNatConfig_IdentityMapping) string
GetIdMappingIdentifier returns unique ID of the mapping
func GetStMappingIdentifier ¶
func GetStMappingIdentifier(mapping *nat.Nat44DNat_DNatConfig_StaticMapping) string
GetStMappingIdentifier returns unique ID of the mapping
func StnIdentifier ¶
StnIdentifier creates unique identifier which serves as a name in name to index mapping
Types ¶
type AFPacketConfigurator ¶
type AFPacketConfigurator struct {
// 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, ifIdx uint32) (err error)
DeleteAfPacketInterface removes Afpacket interface from VPP and from the cache.
func (*AFPacketConfigurator) GetAfPacketStatusByHost ¶
func (plugin *AFPacketConfigurator) GetAfPacketStatusByHost(hostIf string) (exists, pending bool, ifData *intf.Interfaces_Interface)
GetAfPacketStatusByHost looks for cached interface by host interface and returns its state and data
func (*AFPacketConfigurator) GetAfPacketStatusByName ¶
func (plugin *AFPacketConfigurator) GetAfPacketStatusByName(name string) (exists, pending bool, ifData *intf.Interfaces_Interface)
GetAfPacketStatusByName looks for cached interface by its name and returns its state and data
func (*AFPacketConfigurator) GetHostInterfacesEntry ¶
func (plugin *AFPacketConfigurator) GetHostInterfacesEntry(hostIf string) bool
GetHostInterfacesEntry looks for cached host interface and returns true if exists
func (*AFPacketConfigurator) Init ¶
func (plugin *AFPacketConfigurator) Init(logger logging.Logger, vppCh govppapi.Channel, linux interface{}, indexes ifaceidx.SwIfIndexRW, stopwatch *measure.Stopwatch) (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 needs to be recreated for the changes to be applied.
func (*AFPacketConfigurator) ResolveCreatedLinuxInterface ¶
func (plugin *AFPacketConfigurator) ResolveCreatedLinuxInterface(interfaceName, hostIfName string, interfaceIndex uint32) *intf.Interfaces_Interface
ResolveCreatedLinuxInterface reacts to a newly created Linux interface.
func (*AFPacketConfigurator) ResolveDeletedLinuxInterface ¶
func (plugin *AFPacketConfigurator) ResolveDeletedLinuxInterface(interfaceName, hostIfName string, ifIdx uint32)
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 {
// contains filtered or unexported fields
}
BFDConfigurator runs in the background in its own goroutine where it watches for any changes in the configuration of BFDs 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) DumpBFDAuthKeys ¶
func (plugin *BFDConfigurator) DumpBFDAuthKeys() ([]*bfd.SingleHopBFD_Key, error)
DumpBFDAuthKeys returns a list of all configured authentication keys
func (*BFDConfigurator) DumpBfdSessions ¶
func (plugin *BFDConfigurator) DumpBfdSessions() ([]*bfd.SingleHopBFD_Session, error)
DumpBfdSessions returns a list of all configured BFD sessions
func (*BFDConfigurator) GetBfdEchoFunctionIndexes ¶
func (plugin *BFDConfigurator) GetBfdEchoFunctionIndexes() idxvpp.NameToIdxRW
GetBfdEchoFunctionIndexes gives access to BFD echo function indexes
func (*BFDConfigurator) GetBfdKeyIndexes ¶
func (plugin *BFDConfigurator) GetBfdKeyIndexes() idxvpp.NameToIdxRW
GetBfdKeyIndexes gives access to BFD key indexes
func (*BFDConfigurator) GetBfdSessionIndexes ¶
func (plugin *BFDConfigurator) GetBfdSessionIndexes() idxvpp.NameToIdxRW
GetBfdSessionIndexes gives access to BFD session indexes
func (*BFDConfigurator) Init ¶
func (plugin *BFDConfigurator) Init(logger logging.PluginLogger, goVppMux govppmux.API, swIfIndexes ifaceidx.SwIfIndex, enableStopwatch bool) (err error)
Init members and channels
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(oldBfdInput *bfd.SingleHopBFD_Session, newBfdInput *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(nbKeys []*bfd.SingleHopBFD_Key) error
ResyncAuthKey writes BFD keys to the empty VPP
func (*BFDConfigurator) ResyncEchoFunction ¶
func (plugin *BFDConfigurator) ResyncEchoFunction(echoFunctions []*bfd.SingleHopBFD_EchoFunction) error
ResyncEchoFunction writes BFD echo function to the empty VPP
func (*BFDConfigurator) ResyncSession ¶
func (plugin *BFDConfigurator) ResyncSession(nbSessions []*bfd.SingleHopBFD_Session) error
ResyncSession writes BFD sessions to the empty VPP
type InterfaceConfigurator ¶
type InterfaceConfigurator struct { // Notification channels NotifChan chan govppapi.Message // to publish SwInterfaceDetails to interface_state.go DhcpChan chan govppapi.Message // channel to receive DHCP notifications // 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) (err 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) GetDHCPIndexes ¶
func (plugin *InterfaceConfigurator) GetDHCPIndexes() ifaceidx.DhcpIndexRW
GetDHCPIndexes exposes DHCP name-to-index mapping
func (*InterfaceConfigurator) GetSwIfIndexes ¶
func (plugin *InterfaceConfigurator) GetSwIfIndexes() ifaceidx.SwIfIndexRW
GetSwIfIndexes exposes interface name-to-index mapping
func (*InterfaceConfigurator) Init ¶
func (plugin *InterfaceConfigurator) Init(logger logging.PluginLogger, goVppMux govppmux.API, linux interface{}, notifChan chan govppapi.Message, defaultMtu uint32, enableStopwatch bool) (err error)
Init members (channels...) and start go routines
func (*InterfaceConfigurator) IsMulticastVxLanIfCached ¶
func (plugin *InterfaceConfigurator) IsMulticastVxLanIfCached(ifName string) bool
IsMulticastVxLanIfCached returns true if provided interface is cached as VxLAN with missing multicast interface
func (*InterfaceConfigurator) IsSocketFilenameCached ¶
func (plugin *InterfaceConfigurator) IsSocketFilenameCached(filename string) bool
IsSocketFilenameCached returns true if provided filename is presented in the cache
func (*InterfaceConfigurator) IsUnnumberedIfCached ¶
func (plugin *InterfaceConfigurator) IsUnnumberedIfCached(ifName string) bool
IsUnnumberedIfCached returns true if provided interface is cached as unconfigurabel unnubered interface
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) PropagateIfDetailsToStatus ¶
func (plugin *InterfaceConfigurator) PropagateIfDetailsToStatus() error
PropagateIfDetailsToStatus looks up all VPP interfaces
func (*InterfaceConfigurator) ResolveCreatedLinuxInterface ¶
func (plugin *InterfaceConfigurator) ResolveCreatedLinuxInterface(interfaceName, hostIfName string, interfaceIndex uint32)
ResolveCreatedLinuxInterface reacts to a newly created Linux interface.
func (*InterfaceConfigurator) ResolveDeletedLinuxInterface ¶
func (plugin *InterfaceConfigurator) ResolveDeletedLinuxInterface(interfaceName, hostIfName string, ifIdx uint32)
ResolveDeletedLinuxInterface reacts to a removed Linux interface.
func (*InterfaceConfigurator) Resync ¶
func (plugin *InterfaceConfigurator) Resync(nbIfs []*intf.Interfaces_Interface) (errs []error)
Resync writes interfaces to the VPP. VPP interfaces are usually configured with tag, which corresponds with interface name (exceptions are physical devices, but their name is always equal to vpp internal name). Resync consists of following steps:
- Dump all VPP interfaces
- Every VPP interface looks for NB counterpart using tag (name). If found, it is calculated whether modification is needed. Otherwise, the interface is only registered. If interface does not contain tag, it is stored for now and resolved later. Tagged interfaces without NB config are removed.
- Untagged interfaces are correlated heuristically (mac address, ip addresses). If correlation is found, interface is modified if needed and registered.
- All remaining NB interfaces are configured
func (*InterfaceConfigurator) VerifyVPPConfigPresence ¶
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 {
// 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
func (*InterfaceStateUpdater) Init ¶
func (plugin *InterfaceStateUpdater) Init(logger logging.PluginLogger, goVppMux govppmux.API, ctx context.Context, swIfIndexes ifaceidx.SwIfIndex, notifChan chan govppapi.Message, publishIfState func(notification *intf.InterfaceNotification)) (err error)
Init members (channels, maps...) and start go routines
type NatConfigurator ¶
type NatConfigurator struct {
// contains filtered or unexported fields
}
NatConfigurator runs in the background in its own goroutine where it watches for any changes in the configuration of NAT address pools and static entries with or without a load ballance, as modelled by the proto file "../common/model/nat/nat.proto" and stored in ETCD under the keys:
- "/vnf-agent/{agent-label}/vpp/config/v1/nat/{vrf}/addrpool/" for NAT address pool
- "/vnf-agent/{agent-label}/vpp/config/v1/nat/{vrf}/static/" for NAT static mapping
- "/vnf-agent/{agent-label}/vpp/config/v1/nat/{vrf}/staticlb/" for NAT static mapping with load balancer
Updates received from the northbound API are compared with the VPP run-time configuration and differences are applied through the VPP binary API.
func (*NatConfigurator) ConfigureDNat ¶
func (plugin *NatConfigurator) ConfigureDNat(dNat *nat.Nat44DNat_DNatConfig) error
ConfigureDNat configures new DNAT setup
func (*NatConfigurator) ConfigureSNat ¶
func (plugin *NatConfigurator) ConfigureSNat(sNat *nat.Nat44SNat_SNatConfig) error
ConfigureSNat configures new SNAT setup
func (*NatConfigurator) DeleteDNat ¶
func (plugin *NatConfigurator) DeleteDNat(dNat *nat.Nat44DNat_DNatConfig) error
DeleteDNat removes existing DNAT setup
func (*NatConfigurator) DeleteNatGlobalConfig ¶
func (plugin *NatConfigurator) DeleteNatGlobalConfig(config *nat.Nat44Global) (err error)
DeleteNatGlobalConfig removes common setup for all NAT use cases
func (*NatConfigurator) DeleteSNat ¶
func (plugin *NatConfigurator) DeleteSNat(sNat *nat.Nat44SNat_SNatConfig) error
DeleteSNat removes existing SNAT setup
func (*NatConfigurator) DumpNatDNat ¶
func (plugin *NatConfigurator) DumpNatDNat() (*nat.Nat44DNat, error)
DumpNatDNat returns the current NAT44 DNAT config
func (*NatConfigurator) DumpNatGlobal ¶
func (plugin *NatConfigurator) DumpNatGlobal() (*nat.Nat44Global, error)
DumpNatGlobal returns the current NAT44 global config
func (*NatConfigurator) GetGlobalNat ¶
func (plugin *NatConfigurator) GetGlobalNat() *nat.Nat44Global
GetGlobalNat makes current global nat accessible
func (*NatConfigurator) Init ¶
func (plugin *NatConfigurator) Init(logger logging.PluginLogger, goVppMux govppmux.API, ifIndexes ifaceidx.SwIfIndex, enableStopwatch bool) (err error)
Init NAT configurator
func (*NatConfigurator) IsDNatLabelIdMappingRegistered ¶
func (plugin *NatConfigurator) IsDNatLabelIdMappingRegistered(id string) bool
IsDNatLabelIdMappingRegistered checks if DNAT identity mapping with provided id is registered
func (*NatConfigurator) IsDNatLabelRegistered ¶
func (plugin *NatConfigurator) IsDNatLabelRegistered(label string) bool
IsInNotDisabledIfCache checks if interface is present in 'notDisabledIfs' cache
func (*NatConfigurator) IsDNatLabelStMappingRegistered ¶
func (plugin *NatConfigurator) IsDNatLabelStMappingRegistered(id string) bool
IsInNotDisabledIfCache checks if DNAT static mapping with provided id is registered
func (*NatConfigurator) IsInNotDisabledIfCache ¶
func (plugin *NatConfigurator) IsInNotDisabledIfCache(ifName string) bool
IsInNotDisabledIfCache checks if interface is present in 'notDisabledIfs' cache
func (*NatConfigurator) IsInNotEnabledIfCache ¶
func (plugin *NatConfigurator) IsInNotEnabledIfCache(ifName string) bool
IsInNotEnabledIfCache checks if interface is present in 'notEnabledIfs' cache
func (*NatConfigurator) ModifyDNat ¶
func (plugin *NatConfigurator) ModifyDNat(oldDNat, newDNat *nat.Nat44DNat_DNatConfig) error
ModifyDNat modifies existing DNAT setup
func (*NatConfigurator) ModifyNatGlobalConfig ¶
func (plugin *NatConfigurator) ModifyNatGlobalConfig(oldConfig, newConfig *nat.Nat44Global) (err error)
ModifyNatGlobalConfig modifies common setup for all NAT use cases
func (*NatConfigurator) ModifySNat ¶
func (plugin *NatConfigurator) ModifySNat(oldSNat, newSNat *nat.Nat44SNat_SNatConfig) error
ModifySNat modifies existing SNAT setup
func (*NatConfigurator) ResolveCreatedInterface ¶
func (plugin *NatConfigurator) ResolveCreatedInterface(ifName string, ifIdx uint32) error
ResolveCreatedInterface looks for cache of interfaces which should be enabled or disabled for NAT
func (*NatConfigurator) ResolveDeletedInterface ¶
func (plugin *NatConfigurator) ResolveDeletedInterface(ifName string, ifIdx uint32) error
ResolveDeletedInterface handles removed interface from NAT perspective
func (*NatConfigurator) ResyncDNat ¶
func (plugin *NatConfigurator) ResyncDNat(nbDNatConfig []*nat.Nat44DNat_DNatConfig) error
ResyncDNat writes NAT static mapping config to the the empty VPP
func (*NatConfigurator) ResyncNatGlobal ¶
func (plugin *NatConfigurator) ResyncNatGlobal(nbGlobal *nat.Nat44Global) error
ResyncNatGlobal writes NAT address pool config to the the empty VPP
func (*NatConfigurator) ResyncSNat ¶
func (plugin *NatConfigurator) ResyncSNat(sNatConf []*nat.Nat44SNat_SNatConfig) error
ResyncSNat writes NAT static mapping config to the the empty VPP
func (*NatConfigurator) SetNatGlobalConfig ¶
func (plugin *NatConfigurator) SetNatGlobalConfig(config *nat.Nat44Global) error
SetNatGlobalConfig configures common setup for all NAT use cases
type StnConfigurator ¶
type StnConfigurator struct {
// 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 ¶
func (plugin *StnConfigurator) Add(rule *modelStn.STN_Rule) error
Add create a new STN rule.
func (*StnConfigurator) Delete ¶
func (plugin *StnConfigurator) Delete(rule *modelStn.STN_Rule) error
Delete removes STN rule.
func (*StnConfigurator) Dump ¶
func (plugin *StnConfigurator) Dump() ([]*stn.StnRulesDetails, error)
Dump STN rules configured on the VPP
func (*StnConfigurator) IndexExistsFor ¶
func (plugin *StnConfigurator) IndexExistsFor(name string) bool
IndexExistsFor returns true if there is and mapping entry for provided name
func (*StnConfigurator) Init ¶
func (plugin *StnConfigurator) Init(logger logging.PluginLogger, goVppMux govppmux.API, ifIndexes ifaceidx.SwIfIndex, enableStopwatch bool) (err error)
Init initializes STN configurator
func (*StnConfigurator) ResolveCreatedInterface ¶
func (plugin *StnConfigurator) ResolveCreatedInterface(interfaceName string)
ResolveCreatedInterface will check rules and if there is one waiting for interfaces it will be written into VPP.
func (*StnConfigurator) ResolveDeletedInterface ¶
func (plugin *StnConfigurator) ResolveDeletedInterface(interfaceName string)
ResolveDeletedInterface resolves when interface is deleted. If there exist a rule for this interface the rule will be deleted also.
func (*StnConfigurator) Resync ¶
func (plugin *StnConfigurator) Resync(nbStnRules []*stn.STN_Rule) error
Resync writes stn rule to the the empty VPP
func (*StnConfigurator) UnstoredIndexExistsFor ¶
func (plugin *StnConfigurator) UnstoredIndexExistsFor(name string) bool
UnstoredIndexExistsFor returns true if there is and mapping entry for provided name
Source Files ¶
Directories ¶
Path | Synopsis |
---|---|
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 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. |