descriptor

package
v2.4.0-alpha+incompatible Latest Latest
Warning

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

Go to latest
Published: Oct 7, 2019 License: Apache-2.0 Imports: 15 Imported by: 9

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 (
	// NAT44AddressDescriptorName is the name of the descriptor for IP addresses
	// from the VPP NAT44 address pool.
	NAT44AddressDescriptorName = "vpp-nat44-address"
)
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")
)

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:

View Source
var (
	// 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:

Functions

func NewDNAT44Descriptor

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

NewDNAT44Descriptor creates a new instance of the DNAT44 descriptor.

func NewNAT44AddressDescriptor

func NewNAT44AddressDescriptor(natHandler vppcalls.NatVppAPI, log logging.PluginLogger) *kvs.KVDescriptor

NewNAT44AddressDescriptor creates a new instance of the NAT44Address descriptor.

func NewNAT44GlobalDescriptor

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

NewNAT44GlobalDescriptor creates a new instance of the NAT44Global descriptor.

func NewNAT44InterfaceDescriptor

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

NewNAT44InterfaceDescriptor creates a new instance of the NAT44Interface descriptor.

Types

type DNAT44Descriptor

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

DNAT44Descriptor teaches KVScheduler how to configure Destination NAT44 in VPP.

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 and non-zero VRFs 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) 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 NAT44AddressDescriptor

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

NAT44AddressDescriptor teaches KVScheduler how to add/remove IP addresses to/from the VPP NAT44 address pool.

func (*NAT44AddressDescriptor) Create

func (d *NAT44AddressDescriptor) Create(key string, natAddr *nat.Nat44Global_Address) (metadata interface{}, err error)

Create adds IP address into the NAT44 address pool.

func (*NAT44AddressDescriptor) Delete

func (d *NAT44AddressDescriptor) Delete(key string, natAddr *nat.Nat44Global_Address, metadata interface{}) error

Delete removes IP address from the NAT44 address pool.

func (*NAT44AddressDescriptor) Dependencies

func (d *NAT44AddressDescriptor) Dependencies(key string, natAddr *nat.Nat44Global_Address) []kvs.Dependency

Dependencies lists non-zero VRF as the only dependency.

func (*NAT44AddressDescriptor) IsNat44AddressKey

func (d *NAT44AddressDescriptor) IsNat44AddressKey(key string) bool

IsNat44AddressKey returns true if the key is identifying configuration for a single address from the NAT44 address pool.

func (*NAT44AddressDescriptor) Validate

func (d *NAT44AddressDescriptor) Validate(key string, natAddr *nat.Nat44Global_Address) error

Validates validate configuration for NAT44 address.

type NAT44GlobalDescriptor

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

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

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.NatAddress for every IP address to be added into the NAT address pool,
  • 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) 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 (*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) 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