Documentation ¶
Index ¶
- type LinuxDataPair
- type LinuxInterfaceConfig
- type LinuxInterfaceConfigurator
- func (plugin *LinuxInterfaceConfigurator) Close() error
- func (plugin *LinuxInterfaceConfigurator) ConfigureLinuxInterface(linuxIf *interfaces.LinuxInterfaces_Interface) error
- func (plugin *LinuxInterfaceConfigurator) DeleteLinuxInterface(linuxIf *interfaces.LinuxInterfaces_Interface) error
- func (plugin *LinuxInterfaceConfigurator) GetCachedLinuxIfIndexes() ifaceidx.LinuxIfIndex
- func (plugin *LinuxInterfaceConfigurator) GetInterfaceByMsCache() map[string][]*LinuxInterfaceConfig
- func (plugin *LinuxInterfaceConfigurator) GetInterfaceByNameCache() map[string]*LinuxInterfaceConfig
- func (plugin *LinuxInterfaceConfigurator) GetLinuxInterfaceIndexes() ifaceidx.LinuxIfIndex
- func (plugin *LinuxInterfaceConfigurator) Init(logging logging.PluginLogger, ifHandler linuxcalls.NetlinkAPI, ...) (err error)
- func (plugin *LinuxInterfaceConfigurator) ModifyLinuxInterface(newLinuxIf, oldLinuxIf *interfaces.LinuxInterfaces_Interface) (err error)
- func (plugin *LinuxInterfaceConfigurator) ResolveCreatedVPPInterface(ifConfigMetaData *vppIf.Interfaces_Interface) error
- func (plugin *LinuxInterfaceConfigurator) ResolveDeletedVPPInterface(ifConfigMetaData *vppIf.Interfaces_Interface) error
- func (plugin *LinuxInterfaceConfigurator) Resync(nbIfs []*interfaces.LinuxInterfaces_Interface) (errs []error)
- type LinuxInterfaceStateNotification
- type LinuxInterfaceStateUpdater
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type LinuxDataPair ¶
type LinuxDataPair struct {
// contains filtered or unexported fields
}
LinuxDataPair stores linux interface with matching NB configuration
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 does nothing for linux interface configurator. State and notification channels are closed in linux plugin.
func (*LinuxInterfaceConfigurator) ConfigureLinuxInterface ¶
func (plugin *LinuxInterfaceConfigurator) ConfigureLinuxInterface(linuxIf *interfaces.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(linuxIf *interfaces.LinuxInterfaces_Interface) error
DeleteLinuxInterface reacts to a removed NB configuration of a Linux interface.
func (*LinuxInterfaceConfigurator) GetCachedLinuxIfIndexes ¶
func (plugin *LinuxInterfaceConfigurator) GetCachedLinuxIfIndexes() ifaceidx.LinuxIfIndex
GetCachedLinuxIfIndexes gives access to mapping of not configurated interface indexes.
func (*LinuxInterfaceConfigurator) GetInterfaceByMsCache ¶
func (plugin *LinuxInterfaceConfigurator) GetInterfaceByMsCache() map[string][]*LinuxInterfaceConfig
GetInterfaceByMsCache returns cache of microservice <-> interface list
func (*LinuxInterfaceConfigurator) GetInterfaceByNameCache ¶
func (plugin *LinuxInterfaceConfigurator) GetInterfaceByNameCache() map[string]*LinuxInterfaceConfig
GetInterfaceByNameCache returns cache of interface <-> config entries
func (*LinuxInterfaceConfigurator) GetLinuxInterfaceIndexes ¶
func (plugin *LinuxInterfaceConfigurator) GetLinuxInterfaceIndexes() ifaceidx.LinuxIfIndex
GetLinuxInterfaceIndexes returns in-memory mapping of linux inerfaces
func (*LinuxInterfaceConfigurator) Init ¶
func (plugin *LinuxInterfaceConfigurator) Init(logging logging.PluginLogger, ifHandler linuxcalls.NetlinkAPI, nsHandler nsplugin.NamespaceAPI, ifIndexes ifaceidx.LinuxIfIndexRW, ifNotif chan *nsplugin.MicroserviceEvent, stopwatch *measure.Stopwatch) (err error)
Init linux plugin and start go routines.
func (*LinuxInterfaceConfigurator) ModifyLinuxInterface ¶
func (plugin *LinuxInterfaceConfigurator) ModifyLinuxInterface(newLinuxIf, oldLinuxIf *interfaces.LinuxInterfaces_Interface) (err error)
ModifyLinuxInterface applies changes in the NB configuration of a Linux interface into the host network stack through Netlink API.
func (*LinuxInterfaceConfigurator) ResolveCreatedVPPInterface ¶
func (plugin *LinuxInterfaceConfigurator) ResolveCreatedVPPInterface(ifConfigMetaData *vppIf.Interfaces_Interface) error
ResolveCreatedInterface resolves a new vpp interfaces
func (*LinuxInterfaceConfigurator) ResolveDeletedVPPInterface ¶
func (plugin *LinuxInterfaceConfigurator) ResolveDeletedVPPInterface(ifConfigMetaData *vppIf.Interfaces_Interface) error
ResolveDeletedInterface resolves removed vpp interfaces
func (*LinuxInterfaceConfigurator) Resync ¶
func (plugin *LinuxInterfaceConfigurator) Resync(nbIfs []*interfaces.LinuxInterfaces_Interface) (errs []error)
Resync writes interfaces to Linux. Interface host name corresponds with Linux host interface name (but name can be different). Resync consists of following steps: 1. Iterate over all NB interfaces. Try to find interface with the same name in required namespace for every NB interface. 2. If interface does not exist, will be created anew 3. If interface exists, it is correlated and modified if needed. Resync configures an initial set of interfaces. Existing Linux interfaces are registered and potentially re-configured.
type LinuxInterfaceStateNotification ¶
type LinuxInterfaceStateNotification struct {
// contains filtered or unexported fields
}
LinuxInterfaceStateNotification aggregates operational status derived from netlink with the details (state) about the interface.
type LinuxInterfaceStateUpdater ¶
type LinuxInterfaceStateUpdater struct {
// contains filtered or unexported fields
}
LinuxInterfaceStateUpdater processes all linux interface state data
func (*LinuxInterfaceStateUpdater) Close ¶
func (plugin *LinuxInterfaceStateUpdater) Close() error
Close watcher channel (state chan is closed in LinuxInterfaceConfigurator)
func (*LinuxInterfaceStateUpdater) Init ¶
func (plugin *LinuxInterfaceStateUpdater) Init(logger logging.PluginLogger, ctx context.Context, ifIndexes ifaceidx.LinuxIfIndexRW, stateChan chan *LinuxInterfaceStateNotification) error
Init channels for interface state watcher, start it in separate go routine and subscribe to default namespace
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 Linux interfaces in general.
|
Package linuxcalls contains wrappers over Netlink APIs related to Linux VETH interfaces or Linux interfaces in general. |