l4plugin

package
v1.5.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 20, 2018 License: Apache-2.0 Imports: 11 Imported by: 0

README

L4 plugin

The l4plugin is a Core Agent Plugin that is designed to configure VPP application namespaces. Configuration managed by this plugin is modelled by the proto file. The configuration must be stored in etcd using the following key:

/vnf-agent/<agent-label>/vpp/config/v1/l4/namespaces/<namespaceID>

/vnf-agent/<agent-label>/vpp/config/v1/l4/features/feature

An example of configuration in json format can be found here.

Note: the l4 features need to be enabled on the VPP. To do so, use second json configuration file which can be found here here

To insert config into etcd in json format vpp-agent-ctl can be used. We assume that we want to configure vpp with label vpp1 and config is stored in the app-ns.json file. At first, enable L4 features, then configure the application namespace.

vpp-agent-ctl -put "/vnf-agent/vpp1/vpp/config/v1/l4/features/feature" json/enable-l4.json
vpp-agent-ctl -put "/vnf-agent/vpp1/vpp/config/v1/l4/namespaces/ns1" json/app-ns.json

The vpp-agent-ctl contains a simple predefined application namespace config also. It can be used for testing purposes. To enable l4 features, run:

vpp-agent-ctl -el4

To disable it:

vpp-agent-ctl -dl4

To configure application namespace:

vpp-agent-ctl -appns

Note: application namespaces cannot be removed. Currently it is not supported by the VPP.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AppNsConfigurator

type AppNsConfigurator struct {
	// contains filtered or unexported fields
}

AppNsConfigurator 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/l4/l4.proto" and stored in ETCD under the keys "/vnf-agent/{vnf-agent}/vpp/config/v1/l4/l4ftEnabled" and "/vnf-agent/{vnf-agent}/vpp/config/v1/l4/namespaces/{namespace_id}". Updates received from the northbound API are compared with the VPP run-time configuration and differences are applied through the VPP binary API.

func (*AppNsConfigurator) Close

func (plugin *AppNsConfigurator) Close() error

Close members, channels

func (*AppNsConfigurator) ConfigureAppNamespace

func (plugin *AppNsConfigurator) ConfigureAppNamespace(ns *l4.AppNamespaces_AppNamespace) error

ConfigureAppNamespace process the NB AppNamespace config and propagates it to bin api calls

func (*AppNsConfigurator) ConfigureL4FeatureFlag

func (plugin *AppNsConfigurator) ConfigureL4FeatureFlag(features *l4.L4Features) error

ConfigureL4FeatureFlag process the NB Features config and propagates it to bin api calls

func (*AppNsConfigurator) DeleteAppNamespace

func (plugin *AppNsConfigurator) DeleteAppNamespace(ns *l4.AppNamespaces_AppNamespace) error

DeleteAppNamespace process the NB AppNamespace config and propagates it to bin api calls. This case is not currently supported by VPP

func (*AppNsConfigurator) DeleteL4FeatureFlag

func (plugin *AppNsConfigurator) DeleteL4FeatureFlag() error

DeleteL4FeatureFlag process the NB Features config and propagates it to bin api calls

func (*AppNsConfigurator) GetAppNsIndexes

func (plugin *AppNsConfigurator) GetAppNsIndexes() nsidx.AppNsIndexRW

GetAppNsIndexes returns application namespace memory indexes

func (*AppNsConfigurator) Init

func (plugin *AppNsConfigurator) Init(logger logging.PluginLogger, goVppMux govppmux.API, swIfIndexes ifaceidx.SwIfIndex,
	enableStopwatch bool) (err error)

Init members (channels...) and start go routines

func (*AppNsConfigurator) ModifyAppNamespace

func (plugin *AppNsConfigurator) ModifyAppNamespace(newNs *l4.AppNamespaces_AppNamespace, oldNs *l4.AppNamespaces_AppNamespace) error

ModifyAppNamespace process the NB AppNamespace config and propagates it to bin api calls

func (*AppNsConfigurator) ResolveCreatedInterface

func (plugin *AppNsConfigurator) ResolveCreatedInterface(interfaceName string, interfaceIndex uint32) error

ResolveCreatedInterface looks for application namespace this interface is assigned to and configures them

func (*AppNsConfigurator) ResolveDeletedInterface

func (plugin *AppNsConfigurator) ResolveDeletedInterface(interfaceName string, interfaceIndex uint32) error

ResolveDeletedInterface looks for application namespace this interface is assigned to and removes

func (*AppNsConfigurator) ResyncAppNs

func (plugin *AppNsConfigurator) ResyncAppNs(appNamespaces []*l4.AppNamespaces_AppNamespace) error

ResyncAppNs configures app namespaces to the empty VPP

func (*AppNsConfigurator) ResyncFeatures

func (plugin *AppNsConfigurator) ResyncFeatures(l4Features *l4.L4Features) error

ResyncFeatures sets initital L4Features flag

Directories

Path Synopsis
Package nsidx implements name-to-index mapping registry and cache for app namespaces
Package nsidx implements name-to-index mapping registry and cache for app namespaces

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL