Documentation ¶
Index ¶
- Variables
- type API
- type Config
- type Deps
- type IfPlugin
- func (p *IfPlugin) AfterInit() error
- func (p *IfPlugin) Close() error
- func (p *IfPlugin) GetDHCPIndex() idxmap.NamedMapping
- func (p *IfPlugin) GetInterfaceIndex() ifaceidx.IfaceMetadataIndex
- func (p *IfPlugin) Init() (err error)
- func (p *IfPlugin) SetNotifyService(notify func(notification *vpp.Notification))
- type InterfaceStateUpdater
- type Option
Constants ¶
This section is empty.
Variables ¶
var ( // PeriodicPollingPeriod between statistics reads // TODO should be configurable PeriodicPollingPeriod = time.Second * 5 // StateUpdateDelay defines delay before dumping states StateUpdateDelay = time.Second * 3 )
var DefaultPlugin = *NewPlugin()
DefaultPlugin is a default instance of IfPlugin.
Functions ¶
This section is empty.
Types ¶
type API ¶
type API interface { // GetInterfaceIndex gives read-only access to map with metadata of all configured // VPP interfaces. GetInterfaceIndex() ifaceidx.IfaceMetadataIndex // GetDHCPIndex gives read-only access to (untyped) map with DHCP leases. // Cast metadata to "go.ligato.io/vpp-agent/v3/proto/ligato/vpp/interfaces".DHCPLease GetDHCPIndex() idxmap.NamedMapping // SetNotifyService allows to pass function for updating interface notifications. SetNotifyService(notify func(notification *vpp.Notification)) }
API defines methods exposed by VPP-IfPlugin.
type Deps ¶
type Deps struct { infra.PluginDeps KVScheduler kvs.KVScheduler VPP govppmux.API ServiceLabel servicelabel.ReaderAPI AddrAlloc netalloc.AddressAllocator /* LinuxIfPlugin and NsPlugin deps are optional, but they are required if AFPacket or TAP+TAP_TO_VPP interfaces are used. */ LinuxIfPlugin descriptor.LinuxPluginAPI NsPlugin nsplugin.API // state publishing StatusCheck statuscheck.PluginStatusWriter PublishErrors datasync.KeyProtoValWriter // TODO: to be used with a generic plugin for publishing errors (not just interfaces and BDs) Watcher datasync.KeyValProtoWatcher /* for resync of interface state data (PublishStatistics) */ NotifyStates datasync.KeyProtoValWriter /* e.g. Kafka (up/down events only)*/ PublishStatistics datasync.KeyProtoValWriter /* e.g. ETCD (with resync) */ DataSyncs map[string]datasync.KeyProtoValWriter /* available DBs for PublishStatistics */ PushNotification func(notification *vpp.Notification) }
Deps lists dependencies of the interface plugin.
type IfPlugin ¶
type IfPlugin struct { Deps // contains filtered or unexported fields }
IfPlugin configures VPP interfaces using GoVPP.
func (*IfPlugin) GetDHCPIndex ¶
func (p *IfPlugin) GetDHCPIndex() idxmap.NamedMapping
GetDHCPIndex gives read-only access to (untyped) map with DHCP leases. Cast metadata to "go.ligato.io/vpp-agent/v3/proto/ligato/vpp/interfaces".DHCPLease
func (*IfPlugin) GetInterfaceIndex ¶
func (p *IfPlugin) GetInterfaceIndex() ifaceidx.IfaceMetadataIndex
GetInterfaceIndex gives read-only access to map with metadata of all configured VPP interfaces.
func (*IfPlugin) SetNotifyService ¶
func (p *IfPlugin) SetNotifyService(notify func(notification *vpp.Notification))
SetNotifyService sets notification callback for processing VPP notifications.
type InterfaceStateUpdater ¶
type InterfaceStateUpdater struct {
// contains filtered or unexported fields
}
InterfaceStateUpdater holds state data of all VPP interfaces.
func (*InterfaceStateUpdater) AfterInit ¶
func (c *InterfaceStateUpdater) AfterInit() error
AfterInit subscribes for watching VPP notifications on previously initialized channel
func (*InterfaceStateUpdater) Close ¶
func (c *InterfaceStateUpdater) Close() error
Close unsubscribes from interface state notifications from VPP & GOVPP channel
func (*InterfaceStateUpdater) Init ¶
func (c *InterfaceStateUpdater) Init( ctx context.Context, logger logging.PluginLogger, kvScheduler kvs.KVScheduler, vppClient vpp.Client, swIfIndexes ifaceidx.IfaceMetadataIndex, publishIfState func(*intf.InterfaceNotification), readCounters bool, ) error
Init members (channels, maps...) and start go routines
Source Files ¶
Directories ¶
Path | Synopsis |
---|---|
Package ifaceidx implements name-to-index mapping registry and cache for VPP interfaces.
|
Package ifaceidx implements name-to-index mapping registry and cache for VPP interfaces. |
vpp2101
Package vppcalls contains wrappers over VPP binary APIs for all supported interface types and for dumping all interfaces configured in VPP.
|
Package vppcalls contains wrappers over VPP binary APIs for all supported interface types and for dumping all interfaces configured in VPP. |
vpp2106
Package vppcalls contains wrappers over VPP binary APIs for all supported interface types and for dumping all interfaces configured in VPP.
|
Package vppcalls contains wrappers over VPP binary APIs for all supported interface types and for dumping all interfaces configured in VPP. |
vpp2202
Package vpp2202 contains wrappers over VPP binary APIs for all supported interface types and for dumping all interfaces configured in VPP.
|
Package vpp2202 contains wrappers over VPP binary APIs for all supported interface types and for dumping all interfaces configured in VPP. |
vpp2210
Package vpp2210 contains wrappers over VPP binary APIs for all supported interface types and for dumping all interfaces configured in VPP.
|
Package vpp2210 contains wrappers over VPP binary APIs for all supported interface types and for dumping all interfaces configured in VPP. |