Documentation ¶
Index ¶
- Constants
- type LinuxDataPair
- type LinuxInterfaceConfig
- type LinuxInterfaceConfigurator
- func (c *LinuxInterfaceConfigurator) Close() error
- func (c *LinuxInterfaceConfigurator) ConfigureLinuxInterface(linuxIf *interfaces.LinuxInterfaces_Interface) error
- func (c *LinuxInterfaceConfigurator) DeleteLinuxInterface(linuxIf *interfaces.LinuxInterfaces_Interface) error
- func (c *LinuxInterfaceConfigurator) GetCachedLinuxIfIndexes() ifaceidx.LinuxIfIndex
- func (c *LinuxInterfaceConfigurator) GetInterfaceByMsCache() map[string][]*LinuxInterfaceConfig
- func (c *LinuxInterfaceConfigurator) GetInterfaceByNameCache() map[string]*LinuxInterfaceConfig
- func (c *LinuxInterfaceConfigurator) GetLinuxInterfaceIndexes() ifaceidx.LinuxIfIndex
- func (c *LinuxInterfaceConfigurator) Init(logging logging.PluginLogger, ifHandler linuxcalls.NetlinkAPI, ...) (err error)
- func (c *LinuxInterfaceConfigurator) LogError(err error) error
- func (c *LinuxInterfaceConfigurator) ModifyLinuxInterface(newLinuxIf, oldLinuxIf *interfaces.LinuxInterfaces_Interface) (err error)
- func (c *LinuxInterfaceConfigurator) ResolveCreatedVPPInterface(ifConfigMetaData *vppIf.Interfaces_Interface) error
- func (c *LinuxInterfaceConfigurator) ResolveDeletedVPPInterface(ifConfigMetaData *vppIf.Interfaces_Interface) error
- func (c *LinuxInterfaceConfigurator) Resync(nbIfs []*interfaces.LinuxInterfaces_Interface) error
- type LinuxInterfaceStateNotification
- type LinuxInterfaceStateUpdater
Constants ¶
const LinkNotFoundErr = "Link not found"
LinkNotFoundErr represents netlink error return value from 'GetLinkByName' if interface does not exist
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 (c *LinuxInterfaceConfigurator) Close() error
Close does nothing for linux interface configurator. State and notification channels are closed in linux plugin.
func (*LinuxInterfaceConfigurator) ConfigureLinuxInterface ¶
func (c *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 (c *LinuxInterfaceConfigurator) DeleteLinuxInterface(linuxIf *interfaces.LinuxInterfaces_Interface) error
DeleteLinuxInterface reacts to a removed NB configuration of a Linux interface.
func (*LinuxInterfaceConfigurator) GetCachedLinuxIfIndexes ¶
func (c *LinuxInterfaceConfigurator) GetCachedLinuxIfIndexes() ifaceidx.LinuxIfIndex
GetCachedLinuxIfIndexes gives access to mapping of not configured interface indexes.
func (*LinuxInterfaceConfigurator) GetInterfaceByMsCache ¶
func (c *LinuxInterfaceConfigurator) GetInterfaceByMsCache() map[string][]*LinuxInterfaceConfig
GetInterfaceByMsCache returns cache of microservice <-> interface list
func (*LinuxInterfaceConfigurator) GetInterfaceByNameCache ¶
func (c *LinuxInterfaceConfigurator) GetInterfaceByNameCache() map[string]*LinuxInterfaceConfig
GetInterfaceByNameCache returns cache of interface <-> config entries
func (*LinuxInterfaceConfigurator) GetLinuxInterfaceIndexes ¶
func (c *LinuxInterfaceConfigurator) GetLinuxInterfaceIndexes() ifaceidx.LinuxIfIndex
GetLinuxInterfaceIndexes returns in-memory mapping of linux inerfaces
func (*LinuxInterfaceConfigurator) Init ¶
func (c *LinuxInterfaceConfigurator) Init(logging logging.PluginLogger, ifHandler linuxcalls.NetlinkAPI, nsHandler nsplugin.NamespaceAPI, sysHandler nsplugin.SystemAPI, ifIndexes ifaceidx.LinuxIfIndexRW, ifMsNotif chan *nsplugin.MicroserviceEvent, ifNotif chan *LinuxInterfaceStateNotification) (err error)
Init linux plugin and start go routines.
func (*LinuxInterfaceConfigurator) LogError ¶ added in v1.8.1
func (c *LinuxInterfaceConfigurator) LogError(err error) error
LogError prints error if not nil, including stack trace. The same value is also returned, so it can be easily propagated further
func (*LinuxInterfaceConfigurator) ModifyLinuxInterface ¶
func (c *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 (c *LinuxInterfaceConfigurator) ResolveCreatedVPPInterface(ifConfigMetaData *vppIf.Interfaces_Interface) error
ResolveCreatedVPPInterface resolves a new vpp interfaces
func (*LinuxInterfaceConfigurator) ResolveDeletedVPPInterface ¶
func (c *LinuxInterfaceConfigurator) ResolveDeletedVPPInterface(ifConfigMetaData *vppIf.Interfaces_Interface) error
ResolveDeletedVPPInterface resolves removed vpp interfaces
func (*LinuxInterfaceConfigurator) Resync ¶
func (c *LinuxInterfaceConfigurator) Resync(nbIfs []*interfaces.LinuxInterfaces_Interface) 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.
func NewLinuxInterfaceStateNotification ¶ added in v1.8.1
func NewLinuxInterfaceStateNotification(ifType string, ifState netlink.LinkOperState, attrs *netlink.LinkAttrs) *LinuxInterfaceStateNotification
NewLinuxInterfaceStateNotification builds up new linux interface notification object
type LinuxInterfaceStateUpdater ¶
type LinuxInterfaceStateUpdater struct {
// contains filtered or unexported fields
}
LinuxInterfaceStateUpdater processes all linux interface state data
func (*LinuxInterfaceStateUpdater) Close ¶
func (c *LinuxInterfaceStateUpdater) Close() error
Close watcher channel (state chan is closed in LinuxInterfaceConfigurator)
func (*LinuxInterfaceStateUpdater) Init ¶
func (c *LinuxInterfaceStateUpdater) Init(ctx context.Context, logger logging.PluginLogger, ifIndexes ifaceidx.LinuxIfIndexRW, stateChan chan *LinuxInterfaceStateNotification) error
Init channels for interface state watcher, start it in separate go routine and subscribe to default namespace
func (*LinuxInterfaceStateUpdater) LogError ¶ added in v1.8.1
func (c *LinuxInterfaceStateUpdater) LogError(err error) error
LogError prints error if not nil, including stack trace. The same value is also returned, so it can be easily propagated further
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. |