descriptor

package
v3.2.0 Latest Latest
Warning

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

Go to latest
Published: Nov 4, 2020 License: Apache-2.0 Imports: 24 Imported by: 2

Documentation

Index

Constants

View Source
const (
	// ArpDescriptorName is the name of the descriptor.
	ArpDescriptorName = "vpp-arp"
)
View Source
const (
	// ProxyArpInterfaceDescriptorName is the name of the descriptor.
	DHCPProxyDescriptorName = "dhcp-proxy"
)
View Source
const (
	// IPScanNeighborDescriptorName is the name of the descriptor.
	IPScanNeighborDescriptorName = "vpp-ip-scan-neighbor"
)
View Source
const (
	// L3XCDescriptorName is the name of the descriptor.
	L3XCDescriptorName = "vpp-l3xc"
)
View Source
const (
	// ProxyArpDescriptorName is the name of the descriptor.
	ProxyArpDescriptorName = "vpp-proxy-arp"
)
View Source
const (
	// ProxyArpInterfaceDescriptorName is the name of the descriptor.
	ProxyArpInterfaceDescriptorName = "vpp-proxy-arp-interface"
)
View Source
const (
	// RouteDescriptorName is the name of the descriptor for static routes.
	RouteDescriptorName = "vpp-route"
)
View Source
const (
	// TeibDescriptorName is the name of the descriptor.
	TeibDescriptorName = "vpp-teib"
)
View Source
const (
	// VrfTableDescriptorName is the name of the descriptor for VRF tables.
	VrfTableDescriptorName = "vpp-vrf-table"
)
View Source
const (
	// VrrpDescriptorName is the name of the descriptor.
	VrrpDescriptorName = "vrrp"
)

Variables

View Source
var (
	// ErrMissingIP returned when one of IP fields in ProxyARP range is not set.
	ErrMissingIP = errors.New("missing IP address")
	// ErrIPWithMask returned when one of IP fields in ProxyARP range is set with a subnet mask.
	ErrIPWithMask = errors.New("only one IP must be defined (e.g. \"192.0.2.1\"), not a subnet")
	// ErrInvalidIP returned when one of IP fields in ProxyARP range can not be parsed.
	ErrInvalidIP = errors.New("invalid IP address")
	// ErrIPv6NotSupported returned when one of IP fields in ProxyARP range is defined as IPv6.
	ErrIPv6NotSupported = errors.New("IP address must be IPv4, not IPv6")
)

Validation errors:

View Source
var (
	ErrMissingInterface = errors.New("missing interface")
	ErrInvalidAddrNum   = errors.New("addrs quantity should be > 0 && <= 255")
	ErrInvalidVrID      = errors.New("vr_id should be > 0 && <= 255")
	ErrInvalidPriority  = errors.New("priority should be > 0 && <= 255")
	ErrInvalidInterval  = errors.New("interval should be > 0 && <= 65535")
	ErrInvalidVrrpIP    = errors.New("invalid IP address")
	ErrInvalidIPVer     = errors.New("ipv6_flag does not correspond to IP version of the provided address")
	ErrInvalidInterface = errors.New("interface does not exist")
)

A list of validation errors.

View Source
var (
	// ErrVrfTableLabelTooLong is returned when VRF table label exceeds the length limit.
	ErrVrfTableLabelTooLong = errors.New("VPP VRF table label exceeds the length limit (63 characters)")
)

A list of non-retriable errors:

Functions

func NewArpDescriptor

func NewArpDescriptor(scheduler kvs.KVScheduler,
	arpHandler vppcalls.ArpVppAPI, log logging.PluginLogger) *kvs.KVDescriptor

NewArpDescriptor creates a new instance of the ArpDescriptor.

func NewDHCPProxyDescriptor

func NewDHCPProxyDescriptor(scheduler kvs.KVScheduler,
	dhcpProxyHandler vppcalls.DHCPProxyAPI, log logging.PluginLogger) *kvs.KVDescriptor

NewDHCPProxyDescriptor creates a new instance of the DHCPProxyDescriptor.

func NewIPScanNeighborDescriptor

func NewIPScanNeighborDescriptor(
	scheduler kvs.KVScheduler,
	ipNeighHandler vppcalls.IPNeighVppAPI,
	log logging.PluginLogger,
) *kvs.KVDescriptor

NewIPScanNeighborDescriptor creates a new instance of the IPScanNeighborDescriptor.

func NewL3XCDescriptor

