Documentation ¶
Index ¶
- Constants
- Variables
- type DNAT44Descriptor
- func (d *DNAT44Descriptor) Create(key string, dnat *nat.DNat44) (metadata interface{}, err error)
- func (d *DNAT44Descriptor) Delete(key string, dnat *nat.DNat44, metadata interface{}) error
- func (d *DNAT44Descriptor) Dependencies(key string, dnat *nat.DNat44) (dependencies []kvs.Dependency)
- func (d *DNAT44Descriptor) EquivalentDNAT44(key string, oldDNAT, newDNAT *nat.DNat44) bool
- func (d *DNAT44Descriptor) GetDescriptor() *adapter.DNAT44Descriptor
- func (d *DNAT44Descriptor) IsRetriableFailure(err error) bool
- func (d *DNAT44Descriptor) Retrieve(correlate []adapter.DNAT44KVWithMetadata) (retrieved []adapter.DNAT44KVWithMetadata, err error)
- func (d *DNAT44Descriptor) Update(key string, oldDNAT, newDNAT *nat.DNat44, oldMetadata interface{}) (newMetadata interface{}, err error)
- func (d *DNAT44Descriptor) Validate(key string, dnat *nat.DNat44) error
- type NAT44GlobalDescriptor
- func (d *NAT44GlobalDescriptor) Create(key string, globalCfg *nat.Nat44Global) (metadata interface{}, err error)
- func (d *NAT44GlobalDescriptor) Delete(key string, globalCfg *nat.Nat44Global, metadata interface{}) error
- func (d *NAT44GlobalDescriptor) DerivedValues(key string, globalCfg *nat.Nat44Global) (derValues []kvs.KeyValuePair)
- func (d *NAT44GlobalDescriptor) EquivalentNAT44Global(key string, oldGlobalCfg, newGlobalCfg *nat.Nat44Global) bool
- func (d *NAT44GlobalDescriptor) GetDescriptor() *adapter.NAT44GlobalDescriptor
- func (d *NAT44GlobalDescriptor) Retrieve(correlate []adapter.NAT44GlobalKVWithMetadata) ([]adapter.NAT44GlobalKVWithMetadata, error)
- func (d *NAT44GlobalDescriptor) Update(key string, oldGlobalCfg, newGlobalCfg *nat.Nat44Global, ...) (newMetadata interface{}, err error)
- func (d *NAT44GlobalDescriptor) Validate(key string, globalCfg *nat.Nat44Global) error
- type NAT44InterfaceDescriptor
- func (d *NAT44InterfaceDescriptor) Create(key string, natIface *nat.Nat44Global_Interface) (metadata interface{}, err error)
- func (d *NAT44InterfaceDescriptor) Delete(key string, natIface *nat.Nat44Global_Interface, metadata interface{}) error
- func (d *NAT44InterfaceDescriptor) Dependencies(key string, natIface *nat.Nat44Global_Interface) []kvs.Dependency
- func (d *NAT44InterfaceDescriptor) GetDescriptor() *adapter.NAT44InterfaceDescriptor
- func (d *NAT44InterfaceDescriptor) IsNAT44InterfaceKey(key string) bool
Constants ¶
const ( // DNAT44DescriptorName is the name of the descriptor for VPP NAT44 // Destination-NAT configurations. DNAT44DescriptorName = "vpp-nat44-dnat" )
const ( // NAT44GlobalDescriptorName is the name of the descriptor for VPP NAT44 global // configuration. NAT44GlobalDescriptorName = "vpp-nat44-global" )
const ( // NAT44InterfaceDescriptorName is the name of the descriptor for VPP NAT44 // features applied to interfaces. NAT44InterfaceDescriptorName = "vpp-nat44-interface" )
Variables ¶
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:
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.
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 ¶
func (d *NAT44GlobalDescriptor) GetDescriptor() *adapter.NAT44GlobalDescriptor
GetDescriptor returns descriptor suitable for registration (via adapter) with the KVScheduler.
func (*NAT44GlobalDescriptor) Retrieve ¶
func (d *NAT44GlobalDescriptor) Retrieve(correlate []adapter.NAT44GlobalKVWithMetadata) ([]adapter.NAT44GlobalKVWithMetadata, error)
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 ¶
func (d *NAT44InterfaceDescriptor) GetDescriptor() *adapter.NAT44InterfaceDescriptor
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.