descriptor

package
v3.5.0-alpha Latest Latest
Warning

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

Go to latest
Published: Jul 18, 2022 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// FPFeatureDescriptorName is the name of the descriptor for
	// VPP Flowprobe Feature configuration.
	FPFeatureDescriptorName = "vpp-flowprobe-feature"
)
View Source
const (
	// FPParamsDescriptorName is the name of the descriptor for
	// VPP Flowprobe Params configuration.
	FPParamsDescriptorName = "vpp-flowprobe-params"
)
View Source
const (
	// IPFIXDescriptorName is the name of the descriptor for
	// VPP IP Flow Information eXport (IPFIX) configuration.
	IPFIXDescriptorName = "vpp-ipfix"
)

Variables

View Source
var (

	// ErrAllRecordFieldsDisabled returned when all record fields are set to false.
	ErrAllRecordFieldsDisabled = errors.New("at least one of record fields (l2, l3, l4) must be set")

	// ErrFeatureEnabled informs the reason why Flowprobe Params can not be changed.
	ErrFeatureEnabled = errors.New("can not change Flowprobe Params when Flowprobe Feature enabled on some interface")
)
View Source
var (
	// ErrColAddrNotDefined returned when collector address in confiugration is empty string.
	ErrColAddrNotDefined = errors.New("address of a collector was not provided")
	// ErrSrcAddrNotDefined returned when source address in confiugration is empty string.
	ErrSrcAddrNotDefined = errors.New("address of a source was not provided")
	// ErrTooBigMTU informs about the maximum value for Path MTU.
	ErrTooBigMTU = errors.New("too big value, maximum is 1450")
	// ErrTooSmlMTU informs about the minimum value for Path MTU.
	ErrTooSmlMTU = errors.New("too small value, minimum is 68")
)

Validation errors:

View Source
var (
	// ErrIfaceNotDefined returned when interface in confiugration is empty string.
	ErrIfaceNotDefined = errors.New("missing interface name for Flowprobe Feature")
)

Validation errors:

Functions

func NewFPFeatureDescriptor

func NewFPFeatureDescriptor(ipfixHandler vppcalls.IpfixVppAPI, log logging.PluginLogger) *kvs.KVDescriptor

NewFPFeatureDescriptor creates a new instance of FPFeatureDescriptor.

func NewFPParamsDescriptor

func NewFPParamsDescriptor(ipfixHandler vppcalls.IpfixVppAPI, featureMap idxmap.NamedMapping, log logging.PluginLogger) *kvs.KVDescriptor

NewFPParamsDescriptor creates a new instance of FPParamsDescriptor.

func NewIPFIXDescriptor

func NewIPFIXDescriptor(ipfixHandler vppcalls.IpfixVppAPI, log logging.PluginLogger) *kvs.KVDescriptor

NewIPFIXDescriptor creates a new instance of IPFIXDescriptor.

Types

type FPFeatureDescriptor

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

FPFeatureDescriptor configures Flowprobe Feature for VPP.

func (*FPFeatureDescriptor) Create

func (d *FPFeatureDescriptor) Create(key string, val *ipfix.FlowProbeFeature) (metadata interface{}, err error)

Create uses vppcalls to pass Flowprobe Feature configuration for interface to VPP.

func (*FPFeatureDescriptor) Delete

func (d *FPFeatureDescriptor) Delete(key string, val *ipfix.FlowProbeFeature, metadata interface{}) (err error)

Delete uses vppcalls to remove Flowprobe Feature configuration for interface.

func (*FPFeatureDescriptor) Dependencies

func (d *FPFeatureDescriptor) Dependencies(key string, val *ipfix.FlowProbeFeature) []kvs.Dependency

Dependencies sets Flowprobe Params as a dependency which must be created before enabling Flowprobe Feature on an interface.

func (*FPFeatureDescriptor) Retrieve

Retrieve hopes that configuration in correlate is actual configuration in VPP. As soon as VPP devs will add dump API calls, this methods should be fixed. TODO: waiting for https://jira.fd.io/browse/VPP-1861.

Also, this method sets metadata, so descriptor for Flowprobe Params would know that there are some interfaces with Flowprobe Feature enabled.

func (*FPFeatureDescriptor) Validate

func (d *FPFeatureDescriptor) Validate(key string, value *ipfix.FlowProbeFeature) error

Validate checks if Flowprobe Feature configuration is good to send to VPP.

type FPParamsDescriptor

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

FPParamsDescriptor configures Flowprobe Params for VPP.

func (*FPParamsDescriptor) Create

func (d *FPParamsDescriptor) Create(key string, val *ipfix.FlowProbeParams) (metadata interface{}, err error)

Create passes Flowprobe Params to Update method.

func (*FPParamsDescriptor) Delete

func (d *FPParamsDescriptor) Delete(key string, val *ipfix.FlowProbeParams, metadata interface{}) (err error)

Delete does nothing.

Since all Flowprobe Features are dependent on Flowprobe Params, calling this method will also disable (move to "pending" state) all Flowprobe Features on interfaces.

All the work will be done by KVScheduler :)

func (*FPParamsDescriptor) IsRetriableFailure

func (d *FPParamsDescriptor) IsRetriableFailure(err error) bool

IsRetriableFailure returns false if error is one of errors defined at the top of this file as non-retriable.

func (*FPParamsDescriptor) Retrieve

Retrieve hopes that configuration in correlate is actual configuration in VPP. As soon as VPP devs will add dump API calls, this methods should be fixed.

func (*FPParamsDescriptor) Update

func (d *FPParamsDescriptor) Update(key string, oldVal, newVal *ipfix.FlowProbeParams, oldMetadata interface{}) (newMetadata interface{}, err error)

Update uses vppcalls to pass Flowprobe Params to VPP.

func (*FPParamsDescriptor) Validate

func (d *FPParamsDescriptor) Validate(key string, value *ipfix.FlowProbeParams) error

Validate checks if Flowprobe Params are good to send to VPP.

type IPFIXDescriptor

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

IPFIXDescriptor configures IPFIX for VPP.

func (*IPFIXDescriptor) Create

func (d *IPFIXDescriptor) Create(key string, val *ipfix.IPFIX) (metadata interface{}, err error)

Create calls Update method, because IPFIX configuration is always there and can not be created.

func (*IPFIXDescriptor) Delete

func (d *IPFIXDescriptor) Delete(key string, val *ipfix.IPFIX, metadata interface{}) (err error)

Delete does nothing, because there are neither ability nor reasons to delete VPP IPFIX configuration. You can only configure exporting in a way you want to.

func (*IPFIXDescriptor) EquivalentIPFIX

func (d *IPFIXDescriptor) EquivalentIPFIX(key string, oldValue, newValue *ipfix.IPFIX) bool

EquivalentIPFIX returns true if two IPFIX configurations are equal.

func (*IPFIXDescriptor) Retrieve

func (d *IPFIXDescriptor) Retrieve(correlate []adapter.IPFIXKVWithMetadata) (retrieved []adapter.IPFIXKVWithMetadata, err error)

Retrieve returns configuration of IP Flow Infromation eXporter.

func (*IPFIXDescriptor) Update

func (d *IPFIXDescriptor) Update(key string, oldVal, newVal *ipfix.IPFIX, oldMetadata interface{}) (newMetadata interface{}, err error)

Update sets VPP IPFIX configuration.

func (*IPFIXDescriptor) Validate

func (d *IPFIXDescriptor) Validate(key string, value *ipfix.IPFIX) error

Validate does basic check of VPP IPFIX configuration.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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