func NewL3XCDescriptor(l3xcHandler vppcalls.L3XCVppAPI, ifIndexes ifaceidx.IfaceMetadataIndex,
	log logging.PluginLogger,
) *kvs.KVDescriptor

NewL3XCDescriptor creates a new instance of the L3XCDescriptor.

func NewProxyArpDescriptor

func NewProxyArpDescriptor(scheduler kvs.KVScheduler,
	proxyArpHandler vppcalls.ProxyArpVppAPI, log logging.PluginLogger) *kvs.KVDescriptor

NewProxyArpDescriptor creates a new instance of the ProxyArpDescriptor.

func NewProxyArpInterfaceDescriptor

func NewProxyArpInterfaceDescriptor(scheduler kvs.KVScheduler,
	proxyArpHandler vppcalls.ProxyArpVppAPI, log logging.PluginLogger) *kvs.KVDescriptor

NewProxyArpInterfaceDescriptor creates a new instance of the ProxyArpInterfaceDescriptor.

func NewRouteDescriptor

func NewRouteDescriptor(
	routeHandler vppcalls.RouteVppAPI, addrAlloc netalloc.AddressAllocator,
	log logging.PluginLogger) *kvs.KVDescriptor

NewRouteDescriptor creates a new instance of the Route descriptor.

func NewTeibDescriptor added in v3.2.0

func NewTeibDescriptor(scheduler kvs.KVScheduler,
	teibHandler vppcalls.TeibVppAPI, log logging.PluginLogger) *kvs.KVDescriptor

NewTeibDescriptor creates a new instance of the TeibDescriptor.

func NewVrfTableDescriptor

func NewVrfTableDescriptor(
	vtHandler vppcalls.VrfTableVppAPI, log logging.PluginLogger) *kvs.KVDescriptor

NewVrfTableDescriptor creates a new instance of the VrfTable descriptor.

func NewVrrpDescriptor added in v3.2.0

func NewVrrpDescriptor(vrrpHandler vppcalls.VrrpVppAPI,
	log logging.PluginLogger) *kvs.KVDescriptor

NewVrrpDescriptor creates a new instance of the VrrpDescriptor.

Types

type ArpDescriptor

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

ArpDescriptor teaches KVScheduler how to configure VPP ARPs.

func (*ArpDescriptor) Create

func (d *ArpDescriptor) Create(key string, arp *l3.ARPEntry) (interface{}, error)

Create adds VPP ARP entry.

func (*ArpDescriptor) Delete

func (d *ArpDescriptor) Delete(key string, arp *l3.ARPEntry, metadata interface{}) error

Delete removes VPP ARP entry.

func (*ArpDescriptor) Dependencies

func (d *ArpDescriptor) Dependencies(key string, arp *l3.ARPEntry) (deps []kvs.Dependency)

Dependencies lists dependencies for a VPP ARP entry.

func (*ArpDescriptor) EquivalentArps

func (d *ArpDescriptor) EquivalentArps(key string, oldArp, newArp *l3.ARPEntry) bool

EquivalentArps is comparison function for ARP entries.

func (*ArpDescriptor) Retrieve

func (d *ArpDescriptor) Retrieve(correlate []adapter.ARPEntryKVWithMetadata) (
	retrieved []adapter.ARPEntryKVWithMetadata, err error,
)

Retrieve returns all ARP entries associated with interfaces managed by this agent.

type DHCPProxyDescriptor

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

DHCPProxyDescriptor teaches KVScheduler how to configure VPP DHCP proxy.

func (*DHCPProxyDescriptor) Create

func (d *DHCPProxyDescriptor) Create(key string, value *l3.DHCPProxy) (metadata interface{}, err error)

Create enables VPP DHCP proxy.

func (*DHCPProxyDescriptor) Delete

func (d *DHCPProxyDescriptor) Delete(key string, value *l3.DHCPProxy, metadata interface{}) error

Delete disables VPP DHCP proxy.

func (*DHCPProxyDescriptor) Dependencies

func (d *DHCPProxyDescriptor) Dependencies(key string, value *l3.DHCPProxy) (deps []kvs.Dependency)

Dependencies lists dependencies for a VPP DHCP proxy.

func (*DHCPProxyDescriptor) Retrieve

func (d *DHCPProxyDescriptor) Retrieve(correlate []adapter.DHCPProxyKVWithMetadata) (retrieved []adapter.DHCPProxyKVWithMetadata, err error)

