Documentation ¶
Index ¶
- func GetLinuxInterfaceIndex(ifName string) int
- 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() error
- func (plugin *LinuxInterfaceConfigurator) ModifyLinuxInterface(newConfig *intf.LinuxInterfaces_Interface, ...) error
- func (plugin *LinuxInterfaceConfigurator) Resync(interfaces []*interfaces.LinuxInterfaces_Interface) error
- type Microservice
Constants ¶
This section is empty.
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 LinuxInterfaceConfig ¶
type LinuxInterfaceConfig struct {
// contains filtered or unexported fields
}
LinuxInterfaceConfig is used to cache the configuration of Linux interfaces.
type LinuxInterfaceConfigurator ¶
type LinuxInterfaceConfigurator struct { Log logging.Logger /* time measurement */ Stopwatch *measure.Stopwatch // timer used to measure and store time // 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() error
LookupLinuxInterfaces looks up all currently unmanaged Linux interfaces in the current namespace and registers them into the name-to-index mapping. Furthermore, it triggers goroutine that will watch for newly added interfaces (by another party) unless it is already running.
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 []*interfaces.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.
Directories ¶
Path | Synopsis |
---|---|
Package ifaceidx implements name-to-index mapping registry and cache for Linux interfaces.
|
Package ifaceidx implements name-to-index mapping registry and cache for Linux interfaces. |
Package linuxcalls contains wrappers over Netlink APIs related to Linux VETH interfaces or to Linux interfaces in general.
|
Package linuxcalls contains wrappers over Netlink APIs related to Linux VETH interfaces or to Linux interfaces in general. |
Package model defines the linuxplugin's northbound API.
|
Package model defines the linuxplugin's northbound API. |
interfaces
Package interfaces is a generated protocol buffer package.
|
Package interfaces is a generated protocol buffer package. |