Documentation
¶
Overview ¶
Package ifaceidx implements name-to-index mapping registry and cache for VPP interfaces.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func IndexDHCPMetadata ¶ added in v1.4.0
IndexDHCPMetadata creates indexes for metadata.
Types ¶
type DHCPSettings ¶ added in v1.4.0
type DHCPSettings struct {
IfName string
IsIPv6 bool
IPAddress string
Mask uint32
PhysAddress string
RouterAddress string
}
DHCPSettings contains all DHCP related information. Used as a metadata type for DHCP mapping.
type DhcpIdxDto ¶ added in v1.4.0
type DhcpIdxDto struct {
idxvpp.NameToIdxDtoWithoutMeta
Metadata *DHCPSettings
}
DhcpIdxDto represents an item sent through watch channel in dhcpIfIndex. In contrast to NameToIdxDto, it contains typed metadata.
type DhcpIndex ¶ added in v1.4.0
type DhcpIndex interface {
// GetMapping returns internal read-only mapping with metadata.
GetMapping() idxvpp.NameToIdxRW
// LookupIdx looks up previously stored item identified by index in mapping.
LookupIdx(name string) (idx uint32, metadata *DHCPSettings, exists bool)
// LookupName looks up previously stored item identified by name in mapping.
LookupName(idx uint32) (name string, metadata *DHCPSettings, exists bool)
// WatchNameToIdx allows to subscribe for watching changes in DhcpIndex mapping.
WatchNameToIdx(subscriber core.PluginName, pluginChannel chan DhcpIdxDto)
}
DhcpIndex provides read-only access to mapping between software interface names, indices (used internally in VPP) and DHCP configuration.
type DhcpIndexRW ¶ added in v1.4.0
type DhcpIndexRW interface {
DhcpIndex
// RegisterName adds a new item into name-to-index mapping.
RegisterName(name string, idx uint32, ifMeta *DHCPSettings)
// UnregisterName removes an item identified by name from mapping.
UnregisterName(name string) (idx uint32, metadata *DHCPSettings, exists bool)
}
DhcpIndexRW is mapping between software interface names, indices (used internally in VPP) and DHCP configuration.
func NewDHCPIndex ¶ added in v1.4.0
func NewDHCPIndex(mapping idxvpp.NameToIdxRW) DhcpIndexRW
NewDHCPIndex creates new instance of dhcpIndex.
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 indices (used internally in VPP) and interface names.
func Cache ¶
func Cache(watcher datasync.KeyValProtoWatcher) SwIfIndex
Cache the network interfaces of a particular agent by watching (ETCD or different transport). Beware: the indices in cache do not correspond with the real indices.
type SwIfIndexRW ¶
type SwIfIndexRW interface {
SwIfIndex
// RegisterName adds a 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)
// UpdateMetadata updates metadata in existing interface entry.
UpdateMetadata(name string, metadata *intf.Interfaces_Interface) (success bool)
}
SwIfIndexRW is mapping between software interface indices (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
- dhcp_index.go
- doc.go
- sw_if_index.go