Documentation ¶
Overview ¶
Package l2plugin is the implementation of the L2 plugin that handles BD / L2 FIB.
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)
- 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) 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 { GoVppmux *govppmux.GOVPPPlugin BdIndexes bdidx.BDIndexRW // bridge domains IfToBdIndexes idxvpp.NameToIdxRW // interface to bridge domain mapping - desired state. Metadata is boolean flag whether interface is bvi or not //TODO use rather BdIndexes.LookupNameByIfaceName IfToBdRealStateIdx idxvpp.NameToIdxRW // interface to bridge domain mapping - current state. Metadata is boolean flag whether interface is bvi or not BridgeDomainIDSeq uint32 RegisteredIfaceCounter uint32 SwIfIndexes ifaceidx.SwIfIndex // 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 process 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 up all VPP BDs and saves their name-to-index mapping
func (*BDConfigurator) ModifyBridgeDomain ¶
func (plugin *BDConfigurator) ModifyBridgeDomain(newConfig *l2.BridgeDomains_BridgeDomain, oldConfig *l2.BridgeDomains_BridgeDomain) error
ModifyBridgeDomain process 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)
ResolveDeletedInterface does nothing
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 (because 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 { GoVppmux *govppmux.GOVPPPlugin // 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 { GoVppmux *govppmux.GOVPPPlugin 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 // 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, 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. To have request successful, both interface and bridge domain indexes 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 new one is registered if all 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 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 { GoVppmux *govppmux.GOVPPPlugin SwIfIndexes ifaceidx.SwIfIndex XcIndexes idxvpp.NameToIdxRW XcIndexSeq uint32 // 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 process the NB config and propagates it to bin api calls
func (*XConnectConfigurator) DeleteXConnectPair ¶
func (plugin *XConnectConfigurator) DeleteXConnectPair(xConnectPairInput *l2.XConnectPairs_XConnectPair) error
DeleteXConnectPair process 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 process the NB config and propagates it to bin api calls
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
}
XConnectMeta meta hold info about transmit interface
Source Files ¶
Directories ¶
Path | Synopsis |
---|---|
bin_api
|
|
l2
Package l2 represents the VPP binary API of the 'l2' VPP module.
|
Package l2 represents the VPP binary API of the 'l2' VPP module. |
vpe
Code generated by github.com/ungerik/pkgreflect DO NOT EDIT.
|
Code generated by github.com/ungerik/pkgreflect DO NOT EDIT. |
model
|
|
l2
Package l2 is a generated protocol buffer package.
|
Package l2 is a generated protocol buffer package. |
Package testing provides tools and input data for unit testing of ifplugin.
|
Package testing provides tools and input data for unit testing of ifplugin. |