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(bridgeDomainInput *l2.BridgeDomains_BridgeDomain) error
- func (plugin *BDConfigurator) DeleteBridgeDomain(bridgeDomain *l2.BridgeDomains_BridgeDomain) error
- func (plugin *BDConfigurator) Init(notificationChannel chan BridgeDomainStateMessage) (err error)
- func (plugin *BDConfigurator) LookupBridgeDomainDetails(bdID uint32, bdName string) error
- func (plugin *BDConfigurator) ModifyBridgeDomain(newConfig *l2.BridgeDomains_BridgeDomain, ...) error
- func (plugin *BDConfigurator) ResolveCreatedInterface(interfaceName string, interfaceIndex uint32) error
- func (plugin *BDConfigurator) ResolveDeletedInterface(interfaceName 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.FibTableEntries_FibTableEntry, callback func(error)) error
- func (plugin *FIBConfigurator) Close() error
- func (plugin *FIBConfigurator) Delete(fib *l2.FibTableEntries_FibTableEntry, callback func(error)) error
- func (plugin *FIBConfigurator) Diff(oldFib *l2.FibTableEntries_FibTableEntry, ...) error
- func (plugin *FIBConfigurator) Init() (err error)
- func (plugin *FIBConfigurator) LookupFIBEntries(bridgeDomain uint32) error
- func (plugin *FIBConfigurator) ResolveCreatedBridgeDomain(domainName string, domainID uint32, callback func(error)) error
- func (plugin *FIBConfigurator) ResolveCreatedInterface(interfaceName string, interfaceIndex uint32, callback func(error)) error
- func (plugin *FIBConfigurator) ResolveDeletedBridgeDomain(domainName string, domainID uint32, callback func(error)) error
- func (plugin *FIBConfigurator) ResolveDeletedInterface(interfaceName string, interfaceIndex uint32, callback func(error)) error
- func (plugin *FIBConfigurator) Resync(fibConfig []*l2.FibTableEntries_FibTableEntry) error
- type FIBMeta
- type XConnectConfigurator
- func (plugin *XConnectConfigurator) Close() error
- func (plugin *XConnectConfigurator) ConfigureXConnectPair(xConnectPairInput *l2.XConnectPairs_XConnectPair) error
- func (plugin *XConnectConfigurator) DeleteXConnectPair(xConnectPairInput *l2.XConnectPairs_XConnectPair) error
- func (plugin *XConnectConfigurator) Init() (err error)
- func (plugin *XConnectConfigurator) LookupXConnectPairs() error
- func (plugin *XConnectConfigurator) ModifyXConnectPair(newConfig *l2.XConnectPairs_XConnectPair, ...) error
- func (plugin *XConnectConfigurator) ResolveCreatedInterface(interfaceName string, interfaceIndex uint32) error
- func (plugin *XConnectConfigurator) ResolveDeletedInterface(interfaceName string) error
- func (plugin *XConnectConfigurator) Resync(xcConfig []*l2.XConnectPairs_XConnectPair) error
- type XConnectMeta
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 BdIndexes bdidx.BDIndexRW // bridge domains IfToBdIndexes idxvpp.NameToIdxRW // interface to bridge domain mapping - desired state. Metadata is boolean flag saying whether the interface is bvi or not //TODO use rather BdIndexes.LookupNameByIfaceName IfToBdRealStateIdx idxvpp.NameToIdxRW // interface to bridge domain mapping - current state. Metadata is boolean flag saying whether the interface is bvi or not BridgeDomainIDSeq uint32 RegisteredIfaceCounter uint32 SwIfIndexes ifaceidx.SwIfIndex 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(bridgeDomainInput *l2.BridgeDomains_BridgeDomain) error
ConfigureBridgeDomain for newly created bridge domain.
func (*BDConfigurator) DeleteBridgeDomain ¶
func (plugin *BDConfigurator) DeleteBridgeDomain(bridgeDomain *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) LookupBridgeDomainDetails ¶
func (plugin *BDConfigurator) LookupBridgeDomainDetails(bdID uint32, bdName string) error
LookupBridgeDomainDetails looks for existing VPP bridge domain state and propagates it to the etcd bd state.
func (*BDConfigurator) ModifyBridgeDomain ¶
func (plugin *BDConfigurator) ModifyBridgeDomain(newConfig *l2.BridgeDomains_BridgeDomain, oldConfig *l2.BridgeDomains_BridgeDomain) error
ModifyBridgeDomain processes the NB config and propagates it to bin api calls.
func (*BDConfigurator) ResolveCreatedInterface ¶
func (plugin *BDConfigurator) ResolveCreatedInterface(interfaceName string, interfaceIndex uint32) error
ResolveCreatedInterface looks for bridge domain this interface is assigned to and sets it up.
func (*BDConfigurator) ResolveDeletedInterface ¶
func (plugin *BDConfigurator) ResolveDeletedInterface(interfaceName 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 BDs to the empty VPP.
type BridgeDomainMeta ¶
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 bdidx.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 SwIfIndexes ifaceidx.SwIfIndex BdIndexes bdidx.BDIndex IfToBdIndexes idxvpp.NameToIdxRW //TODO use rather BdIndexes.LookupNameByIfaceName FibIndexes idxvpp.NameToIdxRW FibIndexSeq uint32 FibDesIndexes idxvpp.NameToIdxRW // Serves as a cache for FIBs which cannot be configured immediately 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.FibTableEntries_FibTableEntry, callback func(error)) error
Add configures provided FIB input. Every entry has to contain info about MAC address, and interface, and bridge domain. If interface or bridge domain is missing, FIB data is cached and recalled if particular entity is registered.
func (*FIBConfigurator) Delete ¶
func (plugin *FIBConfigurator) Delete(fib *l2.FibTableEntries_FibTableEntry, 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) Diff ¶
func (plugin *FIBConfigurator) Diff(oldFib *l2.FibTableEntries_FibTableEntry, newFib *l2.FibTableEntries_FibTableEntry, callback func(error)) error
Diff 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) Init ¶
func (plugin *FIBConfigurator) Init() (err error)
Init goroutines, mappings, channels, ...
func (*FIBConfigurator) LookupFIBEntries ¶
func (plugin *FIBConfigurator) LookupFIBEntries(bridgeDomain uint32) error
LookupFIBEntries iterates over all FIBs belonging to a provided bridge domain ID and registers any missing configuration for them.
func (*FIBConfigurator) ResolveCreatedBridgeDomain ¶
func (plugin *FIBConfigurator) ResolveCreatedBridgeDomain(domainName string, domainID uint32, callback func(error)) error
ResolveCreatedBridgeDomain uses FIB cache to additionally 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(interfaceName string, interfaceIndex 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(domainName string, domainID uint32, callback func(error)) error
ResolveDeletedBridgeDomain if BD was deleted. All FIB entries belonging to this bridge domain are removed from configuration and added to FIB cache (from Agent perspective, FIB entry is not removed when bridge domain vanishes).
func (*FIBConfigurator) ResolveDeletedInterface ¶
func (plugin *FIBConfigurator) ResolveDeletedInterface(interfaceName string, interfaceIndex uint32, callback func(error)) error
ResolveDeletedInterface if interface was deleted. All FIB entries belonging to this interface are removed from configuration and added to FIB cache (from Agent perspective, FIB entry is not removed when interface is removed).
func (*FIBConfigurator) Resync ¶
func (plugin *FIBConfigurator) Resync(fibConfig []*l2.FibTableEntries_FibTableEntry) error
Resync writes FIBs to the empty VPP.
type XConnectConfigurator ¶
type XConnectConfigurator struct { Log logging.Logger GoVppmux govppmux.API SwIfIndexes ifaceidx.SwIfIndex XcIndexes idxvpp.NameToIdxRW XcIndexSeq uint32 Stopwatch *measure.Stopwatch // timer used to measure and store time // 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(xConnectPairInput *l2.XConnectPairs_XConnectPair) error
ConfigureXConnectPair processes the NB config and propagates it to bin api calls.
func (*XConnectConfigurator) DeleteXConnectPair ¶
func (plugin *XConnectConfigurator) DeleteXConnectPair(xConnectPairInput *l2.XConnectPairs_XConnectPair) error
DeleteXConnectPair processes the NB config and propagates it to bin api calls.
func (*XConnectConfigurator) Init ¶
func (plugin *XConnectConfigurator) Init() (err error)
Init members (channels...) and start go routines.
func (*XConnectConfigurator) LookupXConnectPairs ¶
func (plugin *XConnectConfigurator) LookupXConnectPairs() error
LookupXConnectPairs registers missing l2 xConnect pairs.
func (*XConnectConfigurator) ModifyXConnectPair ¶
func (plugin *XConnectConfigurator) ModifyXConnectPair(newConfig *l2.XConnectPairs_XConnectPair, oldConfig *l2.XConnectPairs_XConnectPair) error
ModifyXConnectPair processes the NB config and propagates it to bin api calls.
func (*XConnectConfigurator) ResolveCreatedInterface ¶ added in v1.0.3
func (plugin *XConnectConfigurator) ResolveCreatedInterface(interfaceName string, interfaceIndex uint32) error
ResolveCreatedInterface configures xconnect pairs that use the interface as rx or tx and have not been configured yet.
func (*XConnectConfigurator) ResolveDeletedInterface ¶ added in v1.0.3
func (plugin *XConnectConfigurator) ResolveDeletedInterface(interfaceName string) error
ResolveDeletedInterface deletes xconnect pairs that have not been deleted yet and use the interface as rx or tx.
func (*XConnectConfigurator) Resync ¶
func (plugin *XConnectConfigurator) Resync(xcConfig []*l2.XConnectPairs_XConnectPair) error
Resync writes XCons to the empty VPP.
type XConnectMeta ¶
type XConnectMeta struct { TransmitInterface string // contains filtered or unexported fields }
XConnectMeta meta holds info about transmit interface.
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 binapi is the parent for packages that define various l2plugin southbound APIs.
|
Package binapi is the parent for packages that define various l2plugin southbound APIs. |
l2
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. |
Package model defines the l2plugin's northbound API.
|
Package model defines the l2plugin's northbound API. |
l2
Package l2 is a generated protocol buffer package.
|
Package l2 is a generated protocol buffer package. |
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. |