Documentation ¶
Index ¶
- Constants
- func GetLinuxInterfaceIndex(ifName string) int
- type DataResyncReq
- type Deps
- type LinuxInterfaceConfig
- type LinuxInterfaceConfigurator
- func (plugin *LinuxInterfaceConfigurator) Close() error
- func (plugin *LinuxInterfaceConfigurator) ConfigureLinuxInterface(iface *intf.LinuxInterfaces_Interface) error
- func (plugin *LinuxInterfaceConfigurator) DeleteLinuxInterface(iface *intf.LinuxInterfaces_Interface) error
- func (plugin *LinuxInterfaceConfigurator) Init(ifIndexes ifaceidx.LinuxIfIndexRW) error
- func (plugin *LinuxInterfaceConfigurator) LookupLinuxInterfaces(managedIfs []*intf.LinuxInterfaces_Interface) error
- func (plugin *LinuxInterfaceConfigurator) ModifyLinuxInterface(newConfig *intf.LinuxInterfaces_Interface, ...) error
- func (plugin *LinuxInterfaceConfigurator) Resync(interfaces []*intf.LinuxInterfaces_Interface) error
- type Microservice
- type Plugin
Constants ¶
const PluginID core.PluginName = "linuxplugin"
PluginID used in the Agent Core flavors
Variables ¶
This section is empty.
Functions ¶
func GetLinuxInterfaceIndex ¶
GetLinuxInterfaceIndex returns the index of a Linux interface identified by its name. In Linux, interface index is a positive integer that starts at one, zero is never used. Function returns negative number in case of a failure, such as when the interface doesn't exist. TODO: move to the package with network utilities
Types ¶
type DataResyncReq ¶
type DataResyncReq struct { // Interfaces is a list af all interfaces that are expected to be in Linux after RESYNC Interfaces []*interfaces.LinuxInterfaces_Interface }
DataResyncReq is used to transfer expected configuration of the Linux network stack to the plugins
type Deps ¶ added in v1.0.2
type Deps struct {
Watcher datasync.KeyValProtoWatcher // injected
}
Deps is here to group injected dependencies of plugin to not mix with other plugin fields.
type LinuxInterfaceConfig ¶
type LinuxInterfaceConfig struct {
// contains filtered or unexported fields
}
LinuxInterfaceConfig is used to cache the configuration of Linux interfaces.
type LinuxInterfaceConfigurator ¶
type LinuxInterfaceConfigurator struct {
// contains filtered or unexported fields
}
LinuxInterfaceConfigurator runs in the background in its own goroutine where it watches for any changes in the configuration of interfaces as modelled by the proto file "model/interfaces/interfaces.proto" and stored in ETCD under the key "/vnf-agent/{vnf-agent}/linux/config/v1/interface". Updates received from the northbound API are compared with the Linux network configuration and differences are applied through the Netlink API.
func (*LinuxInterfaceConfigurator) Close ¶
func (plugin *LinuxInterfaceConfigurator) Close() error
Close stops all goroutines started by linuxplugin
func (*LinuxInterfaceConfigurator) ConfigureLinuxInterface ¶
func (plugin *LinuxInterfaceConfigurator) ConfigureLinuxInterface(iface *intf.LinuxInterfaces_Interface) error
ConfigureLinuxInterface reacts to a new northbound Linux interface config by creating and configuring the interface in the host network stack through Netlink API.
func (*LinuxInterfaceConfigurator) DeleteLinuxInterface ¶
func (plugin *LinuxInterfaceConfigurator) DeleteLinuxInterface(iface *intf.LinuxInterfaces_Interface) error
DeleteLinuxInterface reacts to a removed NB configuration of a Linux interface.
func (*LinuxInterfaceConfigurator) Init ¶
func (plugin *LinuxInterfaceConfigurator) Init(ifIndexes ifaceidx.LinuxIfIndexRW) error
Init linuxplugin and start go routines
func (*LinuxInterfaceConfigurator) LookupLinuxInterfaces ¶
func (plugin *LinuxInterfaceConfigurator) LookupLinuxInterfaces(managedIfs []*intf.LinuxInterfaces_Interface) error
LookupLinuxInterfaces looks up all *non-managed* Linux interfaces in the current namespace and registers them into the name-to-index mapping.
func (*LinuxInterfaceConfigurator) ModifyLinuxInterface ¶
func (plugin *LinuxInterfaceConfigurator) ModifyLinuxInterface(newConfig *intf.LinuxInterfaces_Interface, oldConfig *intf.LinuxInterfaces_Interface) error
ModifyLinuxInterface applies changes in the NB configuration of a Linux interface into the host network stack through Netlink API.
func (*LinuxInterfaceConfigurator) Resync ¶
func (plugin *LinuxInterfaceConfigurator) Resync(interfaces []*intf.LinuxInterfaces_Interface) error
Resync configures an initial set of interfaces. Existing Linux interfaces are registered and potentially re-configured.
type Microservice ¶
type Microservice struct {
// contains filtered or unexported fields
}
Microservice is used to store PID and ID of the container running a given microservice.
type Plugin ¶
type Plugin struct { Deps // contains filtered or unexported fields }
Plugin implements Plugin interface, therefore it can be loaded with other plugins
func (*Plugin) GetLinuxIfIndexes ¶
func (plugin *Plugin) GetLinuxIfIndexes() ifaceidx.LinuxIfIndex
GetLinuxIfIndexes gives access to mapping of logical names (used in ETCD configuration) to corresponding Linux interface indexes. This mapping is especially helpful for plugins that need to watch for newly added or deleted Linux interfaces.
Source Files ¶
Directories ¶
Path | Synopsis |
---|---|
model
|
|
interfaces
Package interfaces is a generated protocol buffer package.
|
Package interfaces is a generated protocol buffer package. |