Documentation ¶
Overview ¶
Package l2plugin implements the L2 plugin that handles Bridge Domains and L2 FIBs.
Index ¶
- type BDConfigurator
- func (c *BDConfigurator) Close() error
- func (c *BDConfigurator) ConfigureBridgeDomain(bdConfig *l2.BridgeDomains_BridgeDomain) error
- func (c *BDConfigurator) DeleteBridgeDomain(bdConfig *l2.BridgeDomains_BridgeDomain) error
- func (c *BDConfigurator) GetBdIndexes() l2idx.BDIndexRW
- func (c *BDConfigurator) Init(logger logging.PluginLogger, goVppMux govppmux.API, ...) (err error)
- func (c *BDConfigurator) LogError(err error) error
- func (c *BDConfigurator) ModifyBridgeDomain(newBdConfig, oldBdConfig *l2.BridgeDomains_BridgeDomain) error
- func (c *BDConfigurator) ResolveCreatedInterface(ifName string, ifIdx uint32) error
- func (c *BDConfigurator) ResolveDeletedInterface(ifName string) error
- func (c *BDConfigurator) Resync(nbBDs []*l2.BridgeDomains_BridgeDomain) error
- type BridgeDomainStateMessage
- type BridgeDomainStateNotification
- type BridgeDomainStateUpdater
- type FIBConfigurator
- func (c *FIBConfigurator) Add(fib *l2.FibTable_FibEntry, callback func(error)) error
- func (c *FIBConfigurator) Close() error
- func (c *FIBConfigurator) Delete(fib *l2.FibTable_FibEntry, callback func(error)) error
- func (c *FIBConfigurator) GetFibAddCacheIndexes() l2idx.FIBIndexRW
- func (c *FIBConfigurator) GetFibDelCacheIndexes() l2idx.FIBIndexRW
- func (c *FIBConfigurator) GetFibIndexes() l2idx.FIBIndexRW
- func (c *FIBConfigurator) Init(logger logging.PluginLogger, goVppMux govppmux.API, ...) (err error)
- func (c *FIBConfigurator) LogError(err error) error
- func (c *FIBConfigurator) Modify(oldFib *l2.FibTable_FibEntry, newFib *l2.FibTable_FibEntry, ...) error
- func (c *FIBConfigurator) ResolveCreatedBridgeDomain(bdName string, bdID uint32, callback func(error)) error
- func (c *FIBConfigurator) ResolveCreatedInterface(ifName string, ifIdx uint32, callback func(error)) error
- func (c *FIBConfigurator) ResolveDeletedBridgeDomain(bdName string, bdID uint32, callback func(error)) error
- func (c *FIBConfigurator) ResolveDeletedInterface(ifName string, ifIdx uint32, callback func(error)) error
- func (c *FIBConfigurator) ResolveUpdatedBridgeDomain(bdName string, bdID uint32, callback func(error)) error
- func (c *FIBConfigurator) Resync(nbFIBs []*l2.FibTable_FibEntry) error
- type XConnectConfigurator
- func (c *XConnectConfigurator) Close() error
- func (c *XConnectConfigurator) ConfigureXConnectPair(xc *l2.XConnectPairs_XConnectPair) error
- func (c *XConnectConfigurator) DeleteXConnectPair(xc *l2.XConnectPairs_XConnectPair) error
- func (c *XConnectConfigurator) GetXcAddCache() l2idx.XcIndexRW
- func (c *XConnectConfigurator) GetXcDelCache() l2idx.XcIndexRW
- func (c *XConnectConfigurator) GetXcIndexes() l2idx.XcIndexRW
- func (c *XConnectConfigurator) Init(logger logging.PluginLogger, goVppMux govppmux.API, ...) (err error)
- func (c *XConnectConfigurator) LogError(err error) error
- func (c *XConnectConfigurator) ModifyXConnectPair(newXc, oldXc *l2.XConnectPairs_XConnectPair) error
- func (c *XConnectConfigurator) ResolveCreatedInterface(ifName string) error
- func (c *XConnectConfigurator) ResolveDeletedInterface(ifName string) error
- func (c *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 {
// 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 (c *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 (c *BDConfigurator) DeleteBridgeDomain(bdConfig *l2.BridgeDomains_BridgeDomain) error
DeleteBridgeDomain processes the NB config and propagates it to bin api calls.
func (*BDConfigurator) GetBdIndexes ¶
func (c *BDConfigurator) GetBdIndexes() l2idx.BDIndexRW
GetBdIndexes exposes interface name-to-index mapping
func (*BDConfigurator) Init ¶
func (c *BDConfigurator) Init(logger logging.PluginLogger, goVppMux govppmux.API, swIfIndexes ifaceidx.SwIfIndex, notificationChannel chan BridgeDomainStateMessage) (err error)
Init members (channels...) and start go routines.
func (*BDConfigurator) LogError ¶ added in v1.8.1
func (c *BDConfigurator) LogError(err error) error
LogError prints error if not nil, including stack trace. The same value is also returned, so it can be easily propagated further
func (*BDConfigurator) ModifyBridgeDomain ¶
func (c *BDConfigurator) ModifyBridgeDomain(newBdConfig, oldBdConfig *l2.BridgeDomains_BridgeDomain) error
ModifyBridgeDomain processes the NB config and propagates it to bin api calls.
func (*BDConfigurator) ResolveCreatedInterface ¶
func (c *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 (c *BDConfigurator) ResolveDeletedInterface(ifName string) error
ResolveDeletedInterface is called by VPP if an interface is removed.
func (*BDConfigurator) Resync ¶
func (c *BDConfigurator) Resync(nbBDs []*l2.BridgeDomains_BridgeDomain) error
Resync writes missing BDs to the VPP and removes obsolete ones.
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 {
// contains filtered or unexported fields
}
BridgeDomainStateUpdater holds all data required to handle bridge domain state.
func (*BridgeDomainStateUpdater) Init ¶
func (c *BridgeDomainStateUpdater) Init(ctx context.Context, logger logging.PluginLogger, goVppMux govppmux.API, bdIndexes l2idx.BDIndex, swIfIndexes ifaceidx.SwIfIndex, notificationChan chan BridgeDomainStateMessage, publishBdState func(notification *BridgeDomainStateNotification)) (err error)
Init bridge domain state updater.
func (*BridgeDomainStateUpdater) LogError ¶ added in v1.8.1
func (c *BridgeDomainStateUpdater) LogError(err error) error
LogError prints error if not nil, including stack trace. The same value is also returned, so it can be easily propagated further
type FIBConfigurator ¶
type FIBConfigurator struct {
// 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 (c *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 (c *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 ¶
func (c *FIBConfigurator) GetFibAddCacheIndexes() l2idx.FIBIndexRW
GetFibAddCacheIndexes returns FIB memory 'add' cache indexes, for testing purpose
func (*FIBConfigurator) GetFibDelCacheIndexes ¶
func (c *FIBConfigurator) GetFibDelCacheIndexes() l2idx.FIBIndexRW
GetFibDelCacheIndexes returns FIB memory 'del' cache indexes, for testing purpose
func (*FIBConfigurator) GetFibIndexes ¶
func (c *FIBConfigurator) GetFibIndexes() l2idx.FIBIndexRW
GetFibIndexes returns FIB memory indexes
func (*FIBConfigurator) Init ¶
func (c *FIBConfigurator) Init(logger logging.PluginLogger, goVppMux govppmux.API, swIfIndexes ifaceidx.SwIfIndex, bdIndexes l2idx.BDIndex) (err error)
Init goroutines, mappings, channels..
func (*FIBConfigurator) LogError ¶ added in v1.8.1
func (c *FIBConfigurator) LogError(err error) error
LogError prints error if not nil, including stack trace. The same value is also returned, so it can be easily propagated further
func (*FIBConfigurator) Modify ¶
func (c *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 (c *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 (c *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 (c *FIBConfigurator) ResolveDeletedBridgeDomain(bdName string, bdID uint32, callback func(error)) error
ResolveDeletedBridgeDomain 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 (c *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 ¶
func (c *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 (c *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 (c *XConnectConfigurator) Close() error
Close govpp channel.
func (*XConnectConfigurator) ConfigureXConnectPair ¶
func (c *XConnectConfigurator) ConfigureXConnectPair(xc *l2.XConnectPairs_XConnectPair) error
ConfigureXConnectPair adds new cross connect pair
func (*XConnectConfigurator) DeleteXConnectPair ¶
func (c *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 ¶
func (c *XConnectConfigurator) GetXcAddCache() l2idx.XcIndexRW
GetXcAddCache returns cross connect 'add' cache (test purposes)
func (*XConnectConfigurator) GetXcDelCache ¶
func (c *XConnectConfigurator) GetXcDelCache() l2idx.XcIndexRW
GetXcDelCache returns cross connect 'del' cache (test purposes)
func (*XConnectConfigurator) GetXcIndexes ¶
func (c *XConnectConfigurator) GetXcIndexes() l2idx.XcIndexRW
GetXcIndexes returns cross connect memory indexes
func (*XConnectConfigurator) Init ¶
func (c *XConnectConfigurator) Init(logger logging.PluginLogger, goVppMux govppmux.API, swIfIndexes ifaceidx.SwIfIndex) (err error)
Init essential configurator fields.
func (*XConnectConfigurator) LogError ¶ added in v1.8.1
func (c *XConnectConfigurator) LogError(err error) error
LogError prints error if not nil, including stack trace. The same value is also returned, so it can be easily propagated further
func (*XConnectConfigurator) ModifyXConnectPair ¶
func (c *XConnectConfigurator) ModifyXConnectPair(newXc, oldXc *l2.XConnectPairs_XConnectPair) error
ModifyXConnectPair modifies cross connect pair (its transmit interface). Old entry is replaced.
func (*XConnectConfigurator) ResolveCreatedInterface ¶
func (c *XConnectConfigurator) ResolveCreatedInterface(ifName string) error
ResolveCreatedInterface resolves XConnects waiting for an interface.
func (*XConnectConfigurator) ResolveDeletedInterface ¶
func (c *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 (c *XConnectConfigurator) Resync(nbXConns []*l2.XConnectPairs_XConnectPair) error
Resync writes missing XCons to the VPP and removes obsolete ones.
Source Files ¶
Directories ¶
Path | Synopsis |
---|---|
Package l2idx implements name-to-index mapping registry and cache for bridge-domains.
|
Package l2idx 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 and helpers for dumping them.
|
Package vppcalls contains wrappers over VPP binary APIs for bridge-domains, and L2 FIBs and XConnect pairs and helpers for dumping them. |