Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type SwIfIdxDto ¶
type SwIfIdxDto struct {
idxvpp.NameToIdxDtoWithoutMeta
Metadata *intf.Interfaces_Interface
}
SwIfIdxDto represents an item sent through watch channel in swIfIndex. In contrast to NameToIdxDto it contains typed metadata.
type SwIfIndex ¶
type SwIfIndex interface {
// GetMapping returns internal read-only mapping with metadata of type interface{}.
GetMapping() idxvpp.NameToIdxRW
// LookupIdx looks up previously stored item identified by index in mapping.
LookupIdx(name string) (idx uint32, metadata *intf.Interfaces_Interface, exists bool)
// LookupName looks up previously stored item identified by name in mapping.
LookupName(idx uint32) (name string, metadata *intf.Interfaces_Interface, exists bool)
// LookupNameByIP returns name of items that contains given IP address in metadata
LookupNameByIP(ip string) []string
// WatchNameToIdx allows to subscribe for watching changes in swIfIndex mapping
WatchNameToIdx(subscriber core.PluginName, pluginChannel chan SwIfIdxDto)
}
SwIfIndex provides read-only access to mapping between software interface indexes (used internally in VPP) and interface names.
func Cache ¶
func Cache(watcher datasync.KeyValProtoWatcher, caller core.PluginName) SwIfIndex
Cache the network interfaces of a particular agent by watching (ETCD or different transport) Beware: the indexes in cache do not correspond to the real indexes.
type SwIfIndexRW ¶
type SwIfIndexRW interface {
SwIfIndex
// RegisterName adds new item into name-to-index mapping.
RegisterName(name string, idx uint32, ifMeta *intf.Interfaces_Interface)
// UnregisterName removes an item identified by name from mapping
UnregisterName(name string) (idx uint32, metadata *intf.Interfaces_Interface, exists bool)
}
SwIfIndexRW is mapping between software interface indexes (used internally in VPP) and interface names.
func NewSwIfIndex ¶
func NewSwIfIndex(mapping idxvpp.NameToIdxRW) SwIfIndexRW
NewSwIfIndex creates new instance of swIfIndex.
Source Files
¶
- cache_iface.go
- sw_if_index.go
Click to show internal directories.
Click to hide internal directories.