Retrieve returns current VPP DHCP proxy configuration.

func (*DHCPProxyDescriptor) Validate

func (d *DHCPProxyDescriptor) Validate(key string, value *l3.DHCPProxy) error

type IPScanNeighborDescriptor

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

IPScanNeighborDescriptor teaches KVScheduler how to configure VPP proxy ARPs.

func (*IPScanNeighborDescriptor) Create

func (d *IPScanNeighborDescriptor) Create(key string, value *l3.IPScanNeighbor) (metadata interface{}, err error)

Create adds VPP IP Scan Neighbor.

func (*IPScanNeighborDescriptor) Delete

func (d *IPScanNeighborDescriptor) Delete(key string, value *l3.IPScanNeighbor, metadata interface{}) error

Delete deletes VPP IP Scan Neighbor.

func (*IPScanNeighborDescriptor) EquivalentIPScanNeighbors

func (d *IPScanNeighborDescriptor) EquivalentIPScanNeighbors(key string, oldValue, newValue *l3.IPScanNeighbor) bool

EquivalentIPScanNeighbors compares the IP Scan Neighbor values.

func (*IPScanNeighborDescriptor) Retrieve

Retrieve returns current VPP IP Scan Neighbor configuration.

func (*IPScanNeighborDescriptor) Update

func (d *IPScanNeighborDescriptor) Update(key string, oldValue, newValue *l3.IPScanNeighbor, oldMetadata interface{}) (newMetadata interface{}, err error)

Update modifies VPP IP Scan Neighbor.

type L3XCDescriptor

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

L3XCDescriptor teaches KVScheduler how to configure VPP L3XCs.

func (*L3XCDescriptor) Create

func (d *L3XCDescriptor) Create(key string, l3xc *l3.L3XConnect) (interface{}, error)

Create adds VPP L3XC entry.

func (*L3XCDescriptor) Delete

func (d *L3XCDescriptor) Delete(key string, l3xc *l3.L3XConnect, metadata interface{}) error

Delete removes VPP L3XC entry.

func (*L3XCDescriptor) Dependencies

func (d *L3XCDescriptor) Dependencies(key string, l3xc *l3.L3XConnect) (deps []kvs.Dependency)

Dependencies lists dependencies for a VPP L3XC entry.

func (*L3XCDescriptor) EquivalentL3XCs

func (d *L3XCDescriptor) EquivalentL3XCs(key string, oldL3XC, newL3XC *l3.L3XConnect) bool

EquivalentL3XCs is comparison function for L3XC entries.

func (*L3XCDescriptor) Retrieve

func (d *L3XCDescriptor) Retrieve(correlate []adapter.L3XCKVWithMetadata) (
	retrieved []adapter.L3XCKVWithMetadata, err error,
)

Retrieve returns all L3XC entries associated with interfaces managed by this agent.

func (*L3XCDescriptor) Update

func (d *L3XCDescriptor) Update(key string, oldL3XC, newL3XC *l3.L3XConnect, oldMeta interface{}) (interface{}, error)

Update updates VPP L3XC entry.

func (*L3XCDescriptor) Validate

func (d *L3XCDescriptor) Validate(key string, l3xc *l3.L3XConnect) error

Validate returns if given l3xc is valid.

type ProxyArpDescriptor

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

ProxyArpDescriptor teaches KVScheduler how to configure VPP proxy ARPs.

func (*ProxyArpDescriptor) Create

func (d *ProxyArpDescriptor) Create(key string, value *l3.ProxyARP) (metadata interface{}, err error)

Create adds VPP Proxy ARP.

func (*ProxyArpDescriptor) Delete

func (d *ProxyArpDescriptor) Delete(key string, value *l3.ProxyARP, metadata interface{}) error

Delete deletes VPP Proxy ARP.

func (*ProxyArpDescriptor) Dependencies added in v3.2.0

func (d *ProxyArpDescriptor) Dependencies(key string, proxyArp *l3.ProxyARP) []kvs.Dependency

Dependencies lists dependencies for a VPP Proxy ARP.

func (*ProxyArpDescriptor) DerivedValues

func (d *ProxyArpDescriptor) DerivedValues(key string, proxyArp *l3.ProxyARP) (derValues []kvs.KeyValuePair)

DerivedValues derives l3.ProxyARP_Interface for every interface.

func (*ProxyArpDescriptor) EquivalentProxyArps

func (d *ProxyArpDescriptor) EquivalentProxyArps(key string, oldValue, newValue *l3.ProxyARP) bool

