descriptor

package
v2.0.2+incompatible Latest Latest
Warning

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

Go to latest
Published: Apr 19, 2019 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// DNAT44DescriptorName is the name of the descriptor for VPP NAT44
	// Destination-NAT configurations.
	DNAT44DescriptorName = "vpp-nat44-dnat"
)
View Source
const (
	// NAT44GlobalDescriptorName is the name of the descriptor for VPP NAT44 global
	// configuration.
	NAT44GlobalDescriptorName = "vpp-nat44-global"
)
View Source
const (
	// NAT44InterfaceDescriptorName is the name of the descriptor for VPP NAT44
	// features applied to interfaces.
	NAT44InterfaceDescriptorName = "vpp-nat44-interface"
)

Variables

View Source
var (
	// ErrNATInterfaceFeatureCollision is returned when VPP NAT features assigned
	// to a single interface collide.
	ErrNATInterfaceFeatureCollision = errors.New("VPP NAT interface feature collision")

	// ErrDuplicateNATAddress is returned when VPP NAT address pool contains duplicate
	// IP addresses.
	ErrDuplicateNATAddress = errors.New("Duplicate VPP NAT address")

	// ErrInvalidNATAddress is returned when IP address from VPP NAT address pool
	// cannot be parsed.
	ErrInvalidNATAddress = errors.New("Invalid VPP NAT address")
)

A list of non-retriable errors:

View Source
var (
	// ErrDNAT44WithEmptyLabel is returned when NAT44 DNAT configuration is defined
	// with empty label
	ErrDNAT44WithEmptyLabel = errors.New("NAT44 DNAT configuration defined with empty label")
)

A list of non-retriable errors:

Functions

This section is empty.

Types

type DNAT44Descriptor

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

DNAT44Descriptor teaches KVScheduler how to configure Destination NAT44 in VPP.

func NewDNAT44Descriptor

func NewDNAT44Descriptor(natHandler vppcalls.NatVppAPI, log logging.PluginLogger) *DNAT44Descriptor

NewDNAT44Descriptor creates a new instance of the DNAT44 descriptor.

func (*DNAT44Descriptor) Create

func (d *DNAT44Descriptor) Create(key string, dnat *nat.DNat44) (metadata interface{}, err error)

Create adds new destination-NAT44 configuration.

func (*DNAT44Descriptor) Delete

func (d *DNAT44Descriptor) Delete(key string, dnat *nat.DNat44, metadata interface{}) error

Delete removes existing destination-NAT44 configuration.

func (*DNAT44Descriptor) Dependencies

func (d *DNAT44Descriptor) Dependencies(key string, dnat *nat.DNat44) (dependencies []kvs.Dependency)

Dependencies lists external interfaces from mappings as dependencies.

func (*DNAT44Descriptor) EquivalentDNAT44

func (d *DNAT44Descriptor) EquivalentDNAT44(key string, oldDNAT, newDNAT *nat.DNat44) bool

EquivalentDNAT44 compares two instances of DNAT44 for equality.

func (*DNAT44Descriptor) GetDescriptor

func (d *DNAT44Descriptor) GetDescriptor() *adapter.DNAT44Descriptor

GetDescriptor returns descriptor suitable for registration (via adapter) with the KVScheduler.

func (*DNAT44Descriptor) IsRetriableFailure

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

IsRetriableFailure returns <false> for errors related to invalid configuration.

func (*DNAT44Descriptor) Retrieve

func (d *DNAT44Descriptor) Retrieve(correlate []adapter.DNAT44KVWithMetadata) (
	retrieved []adapter.DNAT44KVWithMetadata, err error,
)

Retrieve returns the current NAT44 global configuration.

func (*DNAT44Descriptor) Update

func (d *DNAT44Descriptor) Update(key string, oldDNAT, newDNAT *nat.DNat44, oldMetadata interface{}) (newMetadata interface{}, err error)

Update updates destination-NAT44 configuration.

func (*DNAT44Descriptor) Validate

