Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var DefaultPlugin = *NewPlugin()
DefaultPlugin is a default instance of IfPlugin.
Functions ¶
This section is empty.
Types ¶
type API ¶
type API interface { // GetBDIndex gives read-only access to map with metadata of all configured // mock bridge domains. GetBDIndex() idxvpp.NameToIndex }
API defines methods exposed by mock l2plugin.
type Deps ¶
type Deps struct { infra.PluginDeps // the plugin depends on KVScheduler because it needs to register the // descriptors for BDs and FIBs. KVScheduler kvs.KVScheduler // ifplugin is needed to convert interface name to the corresponding integer // handle used in the mock SB IfPlugin ifplugin.API }
Deps lists dependencies of the mock interface plugin.
type L2Plugin ¶
type L2Plugin struct { Deps // contains filtered or unexported fields }
L2Plugin configures mock bridge domains and L2 FIBs.
func (*L2Plugin) Close ¶
Close of a real (not-mock) plugin usually:
- stops all the associated go routines (if any)
- closes channels, registrations, etc..
In this example we do nothing (no need to un-register descriptor).
func (*L2Plugin) GetBDIndex ¶
func (p *L2Plugin) GetBDIndex() idxvpp.NameToIndex
GetBDIndex gives read-only access to map with metadata of all configured mock bridge domains.
func (*L2Plugin) Init ¶
Init of a real (not-mock) plugin usually:
- loads configuration from a file (if any)
- registers descriptors for all objects the plugin implements
- potentially starts go routine to watch for some asynchronous events (from which usually sends notifications to KVScheduler via PushSBNotification)
- etc.
In this mock ifplugin, we only create mock SB handlers and register the descriptors.
Click to show internal directories.
Click to hide internal directories.