EquivalentProxyArps compares VPP Proxy ARPs.

func (*ProxyArpDescriptor) Retrieve

func (d *ProxyArpDescriptor) Retrieve(correlate []adapter.ProxyARPKVWithMetadata) (
	retrieved []adapter.ProxyARPKVWithMetadata, err error)

Retrieve returns VPP Proxy ARP configuration.

func (*ProxyArpDescriptor) Update

func (d *ProxyArpDescriptor) Update(key string, oldValue, newValue *l3.ProxyARP, oldMetadata interface{}) (newMetadata interface{}, err error)

Update modifies VPP Proxy ARP.

func (*ProxyArpDescriptor) Validate added in v3.2.0

func (d *ProxyArpDescriptor) Validate(key string, proxyArp *l3.ProxyARP) error

Validate validates ProxyARP setup.

type ProxyArpInterfaceDescriptor

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

ProxyArpInterfaceDescriptor teaches KVScheduler how to configure VPP proxy ARP interfaces.

func (*ProxyArpInterfaceDescriptor) Create

func (d *ProxyArpInterfaceDescriptor) Create(key string, value *l3.ProxyARP_Interface) (metadata interface{}, err error)

Create enables VPP Proxy ARP for interface.

func (*ProxyArpInterfaceDescriptor) Delete

func (d *ProxyArpInterfaceDescriptor) Delete(key string, value *l3.ProxyARP_Interface, metadata interface{}) error

Delete disables VPP Proxy ARP for interface.

func (*ProxyArpInterfaceDescriptor) Dependencies

func (d *ProxyArpInterfaceDescriptor) Dependencies(key string, value *l3.ProxyARP_Interface) (deps []kvs.Dependency)

Dependencies returns list of dependencies for VPP Proxy ARP interface.

type RouteDescriptor

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

RouteDescriptor teaches KVScheduler how to configure VPP routes.

func (*RouteDescriptor) Create

func (d *RouteDescriptor) Create(key string, route *l3.Route) (metadata interface{}, err error)

Create adds VPP static route.

func (*RouteDescriptor) Delete

func (d *RouteDescriptor) Delete(key string, route *l3.Route, metadata interface{}) error

Delete removes VPP static route.

func (*RouteDescriptor) Dependencies

func (d *RouteDescriptor) Dependencies(key string, route *l3.Route) []kvs.Dependency

Dependencies lists dependencies for a VPP route.

func (*RouteDescriptor) EquivalentRoutes

func (d *RouteDescriptor) EquivalentRoutes(key string, oldRoute, newRoute *l3.Route) bool

EquivalentRoutes is case-insensitive comparison function for l3.Route.

func (*RouteDescriptor) Retrieve

func (d *RouteDescriptor) Retrieve(correlate []adapter.RouteKVWithMetadata) (
	retrieved []adapter.RouteKVWithMetadata, err error,
)

Retrieve returns all routes associated with interfaces managed by this agent.

func (*RouteDescriptor) Validate

func (d *RouteDescriptor) Validate(key string, route *l3.Route) (err error)

Validate validates VPP static route configuration.

type TeibDescriptor added in v3.2.0

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

TeibDescriptor instructs KVScheduler how to configure VPP TEIB entries.

func (*TeibDescriptor) Create added in v3.2.0

func (d *TeibDescriptor) Create(key string, entry *l3.TeibEntry) (interface{}, error)

Create adds a VPP TEIB entry.

func (*TeibDescriptor) Delete added in v3.2.0

func (d *TeibDescriptor) Delete(key string, entry *l3.TeibEntry, metadata interface{}) error

Delete removes a VPP TEIB entry.

func (*TeibDescriptor) Dependencies added in v3.2.0

func (d *TeibDescriptor) Dependencies(key string, entry *l3.TeibEntry) (deps []kvs.Dependency)

Dependencies lists dependencies for a VPP TEIB entry.

func (*TeibDescriptor) Retrieve added in v3.2.0

func (d *TeibDescriptor) Retrieve(correlate []adapter.TeibEntryKVWithMetadata) (
	retrieved []adapter.TeibEntryKVWithMetadata, err error,
)

Retrieve returns all TEIB entries.

func (*TeibDescriptor) Validate added in v3.2.0

func (d *TeibDescriptor) Validate(key string, entry *l3.TeibEntry) (err error)

Validate validates VPP TEIB entry configuration.

type VrfTableDescriptor

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