func (d *DNAT44Descriptor) Validate(key string, dnat *nat.DNat44) error

Validate validates VPP destination-NAT44 configuration.

type NAT44GlobalDescriptor

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

NAT44GlobalDescriptor teaches KVScheduler how to configure global options for VPP NAT44.

func NewNAT44GlobalDescriptor

func NewNAT44GlobalDescriptor(natHandler vppcalls.NatVppAPI, log logging.PluginLogger) *NAT44GlobalDescriptor

NewNAT44GlobalDescriptor creates a new instance of the NAT44Global descriptor.

func (*NAT44GlobalDescriptor) Create

func (d *NAT44GlobalDescriptor) Create(key string, globalCfg *nat.Nat44Global) (metadata interface{}, err error)

Create applies NAT44 global options.

func (*NAT44GlobalDescriptor) Delete

func (d *NAT44GlobalDescriptor) Delete(key string, globalCfg *nat.Nat44Global, metadata interface{}) error

Delete sets NAT44 global options back to the defaults.

func (*NAT44GlobalDescriptor) DerivedValues

func (d *NAT44GlobalDescriptor) DerivedValues(key string, globalCfg *nat.Nat44Global) (derValues []kvs.KeyValuePair)

DerivedValues derives nat.NatInterface for every interface with assigned NAT configuration.

func (*NAT44GlobalDescriptor) EquivalentNAT44Global

func (d *NAT44GlobalDescriptor) EquivalentNAT44Global(key string, oldGlobalCfg, newGlobalCfg *nat.Nat44Global) bool

EquivalentNAT44Global compares two NAT44 global configs for equality.

func (*NAT44GlobalDescriptor) GetDescriptor

GetDescriptor returns descriptor suitable for registration (via adapter) with the KVScheduler.

func (*NAT44GlobalDescriptor) Retrieve

Retrieve returns the current NAT44 global configuration.

func (*NAT44GlobalDescriptor) Update

func (d *NAT44GlobalDescriptor) Update(key string, oldGlobalCfg, newGlobalCfg *nat.Nat44Global, oldMetadata interface{}) (newMetadata interface{}, err error)

Update updates NAT44 global options.

func (*NAT44GlobalDescriptor) Validate

func (d *NAT44GlobalDescriptor) Validate(key string, globalCfg *nat.Nat44Global) error

Validate validates VPP NAT44 global configuration.

type NAT44InterfaceDescriptor

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

NAT44InterfaceDescriptor teaches KVScheduler how to configure VPP NAT interface features.

func NewNAT44InterfaceDescriptor

func NewNAT44InterfaceDescriptor(natHandler vppcalls.NatVppAPI, log logging.PluginLogger) *NAT44InterfaceDescriptor

NewNAT44InterfaceDescriptor creates a new instance of the NAT44Interface descriptor.

func (*NAT44InterfaceDescriptor) Create

func (d *NAT44InterfaceDescriptor) Create(key string, natIface *nat.Nat44Global_Interface) (metadata interface{}, err error)

Create enables NAT44 for an interface.

func (*NAT44InterfaceDescriptor) Delete

func (d *NAT44InterfaceDescriptor) Delete(key string, natIface *nat.Nat44Global_Interface, metadata interface{}) error

Delete disables NAT44 for an interface.

func (*NAT44InterfaceDescriptor) Dependencies

func (d *NAT44InterfaceDescriptor) Dependencies(key string, natIface *nat.Nat44Global_Interface) []kvs.Dependency

Dependencies lists the interface as the only dependency.

func (*NAT44InterfaceDescriptor) GetDescriptor

GetDescriptor returns descriptor suitable for registration (via adapter) with the KVScheduler.

func (*NAT44InterfaceDescriptor) IsNAT44InterfaceKey

func (d *NAT44InterfaceDescriptor) IsNAT44InterfaceKey(key string) bool

IsNAT44InterfaceKey returns true if the key is identifying NAT-44 configuration for interface.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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