Documentation ¶
Overview ¶
Package l2plugin implements the L2 plugin that handles Bridge Domains and L2 FIBs.
Index ¶
- type BDConfigurator
- func (plugin *BDConfigurator) Close() error
- func (plugin *BDConfigurator) ConfigureBridgeDomain(bdConfig *l2.BridgeDomains_BridgeDomain) error
- func (plugin *BDConfigurator) DeleteBridgeDomain(bdConfig *l2.BridgeDomains_BridgeDomain) error
- func (plugin *BDConfigurator) Init(notificationChannel chan BridgeDomainStateMessage) (err error)
- func (plugin *BDConfigurator) ModifyBridgeDomain(newBdConfig *l2.BridgeDomains_BridgeDomain, ...) error
- func (plugin *BDConfigurator) PropagateBdDetailsToStatus(bdID uint32, bdName string) error
- func (plugin *BDConfigurator) ResolveCreatedInterface(ifName string, ifIdx uint32) error
- func (plugin *BDConfigurator) ResolveDeletedInterface(ifName string) error
- func (plugin *BDConfigurator) Resync(nbBDs []*l2.BridgeDomains_BridgeDomain) error
- type BridgeDomainMeta
- type BridgeDomainStateMessage
- type BridgeDomainStateNotification
- type BridgeDomainStateUpdater
- type FIBConfigurator
- func (plugin *FIBConfigurator) Add(fib *l2.FibTable_FibEntry, callback func(error)) error
- func (plugin *FIBConfigurator) Close() error
- func (plugin *FIBConfigurator) Delete(fib *l2.FibTable_FibEntry, callback func(error)) error
- func (plugin *FIBConfigurator) GetFibAddCacheIndexes() l2idx.FIBIndexRW
- func (plugin *FIBConfigurator) GetFibDelCacheIndexes() l2idx.FIBIndexRW
- func (plugin *FIBConfigurator) Init() (err error)
- func (plugin *FIBConfigurator) Modify(oldFib *l2.FibTable_FibEntry, newFib *l2.FibTable_FibEntry, ...) error
- func (plugin *FIBConfigurator) ResolveCreatedBridgeDomain(bdName string, bdID uint32, callback func(error)) error
- func (plugin *FIBConfigurator) ResolveCreatedInterface(ifName string, ifIdx uint32, callback func(error)) error
- func (plugin *FIBConfigurator) ResolveDeletedBridgeDomain(bdName string, bdID uint32, callback func(error)) error
- func (plugin *FIBConfigurator) ResolveDeletedInterface(ifName string, ifIdx uint32, callback func(error)) error
- func (plugin *FIBConfigurator) ResolveUpdatedBridgeDomain(bdName string, bdID uint32, callback func(error)) error
- func (plugin *FIBConfigurator) Resync(nbFIBs []*l2.FibTable_FibEntry) error
- type XConnectConfigurator
- func (plugin *XConnectConfigurator) Close() error
- func (plugin *XConnectConfigurator) ConfigureXConnectPair(xc *l2.XConnectPairs_XConnectPair) error
- func (plugin *XConnectConfigurator) DeleteXConnectPair(xc *l2.XConnectPairs_XConnectPair) error
- func (plugin *XConnectConfigurator) GetXcAddCache() l2idx.XcIndexRW
- func (plugin *XConnectConfigurator) GetXcDelCache() l2idx.XcIndexRW
- func (plugin *XConnectConfigurator) GetXcIndexes() l2idx.XcIndexRW
- func (plugin *XConnectConfigurator) Init(logger logging.PluginLogger, goVppMux govppmux.API, ...) (err error)
- func (plugin *XConnectConfigurator) ModifyXConnectPair(newXc, oldXc *l2.XConnectPairs_XConnectPair) error
- func (plugin *XConnectConfigurator) ResolveCreatedInterface(ifName string) error
- func (plugin *XConnectConfigurator) ResolveDeletedInterface(ifName string) error
- func (plugin *XConnectConfigurator) Resync(nbXConns []*l2.XConnectPairs_XConnectPair) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BDConfigurator ¶
type BDConfigurator struct { Log logging.Logger GoVppmux govppmux.API ServiceLabel servicelabel.ReaderAPI // bridge domains BdIndices l2idx.BDIndexRW // interface indices SwIfIndices ifaceidx.SwIfIndex BridgeDomainIDSeq uint32 RegisteredIfaceCounter uint32 Stopwatch *measure.Stopwatch // timer used to measure and store time // contains filtered or unexported fields }
BDConfigurator runs in the background in its own goroutine where it watches for any changes in the configuration of bridge domains as modelled by the proto file "../model/l2/l2.proto" and stored in ETCD under the key "/vnf-agent/{vnf-agent}/vpp/config/v1bd". Updates received from the northbound API are compared with the VPP run-time configuration and differences are applied through the VPP binary API.
func (*BDConfigurator) ConfigureBridgeDomain ¶
func (plugin *BDConfigurator) ConfigureBridgeDomain(bdConfig *l2.BridgeDomains_BridgeDomain) error
ConfigureBridgeDomain handles the creation of new bridge domain including interfaces, ARP termination entries and pushes status update notification.
func (*BDConfigurator) DeleteBridgeDomain ¶
func (plugin *BDConfigurator) DeleteBridgeDomain(bdConfig *l2.BridgeDomains_BridgeDomain) error
DeleteBridgeDomain processes the NB config and propagates it to bin api calls.
func (*BDConfigurator) Init ¶
func (plugin *BDConfigurator) Init(notificationChannel chan BridgeDomainStateMessage) (err error)
Init members (channels...) and start go routines.
func (*BDConfigurator) ModifyBridgeDomain ¶
func (plugin *BDConfigurator) ModifyBridgeDomain(newBdConfig *l2.BridgeDomains_BridgeDomain, oldBdConfig *l2.BridgeDomains_BridgeDomain) error
ModifyBridgeDomain processes the NB config and propagates it to bin api calls.
func (*BDConfigurator) PropagateBdDetailsToStatus ¶ added in v1.4.0
func (plugin *BDConfigurator) PropagateBdDetailsToStatus(bdID uint32, bdName string) error
PropagateBdDetailsToStatus looks for existing VPP bridge domain state and propagates it to the etcd bd state.
func (*BDConfigurator) ResolveCreatedInterface ¶
func (plugin *BDConfigurator) ResolveCreatedInterface(ifName string, ifIdx uint32) error
ResolveCreatedInterface looks for bridge domain this interface is assigned to and sets it up.
func (*BDConfigurator) ResolveDeletedInterface ¶
func (plugin *BDConfigurator) ResolveDeletedInterface(ifName string) error
ResolveDeletedInterface is called by VPP if an interface is removed.
func (*BDConfigurator) Resync ¶
func (plugin *BDConfigurator) Resync(nbBDs []*l2.BridgeDomains_BridgeDomain) error
Resync writes missing BDs to the VPP and removes obsolete ones.
type BridgeDomainMeta ¶
type BridgeDomainMeta struct { IsInterfaceBvi bool // contains filtered or unexported fields }
BridgeDomainMeta holds info about interfaces's bridge domain index and BVI.
type BridgeDomainStateMessage ¶
BridgeDomainStateMessage is message with bridge domain state + bridge domain name (since a state message does not contain it). This state is sent to the bd_state.go to further processing after every change.
type BridgeDomainStateNotification ¶
type BridgeDomainStateNotification struct {
State *l2.BridgeDomainState_BridgeDomain
}
BridgeDomainStateNotification contains bridge domain state object with all data published to ETCD.
type BridgeDomainStateUpdater ¶
type BridgeDomainStateUpdater struct { Log logging.Logger GoVppmux govppmux.API // contains filtered or unexported fields }
BridgeDomainStateUpdater holds all data required to handle bridge domain state.
func (*BridgeDomainStateUpdater) Init ¶
func (plugin *BridgeDomainStateUpdater) Init(ctx context.Context, bdIndexes l2idx.BDIndex, swIfIndexes ifaceidx.SwIfIndex, notificationChan chan BridgeDomainStateMessage, publishBdState func(notification *BridgeDomainStateNotification)) (err error)
Init bridge domain state updater.
type FIBConfigurator ¶
type FIBConfigurator struct { Log logging.Logger GoVppmux govppmux.API // Injected mappings SwIfIndexes ifaceidx.SwIfIndex BdIndexes l2idx.BDIndex // FIB-related mappings IfToBdIndexes idxvpp.NameToIdxRW // TODO: use rather BdIndexes.LookupNameByIfaceName FibIndexes l2idx.FIBIndexRW Stopwatch *measure.Stopwatch // timer used to measure and store time // contains filtered or unexported fields }
FIBConfigurator runs in the background in its own goroutine where it watches for any changes in the configuration of fib table entries as modelled by the proto file "../model/l2/l2.proto" and stored in ETCD under the key "/vnf-agent/{vnf-agent}/vpp/config/v1/bd/<bd-label>/fib". Updates received from the northbound API are compared with the VPP run-time configuration and differences are applied through the VPP binary API.
func (*FIBConfigurator) Add ¶
func (plugin *FIBConfigurator) Add(fib *l2.FibTable_FibEntry, callback func(error)) error
Add configures provided FIB input. Every entry has to contain info about MAC address, interface, and bridge domain. If interface or bridge domain is missing or interface is not a part of the bridge domain, FIB data is cached and recalled if particular entity is registered/updated.
func (*FIBConfigurator) Delete ¶
func (plugin *FIBConfigurator) Delete(fib *l2.FibTable_FibEntry, callback func(error)) error
Delete removes FIB table entry. The request to be successful, both interface and bridge domain indices have to be available. Request does nothing without this info. If interface (or bridge domain) was removed before, provided FIB data is just unregistered and agent assumes, that VPP removed FIB entry itself.
func (*FIBConfigurator) GetFibAddCacheIndexes ¶ added in v1.4.0
func (plugin *FIBConfigurator) GetFibAddCacheIndexes() l2idx.FIBIndexRW
GetFibAddCacheIndexes returns FIB memory 'add' cache indexes, for testing purpose
func (*FIBConfigurator) GetFibDelCacheIndexes ¶ added in v1.4.0
func (plugin *FIBConfigurator) GetFibDelCacheIndexes() l2idx.FIBIndexRW
GetFibDelCacheIndexes returns FIB memory 'del' cache indexes, for testing purpose
func (*FIBConfigurator) Init ¶
func (plugin *FIBConfigurator) Init() (err error)
Init goroutines, mappings, channels..
func (*FIBConfigurator) Modify ¶ added in v1.4.0
func (plugin *FIBConfigurator) Modify(oldFib *l2.FibTable_FibEntry, newFib *l2.FibTable_FibEntry, callback func(error)) error
Modify provides changes for FIB entry. Old fib entry is removed (if possible) and a new one is registered if all the conditions are fulfilled (interface and bridge domain presence), otherwise new configuration is cached.
func (*FIBConfigurator) ResolveCreatedBridgeDomain ¶
func (plugin *FIBConfigurator) ResolveCreatedBridgeDomain(bdName string, bdID uint32, callback func(error)) error
ResolveCreatedBridgeDomain uses FIB cache to configure any FIB entries for this bridge domain. Required interface is checked for existence. If resolution is successful, new FIB entry is configured, registered and removed from cache.
func (*FIBConfigurator) ResolveCreatedInterface ¶
func (plugin *FIBConfigurator) ResolveCreatedInterface(ifName string, ifIdx uint32, callback func(error)) error
ResolveCreatedInterface uses FIB cache to additionally configure any FIB entries for this interface. Bridge domain is checked for existence. If resolution is successful, new FIB entry is configured, registered and removed from cache.
func (*FIBConfigurator) ResolveDeletedBridgeDomain ¶
func (plugin *FIBConfigurator) ResolveDeletedBridgeDomain(bdName string, bdID uint32, callback func(error)) error
ResolveDeletedInterface handles removed bridge domain. In that case, FIB entry remains on the VPP but it is not possible to delete it.
func (*FIBConfigurator) ResolveDeletedInterface ¶
func (plugin *FIBConfigurator) ResolveDeletedInterface(ifName string, ifIdx uint32, callback func(error)) error
ResolveDeletedInterface handles removed interface. In that case, FIB entry remains on the VPP but it is not possible to delete it.
func (*FIBConfigurator) ResolveUpdatedBridgeDomain ¶ added in v1.4.0
func (plugin *FIBConfigurator) ResolveUpdatedBridgeDomain(bdName string, bdID uint32, callback func(error)) error
ResolveUpdatedBridgeDomain handles case where metadata of bridge domain are updated. If interface-bridge domain pair required for a FIB entry was not bound together, but it was changed in the bridge domain later, FIB is resolved and eventually configred here.
func (*FIBConfigurator) Resync ¶
func (plugin *FIBConfigurator) Resync(nbFIBs []*l2.FibTable_FibEntry) error
Resync writes missing FIBs to the VPP and removes obsolete ones.
type XConnectConfigurator ¶
type XConnectConfigurator struct {
// contains filtered or unexported fields
}
XConnectConfigurator implements PluginHandlerVPP.
func (*XConnectConfigurator) Close ¶
func (plugin *XConnectConfigurator) Close() error
Close govpp channel.
func (*XConnectConfigurator) ConfigureXConnectPair ¶
func (plugin *XConnectConfigurator) ConfigureXConnectPair(xc *l2.XConnectPairs_XConnectPair) error
ConfigureXConnectPair adds new cross connect pair
func (*XConnectConfigurator) DeleteXConnectPair ¶
func (plugin *XConnectConfigurator) DeleteXConnectPair(xc *l2.XConnectPairs_XConnectPair) error
DeleteXConnectPair removes XConnect if possible. Note: Xconnect pair cannot be removed if any interface is missing.
func (*XConnectConfigurator) GetXcAddCache ¶ added in v1.4.0
func (plugin *XConnectConfigurator) GetXcAddCache() l2idx.XcIndexRW
GetXcAddCache returns cross connect 'add' cache (test purposes)
func (*XConnectConfigurator) GetXcDelCache ¶ added in v1.4.0
func (plugin *XConnectConfigurator) GetXcDelCache() l2idx.XcIndexRW
GetXcDelCache returns cross connect 'del' cache (test purposes)
func (*XConnectConfigurator) GetXcIndexes ¶ added in v1.4.0
func (plugin *XConnectConfigurator) GetXcIndexes() l2idx.XcIndexRW
GetXcIndexes returns cross connect memory indexes
func (*XConnectConfigurator) Init ¶
func (plugin *XConnectConfigurator) Init(logger logging.PluginLogger, goVppMux govppmux.API, swIfIndexes ifaceidx.SwIfIndex, enableStopwatch bool) (err error)
Init essential configurator fields.
func (*XConnectConfigurator) ModifyXConnectPair ¶
func (plugin *XConnectConfigurator) ModifyXConnectPair(newXc, oldXc *l2.XConnectPairs_XConnectPair) error
ModifyXConnectPair modifies cross connect pair (its transmit interface). Old entry is replaced.
func (*XConnectConfigurator) ResolveCreatedInterface ¶ added in v1.0.3
func (plugin *XConnectConfigurator) ResolveCreatedInterface(ifName string) error
ResolveCreatedInterface resolves XConnects waiting for an interface.
func (*XConnectConfigurator) ResolveDeletedInterface ¶ added in v1.0.3
func (plugin *XConnectConfigurator) ResolveDeletedInterface(ifName string) error
ResolveDeletedInterface resolves XConnects using deleted interface If deleted interface is a received interface, the XConnect was removed by the VPP If deleted interface is a transmit interface, it will get flag 'DELETED' in VPP, but the entry will be kept
func (*XConnectConfigurator) Resync ¶
func (plugin *XConnectConfigurator) Resync(nbXConns []*l2.XConnectPairs_XConnectPair) error
Resync writes missing XCons to the VPP and removes obsolete ones.
Source Files ¶
Directories ¶
Path | Synopsis |
---|---|
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. |
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. |
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. |