puntplugin

package
v1.9.0-alpha Latest Latest
Warning

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

Go to latest
Published: Dec 12, 2018 License: Apache-2.0 Imports: 9 Imported by: 0

README

Punt plugin

The punt plugin is a core VPP-Agent Plugin that is designed to register punt configuration entries allowing to punt packets to host via unix domain socket. Configuration managed by this plugin is modelled by the proto file. The configuration has to be stored in etcd using the following key:

/vnf-agent/<agent-label>/vpp/config/v1/punt/<name>

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

Note: the punt socket path needs to be defined in the VPP startup config. The VPP currently supports only one unix domain socket path. Example of startup config entry:

punt {
  socket /tmp/socket/punt
}

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 punt-socket-register.json.json file.

vpp-agent-ctl -put "/vnf-agent/vpp1/vpp/config/v1/punt/punt1" json/punt-socket-register.json

The vpp-agent-ctl also contains a simple predefined punt config, suitable for testing purposes. To register punt socket, run:

vpp-agent-ctl -puntr

To deregister it:

vpp-agent-ctl -puntd

Note: registered entries currently cannot be dumped or shown via VPP CLI (Missing support in VPP).

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type PuntConfigurator

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

PuntConfigurator registers/de-registers punt to host via unix domain socket. Registered items are stored in the cache.

func (*PuntConfigurator) Add

func (c *PuntConfigurator) Add(puntVal *punt.Punt) error

Add configures new punt to host via socket and stores it in the local mapping. Depending on L3 protocol setup, IPv4, IPv6 or both punts are registered

func (*PuntConfigurator) Close

func (c *PuntConfigurator) Close() error

Close VPP channel

func (*PuntConfigurator) Delete

func (c *PuntConfigurator) Delete(puntVal *punt.Punt) error

Delete the configuration of a punt

func (*PuntConfigurator) GetPuntIndexes

func (c *PuntConfigurator) GetPuntIndexes() puntidx.PuntIndexRW

GetPuntIndexes exposes punt name-to-index mapping

func (*PuntConfigurator) Init

func (c *PuntConfigurator) Init(logger logging.PluginLogger, goVppMux govppmux.API) (err error)

Init logger, VPP channel, VPP API handler and cache

func (*PuntConfigurator) LogError

func (c *PuntConfigurator) 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 (*PuntConfigurator) Modify

func (c *PuntConfigurator) Modify(oldPunt, newPunt *punt.Punt) error

Modify removes old entry, configures a new one and updates metadata

func (*PuntConfigurator) Resync

func (c *PuntConfigurator) Resync(punts []*punt.Punt) error

Resync configures punt entries.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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