Documentation ¶
Index ¶
- Constants
- Variables
- func NewInterfaceAddressDescriptor(ifHandler vppcalls.InterfaceVppAPI, addrAlloc netalloc.AddressAllocator, ...) *kvs.KVDescriptor
- func NewInterfaceVrfDescriptor(ifHandler vppcalls.InterfaceVppAPI, ifIndex ifaceidx.IfaceMetadataIndex, ...) *kvs.KVDescriptor
- func NewInterfaceWithAddrDescriptor(log logging.PluginLogger) *kvs.KVDescriptor
- func NewRxModeDescriptor(ifHandler vppcalls.InterfaceVppAPI, ifIndex ifaceidx.IfaceMetadataIndex, ...) *kvs.KVDescriptor
- func NewRxPlacementDescriptor(ifHandler vppcalls.InterfaceVppAPI, ifIndex ifaceidx.IfaceMetadataIndex, ...) *kvs.KVDescriptor
- func NewUnnumberedIfDescriptor(ifHandler vppcalls.InterfaceVppAPI, ifIndex ifaceidx.IfaceMetadataIndex, ...) *kvs.KVDescriptor
- type BondedInterfaceDescriptor
- func (d *BondedInterfaceDescriptor) Create(key string, bondedIf *interfaces.BondLink_BondedInterface) (metadata interface{}, err error)
- func (d *BondedInterfaceDescriptor) Delete(key string, bondedIf *interfaces.BondLink_BondedInterface, ...) error
- func (d *BondedInterfaceDescriptor) Dependencies(key string, bondedIf *interfaces.BondLink_BondedInterface) []kvs.Dependency
- func (d *BondedInterfaceDescriptor) IsBondEnslaveKey(key string) bool
- type DHCPDescriptor
- func (d *DHCPDescriptor) Close() error
- func (d *DHCPDescriptor) Create(key string, emptyVal proto.Message) (metadata kvs.Metadata, err error)
- func (d *DHCPDescriptor) Delete(key string, emptyVal proto.Message, metadata kvs.Metadata) error
- func (d *DHCPDescriptor) DerivedValues(key string, dhcpData proto.Message) (derValues []kvs.KeyValuePair)
- func (d *DHCPDescriptor) InterfaceNameFromKey(key string) string
- func (d *DHCPDescriptor) IsDHCPRelatedKey(key string) bool
- func (d *DHCPDescriptor) Retrieve(correlate []kvs.KVWithMetadata) (leases []kvs.KVWithMetadata, err error)
- func (d *DHCPDescriptor) WatchDHCPNotifications(ctx context.Context)
- type InterfaceAddressDescriptor
- func (d *InterfaceAddressDescriptor) Create(key string, emptyVal proto.Message) (metadata kvs.Metadata, err error)
- func (d *InterfaceAddressDescriptor) Delete(key string, emptyVal proto.Message, metadata kvs.Metadata) (err error)
- func (d *InterfaceAddressDescriptor) Dependencies(key string, emptyVal proto.Message) []kvs.Dependency
- func (d *InterfaceAddressDescriptor) IsInterfaceAddressKey(key string) bool
- func (d *InterfaceAddressDescriptor) Validate(key string, emptyVal proto.Message) (err error)
- type InterfaceDescriptor
- func (d *InterfaceDescriptor) Create(key string, intf *interfaces.Interface) (metadata *ifaceidx.IfaceMetadata, err error)
- func (d *InterfaceDescriptor) Delete(key string, intf *interfaces.Interface, metadata *ifaceidx.IfaceMetadata) error
- func (d *InterfaceDescriptor) Dependencies(key string, intf *interfaces.Interface) (dependencies []kvs.Dependency)
- func (d *InterfaceDescriptor) DerivedValues(key string, intf *interfaces.Interface) (derValues []kvs.KeyValuePair)
- func (d *InterfaceDescriptor) EquivalentInterfaces(key string, oldIntf, newIntf *interfaces.Interface) bool
- func (d *InterfaceDescriptor) MetadataFactory() idxmap.NamedMappingRW
- func (d *InterfaceDescriptor) Retrieve(correlate []adapter.InterfaceKVWithMetadata) (retrieved []adapter.InterfaceKVWithMetadata, err error)
- func (d *InterfaceDescriptor) SetInterfaceIndex(intfIndex ifaceidx.IfaceMetadataIndex)
- func (d *InterfaceDescriptor) Update(key string, oldIntf, newIntf *interfaces.Interface, ...) (newMetadata *ifaceidx.IfaceMetadata, err error)
- func (d *InterfaceDescriptor) UpdateWithRecreate(key string, oldIntf, newIntf *interfaces.Interface, ...) bool
- func (d *InterfaceDescriptor) Validate(key string, intf *interfaces.Interface) error
- type InterfaceVrfDescriptor
- func (d *InterfaceVrfDescriptor) Create(key string, emptyVal proto.Message) (metadata kvs.Metadata, err error)
- func (d *InterfaceVrfDescriptor) Delete(key string, emptyVal proto.Message, metadata kvs.Metadata) (err error)
- func (d *InterfaceVrfDescriptor) Dependencies(key string, emptyVal proto.Message) (deps []kvs.Dependency)
- func (d *InterfaceVrfDescriptor) IsInterfaceVrfKey(key string) bool
- type InterfaceWithAddrDescriptor
- func (d *InterfaceWithAddrDescriptor) Create(key string, emptyVal proto.Message) (metadata kvs.Metadata, err error)
- func (d *InterfaceWithAddrDescriptor) Delete(key string, emptyVal proto.Message, metadata kvs.Metadata) (err error)
- func (d *InterfaceWithAddrDescriptor) Dependencies(key string, emptyVal proto.Message) (deps []kvs.Dependency)
- func (d *InterfaceWithAddrDescriptor) IsInterfaceWithAddressKey(key string) bool
- type LinkStateDescriptor
- type LinuxPluginAPI
- type NetlinkAPI
- type RxModeDescriptor
- func (d *RxModeDescriptor) Create(key string, ifaceWithRxMode *interfaces.Interface) (metadata interface{}, err error)
- func (d *RxModeDescriptor) Delete(key string, ifaceWithRxMode *interfaces.Interface, metadata interface{}) error
- func (d *RxModeDescriptor) Dependencies(key string, ifaceWithRxMode *interfaces.Interface) (deps []kvs.Dependency)
- func (d *RxModeDescriptor) EquivalentRxMode(key string, oldIntf, newIntf *interfaces.Interface) bool
- func (d *RxModeDescriptor) IsInterfaceRxModeKey(key string) bool
- func (d *RxModeDescriptor) Update(key string, _, ifaceWithRxMode *interfaces.Interface, oldMetadata interface{}) (newMetadata interface{}, err error)
- func (d *RxModeDescriptor) Validate(key string, ifaceWithRxMode *interfaces.Interface) error
- type RxPlacementDescriptor
- func (d *RxPlacementDescriptor) Create(key string, rxPlacement *interfaces.Interface_RxPlacement) (md interface{}, err error)
- func (d *RxPlacementDescriptor) Delete(key string, rxPlacement *interfaces.Interface_RxPlacement, ...) error
- func (d *RxPlacementDescriptor) Dependencies(key string, rxPlacement *interfaces.Interface_RxPlacement) []kvs.Dependency
- func (d *RxPlacementDescriptor) EquivalentRxPlacement(key string, oldRxPl, newRxPl *interfaces.Interface_RxPlacement) bool
- func (d *RxPlacementDescriptor) IsInterfaceRxPlacementKey(key string) bool
- type SpanDescriptor
- func (d *SpanDescriptor) Create(key string, value *interfaces.Span) (metadata interface{}, err error)
- func (d *SpanDescriptor) Delete(key string, value *interfaces.Span, metadata interface{}) error
- func (d *SpanDescriptor) Dependencies(key string, value *interfaces.Span) []kvs.Dependency
- func (d *SpanDescriptor) Retrieve(correlate []adapter.SpanKVWithMetadata) (retrieved []adapter.SpanKVWithMetadata, err error)
- func (d *SpanDescriptor) SetInterfaceIndex(intfIndex ifaceidx.IfaceMetadataIndex)
- func (d *SpanDescriptor) Validate(key string, value *interfaces.Span) error
- type UnnumberedIfDescriptor
- func (d *UnnumberedIfDescriptor) Create(key string, unIntf *interfaces.Interface_Unnumbered) (metadata interface{}, err error)
- func (d *UnnumberedIfDescriptor) Delete(key string, unIntf *interfaces.Interface_Unnumbered, metadata interface{}) error
- func (d *UnnumberedIfDescriptor) Dependencies(key string, unIntf *interfaces.Interface_Unnumbered) (deps []kvs.Dependency)
- func (d *UnnumberedIfDescriptor) IsUnnumberedInterfaceKey(key string) bool
Constants ¶
const ( // BondInterfaceDescriptorName is the name of the descriptor for the bond-interface // config-subsection of VPP interfaces. BondedInterfaceDescriptorName = "bond-interface" )
const ( // DHCPDescriptorName is the name of the descriptor configuring DHCP for VPP // interfaces. DHCPDescriptorName = "vpp-dhcp" )
const ( // InterfaceAddressDescriptorName is the name of the descriptor for assigning // IP addresses to VPP interfaces. InterfaceAddressDescriptorName = "vpp-interface-address" )
const (
// InterfaceDescriptorName is the name of the descriptor for VPP interfaces.
InterfaceDescriptorName = "vpp-interface"
)
const ( // InterfaceVrfDescriptorName is the name of the descriptor for assigning // VPP interface into VRF table. InterfaceVrfDescriptorName = "vpp-interface-vrf" )
const ( // InterfaceWithAddressDescriptorName is the name of the descriptor for marking // interfaces with at least one IP address assigned. InterfaceWithAddressDescriptorName = "vpp-interface-has-address" )
const ( // LinkStateDescriptorName is the name of the descriptor notifying about the // link state changes of VPP interfaces. LinkStateDescriptorName = "vpp-interface-link-state" )
const ( // RxModeDescriptorName is the name of the descriptor for the unnumbered // config-subsection of VPP interfaces. RxModeDescriptorName = "vpp-interface-rx-mode" )
const ( // RxPlacementDescriptorName is the name of the descriptor for the rx-placement // config-subsection of VPP interfaces. RxPlacementDescriptorName = "vpp-interface-rx-placement" )
const (
// SpanDescriptorName is the name of the descriptor.
SpanDescriptorName = "vpp-span"
)
const ( // UnnumberedIfDescriptorName is the name of the descriptor for the unnumbered // config-subsection of VPP interfaces. UnnumberedIfDescriptorName = "vpp-unnumbered-interface" )
Variables ¶
var ( // ErrUnsupportedVPPInterfaceType is returned for VPP interfaces of unknown type. ErrUnsupportedVPPInterfaceType = errors.New("unsupported VPP interface type") // ErrInterfaceWithoutName is returned when VPP interface configuration has undefined // Name attribute. ErrInterfaceWithoutName = errors.New("VPP interface defined without logical name") // ErrInterfaceNameTooLong is returned when VPP interface logical name exceeds the length limit. ErrInterfaceNameTooLong = errors.New("VPP interface logical name exceeds the length limit (63 characters)") // ErrInterfaceWithoutType is returned when VPP interface configuration has undefined // Type attribute. ErrInterfaceWithoutType = errors.New("VPP interface defined without type") // ErrUnnumberedWithIP is returned when configuration of a VPP unnumbered interface // includes an IP address. ErrUnnumberedWithIP = errors.New("VPP unnumbered interface was defined with IP address") // ErrAfPacketWithoutHostName is returned when AF-Packet configuration is missing host interface name. ErrAfPacketWithoutHostName = errors.New("VPP AF-Packet interface was defined without host interface name") // ErrInterfaceLinkMismatch is returned when interface type does not match the link configuration. ErrInterfaceLinkMismatch = errors.New("VPP interface type and link configuration do not match") // ErrRedefinedRxPlacement is returned when Rx placement has multiple definitions for the same queue. ErrRedefinedRxPlacement = errors.New("redefined RX Placement") // ErrSubInterfaceWithoutParent is returned when interface of type sub-interface is defined without parent. ErrSubInterfaceWithoutParent = errors.Errorf("subinterface with no parent interface defined") // ErrDPDKInterfaceMissing is returned when the expected DPDK interface does not exist on the VPP. ErrDPDKInterfaceMissing = errors.Errorf("DPDK interface with given name does not exists") // ErrBondInterfaceIDExists is returned when the bond interface uses existing ID value ErrBondInterfaceIDExists = errors.Errorf("Bond interface ID already exists") // ErrGreBadTunnelType is returned when tunnel type for GRE was not set or set to UNKNOWN ErrGreBadTunnelType = errors.Errorf("bad tunnel type for GRE") // ErrGreSrcAddrMissing is returned when source address was not set or set to an empty string. ErrGreSrcAddrMissing = errors.Errorf("missing source address for GRE tunnel") // ErrGreDstAddrMissing is returned when destination address was not set or set to an empty string. ErrGreDstAddrMissing = errors.Errorf("missing destination address for GRE tunnel") // ErrVxLanGpeBadProtocol is returned when protocol for VxLAN-GPE was not set or set to UNKNOWN. ErrVxLanGpeBadProtocol = errors.Errorf("bad protocol for VxLAN-GPE") // ErrVxLanGpeNonZeroDecapVrfID is returned when DecapVrfId was not zero for protocols other than IP4 or IP6. ErrVxLanGpeNonZeroDecapVrfID = errors.Errorf("DecapVrfId must be zero for protocols other than IP4 or IP6") // ErrVxLanSrcAddrMissing is returned when source address was not set or set to an empty string. ErrVxLanSrcAddrMissing = errors.Errorf("missing source address for VxLAN tunnel") // ErrVxLanDstAddrMissing is returned when destination address was not set or set to an empty string. ErrVxLanDstAddrMissing = errors.Errorf("missing destination address for VxLAN tunnel") // ErrVxLanDstAddrBad is returned when destination address was not set to valid IP address. ErrVxLanDstAddrBad = errors.Errorf("bad destination address for VxLAN tunnel") // ErrVxLanMulticastIntfMissing is returned when interface for multicast was not specified. ErrVxLanMulticastIntfMissing = errors.Errorf("missing multicast interface name for VxLAN tunnel") // ErrGtpuSrcAddrMissing is returned when source address was not set or set to an empty string. ErrGtpuSrcAddrMissing = errors.Errorf("missing source address for GTPU tunnel") // ErrGtpuDstAddrMissing is returned when destination address was not set or set to an empty string. ErrGtpuDstAddrMissing = errors.Errorf("missing destination address for GTPU tunnel") // ErrGtpuSrcAddrBad is returned when source address was not set to valid IP address. ErrGtpuSrcAddrBad = errors.Errorf("bad source address for GTPU tunnel") // ErrGtpuDstAddrBad is returned when destination address was not set to valid IP address. ErrGtpuDstAddrBad = errors.Errorf("bad destination address for GTPU tunnel") )
A list of non-retriable errors:
var ( // ErrUnsupportedRxMode is returned when the given interface type does not support the chosen // RX mode. ErrUnsupportedRxMode = errors.New("unsupported RX Mode") // ErrUndefinedRxMode is returned when the Rx mode is not defined. ErrUndefinedRxMode = errors.New("undefined RX Mode") // ErrUnsupportedRxMode is returned when Rx mode has multiple definitions for the same queue. ErrRedefinedRxMode = errors.New("redefined RX Mode") )
A list of non-retriable errors:
var ( ErrSpanWithoutInterface = errors.New("VPP SPAN defined without From/To interface") ErrSpanWithoutDirection = errors.New("VPP SPAN defined without direction (Rx, Tx or Both)") )
A list of non-retriable errors:
Functions ¶
func NewInterfaceAddressDescriptor ¶
func NewInterfaceAddressDescriptor(ifHandler vppcalls.InterfaceVppAPI, addrAlloc netalloc.AddressAllocator, ifIndex ifaceidx.IfaceMetadataIndex, log logging.PluginLogger) *kvs.KVDescriptor
NewInterfaceAddressDescriptor creates a new instance of InterfaceAddressDescriptor.
func NewInterfaceVrfDescriptor ¶
func NewInterfaceVrfDescriptor(ifHandler vppcalls.InterfaceVppAPI, ifIndex ifaceidx.IfaceMetadataIndex, log logging.PluginLogger) *kvs.KVDescriptor
NewInterfaceVrfDescriptor creates a new instance of InterfaceVrfDescriptor.
func NewInterfaceWithAddrDescriptor ¶
func NewInterfaceWithAddrDescriptor(log logging.PluginLogger) *kvs.KVDescriptor
NewInterfaceWithAddrDescriptor creates a new instance of InterfaceWithAddrDescriptor.
func NewRxModeDescriptor ¶
func NewRxModeDescriptor(ifHandler vppcalls.InterfaceVppAPI, ifIndex ifaceidx.IfaceMetadataIndex, log logging.PluginLogger) *kvs.KVDescriptor
NewRxModeDescriptor creates a new instance of RxModeDescriptor.
func NewRxPlacementDescriptor ¶
func NewRxPlacementDescriptor(ifHandler vppcalls.InterfaceVppAPI, ifIndex ifaceidx.IfaceMetadataIndex, log logging.PluginLogger) *kvs.KVDescriptor
NewRxPlacementDescriptor creates a new instance of RxPlacementDescriptor.
func NewUnnumberedIfDescriptor ¶
func NewUnnumberedIfDescriptor(ifHandler vppcalls.InterfaceVppAPI, ifIndex ifaceidx.IfaceMetadataIndex, log logging.PluginLogger) *kvs.KVDescriptor
NewUnnumberedIfDescriptor creates a new instance of UnnumberedIfDescriptor.
Types ¶
type BondedInterfaceDescriptor ¶
type BondedInterfaceDescriptor struct {
// contains filtered or unexported fields
}
BondedInterfaceDescriptor sets/unsets VPP interfaces as a slave for the bond interface.
func NewBondedInterfaceDescriptor ¶
func NewBondedInterfaceDescriptor(ifHandler vppcalls.InterfaceVppAPI, ifIndex ifaceidx.IfaceMetadataIndex, log logging.PluginLogger) (*kvs.KVDescriptor, *BondedInterfaceDescriptor)
NewBondedInterfaceDescriptor creates a new instance of BondedInterfaceDescriptor.
func (*BondedInterfaceDescriptor) Create ¶
func (d *BondedInterfaceDescriptor) Create(key string, bondedIf *interfaces.BondLink_BondedInterface) (metadata interface{}, err error)
Create sets an interface as a bond interface slave.
func (*BondedInterfaceDescriptor) Delete ¶
func (d *BondedInterfaceDescriptor) Delete(key string, bondedIf *interfaces.BondLink_BondedInterface, metadata interface{}) error
Delete detaches interface as a bond slave
func (*BondedInterfaceDescriptor) Dependencies ¶
func (d *BondedInterfaceDescriptor) Dependencies(key string, bondedIf *interfaces.BondLink_BondedInterface) []kvs.Dependency
Dependencies lists dependencies for an bond slave VPP interface.
func (*BondedInterfaceDescriptor) IsBondEnslaveKey ¶
func (d *BondedInterfaceDescriptor) IsBondEnslaveKey(key string) bool
IsBondEnslaveKey returns true if the key is identifying bond VPP interface.
type DHCPDescriptor ¶
type DHCPDescriptor struct {
// contains filtered or unexported fields
}
DHCPDescriptor enables/disables DHCP for VPP interfaces and notifies about new DHCP leases.
func NewDHCPDescriptor ¶
func NewDHCPDescriptor(kvscheduler kvs.KVScheduler, ifHandler vppcalls.InterfaceVppAPI, ifIndex ifaceidx.IfaceMetadataIndex, log logging.PluginLogger, ) (*kvs.KVDescriptor, *DHCPDescriptor)
NewDHCPDescriptor creates a new instance of DHCPDescriptor.
func (*DHCPDescriptor) Close ¶
func (d *DHCPDescriptor) Close() error
Close stops watching of DHCP notifications.
func (*DHCPDescriptor) Create ¶
func (d *DHCPDescriptor) Create(key string, emptyVal proto.Message) (metadata kvs.Metadata, err error)
Create enables DHCP client.
func (*DHCPDescriptor) Delete ¶
Delete disables DHCP client.
func (*DHCPDescriptor) DerivedValues ¶
func (d *DHCPDescriptor) DerivedValues(key string, dhcpData proto.Message) (derValues []kvs.KeyValuePair)
DerivedValues derives empty value for leased IP address.
func (*DHCPDescriptor) InterfaceNameFromKey ¶
func (d *DHCPDescriptor) InterfaceNameFromKey(key string) string
InterfaceNameFromKey returns interface name from DHCP-related key.
func (*DHCPDescriptor) IsDHCPRelatedKey ¶
func (d *DHCPDescriptor) IsDHCPRelatedKey(key string) bool
IsDHCPRelatedKey returns true if the key is identifying DHCP client (derived value) or DHCP lease (notification).
func (*DHCPDescriptor) Retrieve ¶
func (d *DHCPDescriptor) Retrieve(correlate []kvs.KVWithMetadata) ( leases []kvs.KVWithMetadata, err error, )
Retrieve returns all existing DHCP leases.
func (*DHCPDescriptor) WatchDHCPNotifications ¶
func (d *DHCPDescriptor) WatchDHCPNotifications(ctx context.Context)
WatchDHCPNotifications starts watching for DHCP notifications.
type InterfaceAddressDescriptor ¶
type InterfaceAddressDescriptor struct {
// contains filtered or unexported fields
}
InterfaceAddressDescriptor (un)assigns (static) IP address to/from VPP interface.
func (*InterfaceAddressDescriptor) Create ¶
func (d *InterfaceAddressDescriptor) Create(key string, emptyVal proto.Message) (metadata kvs.Metadata, err error)
Create assigns IP address to an interface.
func (*InterfaceAddressDescriptor) Delete ¶
func (d *InterfaceAddressDescriptor) Delete(key string, emptyVal proto.Message, metadata kvs.Metadata) (err error)
Delete unassigns IP address from an interface.
func (*InterfaceAddressDescriptor) Dependencies ¶
func (d *InterfaceAddressDescriptor) Dependencies(key string, emptyVal proto.Message) []kvs.Dependency
Dependencies lists assignment of the interface into the VRF table and potential allocation of the IP address as dependencies.
func (*InterfaceAddressDescriptor) IsInterfaceAddressKey ¶
func (d *InterfaceAddressDescriptor) IsInterfaceAddressKey(key string) bool
IsInterfaceVrfKey returns true if the key represents assignment of an IP address to a VPP interface (that needs to be applied). KVs representing addresses already allocated from netalloc plugin or obtained from a DHCP server are excluded.
type InterfaceDescriptor ¶
type InterfaceDescriptor struct {
// contains filtered or unexported fields
}
InterfaceDescriptor teaches KVScheduler how to configure VPP interfaces.
func NewInterfaceDescriptor ¶
func NewInterfaceDescriptor( ifHandler vppcalls.InterfaceVppAPI, addrAlloc netalloc.AddressAllocator, defaultMtu uint32, linuxIfHandler NetlinkAPI, linuxIfPlugin LinuxPluginAPI, nsPlugin nsplugin.API, log logging.PluginLogger, ) (*kvs.KVDescriptor, *InterfaceDescriptor)
NewInterfaceDescriptor creates a new instance of the Interface descriptor.
func (*InterfaceDescriptor) Create ¶
func (d *InterfaceDescriptor) Create(key string, intf *interfaces.Interface) (metadata *ifaceidx.IfaceMetadata, err error)
Create creates a VPP interface.
func (*InterfaceDescriptor) Delete ¶
func (d *InterfaceDescriptor) Delete(key string, intf *interfaces.Interface, metadata *ifaceidx.IfaceMetadata) error
Delete removes VPP interface.
func (*InterfaceDescriptor) Dependencies ¶
func (d *InterfaceDescriptor) Dependencies(key string, intf *interfaces.Interface) (dependencies []kvs.Dependency)
Dependencies lists dependencies for a VPP interface.
func (*InterfaceDescriptor) DerivedValues ¶
func (d *InterfaceDescriptor) DerivedValues(key string, intf *interfaces.Interface) (derValues []kvs.KeyValuePair)
DerivedValues derives:
- key-value for unnumbered configuration sub-section
- empty value for enabled DHCP client
- configuration for every slave of a bonded interface
- one empty value for every IP address to be assigned to the interface
- one empty value for VRF table to put the interface into
- one value with interface configuration reduced to RxMode if set
- one Interface_RxPlacement for every queue with configured Rx placement
- one empty value which will be created once at least one IP address is assigned to the interface.
func (*InterfaceDescriptor) EquivalentInterfaces ¶
func (d *InterfaceDescriptor) EquivalentInterfaces(key string, oldIntf, newIntf *interfaces.Interface) bool
EquivalentInterfaces is case-insensitive comparison function for interfaces.Interface, also ignoring the order of assigned IP addresses.
func (*InterfaceDescriptor) MetadataFactory ¶
func (d *InterfaceDescriptor) MetadataFactory() idxmap.NamedMappingRW
MetadataFactory is a factory for index-map customized for VPP interfaces.
func (*InterfaceDescriptor) Retrieve ¶
func (d *InterfaceDescriptor) Retrieve(correlate []adapter.InterfaceKVWithMetadata) (retrieved []adapter.InterfaceKVWithMetadata, err error)
Retrieve returns all configured VPP interfaces.
func (*InterfaceDescriptor) SetInterfaceIndex ¶
func (d *InterfaceDescriptor) SetInterfaceIndex(intfIndex ifaceidx.IfaceMetadataIndex)
SetInterfaceIndex should be used to provide interface index immediately after the descriptor registration.
func (*InterfaceDescriptor) Update ¶
func (d *InterfaceDescriptor) Update(key string, oldIntf, newIntf *interfaces.Interface, oldMetadata *ifaceidx.IfaceMetadata) (newMetadata *ifaceidx.IfaceMetadata, err error)
Update is able to change Type-unspecific attributes.
func (*InterfaceDescriptor) UpdateWithRecreate ¶
func (d *InterfaceDescriptor) UpdateWithRecreate(key string, oldIntf, newIntf *interfaces.Interface, metadata *ifaceidx.IfaceMetadata) bool
UpdateWithRecreate returns true if Type or Type-specific attributes are different.
func (*InterfaceDescriptor) Validate ¶
func (d *InterfaceDescriptor) Validate(key string, intf *interfaces.Interface) error
Validate validates VPP interface configuration.
type InterfaceVrfDescriptor ¶
type InterfaceVrfDescriptor struct {
// contains filtered or unexported fields
}
InterfaceVrfDescriptor (un)assigns VPP interface to IPv4/IPv6 VRF table.
func (*InterfaceVrfDescriptor) Create ¶
func (d *InterfaceVrfDescriptor) Create(key string, emptyVal proto.Message) (metadata kvs.Metadata, err error)
Create puts interface into the given VRF table.
func (*InterfaceVrfDescriptor) Delete ¶
func (d *InterfaceVrfDescriptor) Delete(key string, emptyVal proto.Message, metadata kvs.Metadata) (err error)
Delete removes interface from the given VRF table.
func (*InterfaceVrfDescriptor) Dependencies ¶
func (d *InterfaceVrfDescriptor) Dependencies(key string, emptyVal proto.Message) (deps []kvs.Dependency)
Dependencies lists the target non-zero VRF as the only dependency.
func (*InterfaceVrfDescriptor) IsInterfaceVrfKey ¶
func (d *InterfaceVrfDescriptor) IsInterfaceVrfKey(key string) bool
IsInterfaceVrfKey returns true if the key represents assignment of an interface into a VRF table.
type InterfaceWithAddrDescriptor ¶
type InterfaceWithAddrDescriptor struct {
// contains filtered or unexported fields
}
InterfaceWithAddrDescriptor assigns property key-value pairs to interfaces with at least one IP address.
func (*InterfaceWithAddrDescriptor) Create ¶
func (d *InterfaceWithAddrDescriptor) Create(key string, emptyVal proto.Message) (metadata kvs.Metadata, err error)
Create is NOOP (the key-value pair is a property).
func (*InterfaceWithAddrDescriptor) Delete ¶
func (d *InterfaceWithAddrDescriptor) Delete(key string, emptyVal proto.Message, metadata kvs.Metadata) (err error)
Delete is NOOP (the key-value pair is a property)
func (*InterfaceWithAddrDescriptor) Dependencies ¶
func (d *InterfaceWithAddrDescriptor) Dependencies(key string, emptyVal proto.Message) (deps []kvs.Dependency)
Dependencies ensures that the property is created only after at least one IP address is successfully assigned to the interface.
func (*InterfaceWithAddrDescriptor) IsInterfaceWithAddressKey ¶
func (d *InterfaceWithAddrDescriptor) IsInterfaceWithAddressKey(key string) bool
IsInterfaceWithAddressKey returns true if the key is a property assigned to interface with at least one IP address.
type LinkStateDescriptor ¶
type LinkStateDescriptor struct {
// contains filtered or unexported fields
}
LinkStateDescriptor notifies kvscheduler about the link state changes of VPP interfaces.
func NewLinkStateDescriptor ¶
func NewLinkStateDescriptor(kvscheduler kvs.KVScheduler, ifaceHandler vppcalls.InterfaceVppAPI, ifaceIdx ifaceidx.IfaceMetadataIndex, log logging.PluginLogger) (descr *kvs.KVDescriptor, ctx *LinkStateDescriptor)
NewLinkStateDescriptor creates a new instance of the Link-State descriptor.
func (*LinkStateDescriptor) IsInterfaceLinkStateKey ¶
func (w *LinkStateDescriptor) IsInterfaceLinkStateKey(key string) bool
IsInterfaceLinkStateKey returns <true> for keys representing link-state of VPP interfaces.
func (*LinkStateDescriptor) Retrieve ¶
func (w *LinkStateDescriptor) Retrieve(correlate []kvs.KVWithMetadata) (values []kvs.KVWithMetadata, err error)
Retrieve returns key for every VPP interface describing the state of the link (value is empty).
func (*LinkStateDescriptor) UpdateLinkState ¶
func (w *LinkStateDescriptor) UpdateLinkState(ifaceState *interfaces.InterfaceNotification)
UpdateLinkState notifies scheduler about a change in the link state of an interface.
type LinuxPluginAPI ¶
type LinuxPluginAPI interface { // GetInterfaceIndex gives read-only access to map with metadata of all configured // linux interfaces. GetInterfaceIndex() linux_ifaceidx.LinuxIfMetadataIndex }
LinuxPluginAPI is defined here to avoid import cycles.
type NetlinkAPI ¶
type NetlinkAPI interface { // InterfaceExists verifies interface existence InterfaceExists(ifName string) (bool, error) }
NetlinkAPI here lists only those Netlink methods that are actually used by InterfaceDescriptor.
type RxModeDescriptor ¶
type RxModeDescriptor struct {
// contains filtered or unexported fields
}
RxModeDescriptor configures Rx mode for VPP interface queues.
func (*RxModeDescriptor) Create ¶
func (d *RxModeDescriptor) Create(key string, ifaceWithRxMode *interfaces.Interface) (metadata interface{}, err error)
Create configures RxMode for a given interface. Please note the proto message Interface is only used as container for RxMode. Only interface name, type and Rx mode are set.
func (*RxModeDescriptor) Delete ¶
func (d *RxModeDescriptor) Delete(key string, ifaceWithRxMode *interfaces.Interface, metadata interface{}) error
Delete reverts back to the default rx mode configuration.
func (*RxModeDescriptor) Dependencies ¶
func (d *RxModeDescriptor) Dependencies(key string, ifaceWithRxMode *interfaces.Interface) (deps []kvs.Dependency)
Dependencies informs scheduler that Rx mode configuration cannot be applied until the interface link is UP.
func (*RxModeDescriptor) EquivalentRxMode ¶
func (d *RxModeDescriptor) EquivalentRxMode(key string, oldIntf, newIntf *interfaces.Interface) bool
EquivalentRxMode compares Rx modes for equivalency.
func (*RxModeDescriptor) IsInterfaceRxModeKey ¶
func (d *RxModeDescriptor) IsInterfaceRxModeKey(key string) bool
IsInterfaceRxModeKey returns true if the key is identifying RxMode configuration.
func (*RxModeDescriptor) Update ¶
func (d *RxModeDescriptor) Update(key string, _, ifaceWithRxMode *interfaces.Interface, oldMetadata interface{}) (newMetadata interface{}, err error)
Update modifies Rx mode configuration.
func (*RxModeDescriptor) Validate ¶
func (d *RxModeDescriptor) Validate(key string, ifaceWithRxMode *interfaces.Interface) error
Validate validates Rx mode configuration.
type RxPlacementDescriptor ¶
type RxPlacementDescriptor struct {
// contains filtered or unexported fields
}
RxPlacementDescriptor configures Rx placement for VPP interface queues.
func (*RxPlacementDescriptor) Create ¶
func (d *RxPlacementDescriptor) Create(key string, rxPlacement *interfaces.Interface_RxPlacement) (md interface{}, err error)
Create configures RxPlacement for a given interface queue. Please note the proto message Interface is only used as container for RxMode. Only interface name, type and Rx mode are set.
func (*RxPlacementDescriptor) Delete ¶
func (d *RxPlacementDescriptor) Delete(key string, rxPlacement *interfaces.Interface_RxPlacement, metadata interface{}) error
Delete is NOOP (Rx placement cannot be returned back to default).
func (*RxPlacementDescriptor) Dependencies ¶
func (d *RxPlacementDescriptor) Dependencies(key string, rxPlacement *interfaces.Interface_RxPlacement) []kvs.Dependency
Dependencies informs scheduler that Rx placement configuration cannot be applied until the interface link is UP.
func (*RxPlacementDescriptor) EquivalentRxPlacement ¶
func (d *RxPlacementDescriptor) EquivalentRxPlacement(key string, oldRxPl, newRxPl *interfaces.Interface_RxPlacement) bool
EquivalentRxMode compares Rx placements for equivalency.
func (*RxPlacementDescriptor) IsInterfaceRxPlacementKey ¶
func (d *RxPlacementDescriptor) IsInterfaceRxPlacementKey(key string) bool
IsInterfaceRxPlacementKey returns true if the key is identifying RxPlacement configuration.
type SpanDescriptor ¶
type SpanDescriptor struct {
// contains filtered or unexported fields
}
SpanDescriptor teaches KVScheduler how to configure VPP SPAN.
func NewSpanDescriptor ¶
func NewSpanDescriptor(spanHandler vppcalls.InterfaceVppAPI, log logging.PluginLogger) (*kvs.KVDescriptor, *SpanDescriptor)
NewSpanDescriptor creates a new instance of the SpanDescriptor.
func (*SpanDescriptor) Create ¶
func (d *SpanDescriptor) Create(key string, value *interfaces.Span) (metadata interface{}, err error)
Create configures SPAN.
func (*SpanDescriptor) Delete ¶
func (d *SpanDescriptor) Delete(key string, value *interfaces.Span, metadata interface{}) error
Delete removes SPAN.
func (*SpanDescriptor) Dependencies ¶
func (d *SpanDescriptor) Dependencies(key string, value *interfaces.Span) []kvs.Dependency
Dependencies lists both From and To interfaces as dependencies.
func (*SpanDescriptor) Retrieve ¶
func (d *SpanDescriptor) Retrieve(correlate []adapter.SpanKVWithMetadata) (retrieved []adapter.SpanKVWithMetadata, err error)
Retrieve returns all records from VPP SPAN table.
func (*SpanDescriptor) SetInterfaceIndex ¶
func (d *SpanDescriptor) SetInterfaceIndex(intfIndex ifaceidx.IfaceMetadataIndex)
SetInterfaceIndex should be used to provide interface index immediately after the descriptor registration.
func (*SpanDescriptor) Validate ¶
func (d *SpanDescriptor) Validate(key string, value *interfaces.Span) error
Validate checks if required filed are not empty.
type UnnumberedIfDescriptor ¶
type UnnumberedIfDescriptor struct {
// contains filtered or unexported fields
}
UnnumberedIfDescriptor sets/unsets VPP interfaces as unnumbered. Values = Interface_Unnumbered{} derived from interfaces where IsUnnumbered==true
func (*UnnumberedIfDescriptor) Create ¶
func (d *UnnumberedIfDescriptor) Create(key string, unIntf *interfaces.Interface_Unnumbered) (metadata interface{}, err error)
Create sets interface as unnumbered.
func (*UnnumberedIfDescriptor) Delete ¶
func (d *UnnumberedIfDescriptor) Delete(key string, unIntf *interfaces.Interface_Unnumbered, metadata interface{}) error
Delete un-sets interface as unnumbered.
func (*UnnumberedIfDescriptor) Dependencies ¶
func (d *UnnumberedIfDescriptor) Dependencies(key string, unIntf *interfaces.Interface_Unnumbered) (deps []kvs.Dependency)
Dependencies lists dependencies for an unnumbered VPP interface.
func (*UnnumberedIfDescriptor) IsUnnumberedInterfaceKey ¶
func (d *UnnumberedIfDescriptor) IsUnnumberedInterfaceKey(key string) bool
IsUnnumberedInterfaceKey returns true if the key is identifying unnumbered VPP interface.