VrfTableDescriptor teaches KVScheduler how to configure VPP VRF tables.

func (*VrfTableDescriptor) Create

func (d *VrfTableDescriptor) Create(key string, vrfTable *l3.VrfTable) (metadata *vrfidx.VRFMetadata, err error)

Create adds VPP VRF table.

func (*VrfTableDescriptor) Delete

func (d *VrfTableDescriptor) Delete(key string, vrfTable *l3.VrfTable, metadata *vrfidx.VRFMetadata) error

Delete removes VPP VRF table.

func (*VrfTableDescriptor) EquivalentVrfTables

func (d *VrfTableDescriptor) EquivalentVrfTables(key string, oldVrfTable, newVrfTable *l3.VrfTable) bool

EquivalentVrfTables is a comparison function for l3.VrfTable.

func (*VrfTableDescriptor) MetadataFactory

func (d *VrfTableDescriptor) MetadataFactory() idxmap.NamedMappingRW

MetadataFactory is a factory for index-map customized for VRFs.

func (*VrfTableDescriptor) Retrieve

func (d *VrfTableDescriptor) Retrieve(correlate []adapter.VrfTableKVWithMetadata) (
	retrieved []adapter.VrfTableKVWithMetadata, err error,
)

Retrieve returns all configured VPP VRF tables.

func (*VrfTableDescriptor) Update

func (d *VrfTableDescriptor) Update(_ string, oldVrfTable, newVrfTable *l3.VrfTable, _ *vrfidx.VRFMetadata) (
	metadata *vrfidx.VRFMetadata, err error)

Update updates VPP VRF table (ony if protocol or VRF ID has not changed).

func (*VrfTableDescriptor) UpdateWithRecreate

func (d *VrfTableDescriptor) UpdateWithRecreate(_ string, oldVrfTable, newVrfTable *l3.VrfTable, _ *vrfidx.VRFMetadata) bool

UpdateWithRecreate returns true if a VRF update needs to be performed via re-crate.

func (*VrfTableDescriptor) Validate

func (d *VrfTableDescriptor) Validate(key string, vrfTable *l3.VrfTable) (err error)

Validate validates configuration of VPP VRF table.

type VrrpDescriptor added in v3.2.0

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

VrrpDescriptor teaches KVScheduler how to configure VPP VRRPs.

func (*VrrpDescriptor) Create added in v3.2.0

func (d *VrrpDescriptor) Create(key string, vrrp *l3.VRRPEntry) (interface{}, error)

Create adds VPP VRRP entry.

func (*VrrpDescriptor) Delete added in v3.2.0

func (d *VrrpDescriptor) Delete(key string, vrrp *l3.VRRPEntry, metadata interface{}) error

Delete removes VPP VRRP entry.

func (*VrrpDescriptor) Dependencies added in v3.2.0

func (d *VrrpDescriptor) Dependencies(key string, vrrp *l3.VRRPEntry) (deps []kvs.Dependency)

Dependencies lists dependencies for a VPP VRRP entry.

func (*VrrpDescriptor) EquivalentVRRPs added in v3.2.0

func (d *VrrpDescriptor) EquivalentVRRPs(_ string, oldVRRPEntry, newVRRPEntry *l3.VRRPEntry) bool

EquivalentVRRPs is a comparison function for l3.VRRPEntry.

func (*VrrpDescriptor) Retrieve added in v3.2.0

func (d *VrrpDescriptor) Retrieve(correlate []adapter.VRRPEntryKVWithMetadata) (
	retrieved []adapter.VRRPEntryKVWithMetadata, err error,
)

Retrieve returns all configured VPP VRRP entries.

func (*VrrpDescriptor) Update added in v3.2.0

func (d *VrrpDescriptor) Update(_ string, oldVRRPEntry, newVRRPEntry *l3.VRRPEntry, _ interface{}) (
	_ interface{}, err error)

Update updates VPP VRRP entry.

func (*VrrpDescriptor) UpdateWithRecreate added in v3.2.0

func (d *VrrpDescriptor) UpdateWithRecreate(_ string, oldVRRPEntry, newVRRPEntry *l3.VRRPEntry, _ interface{}) bool

UpdateWithRecreate returns true if a VRRP update needs to be performed via re-crate.

func (*VrrpDescriptor) Validate added in v3.2.0

func (d *VrrpDescriptor) Validate(key string, vrrp *l3.VRRPEntry) error

Validate returns error if given VRRP is not valid.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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