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: 14 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// LocalSIDDescriptorName is the name of the descriptor for VPP LocalSIDs
	LocalSIDDescriptorName = "vpp-sr-localsid"
)
View Source
const (
	// PolicyDescriptorName is the name of the descriptor for VPP SRv6 policies
	PolicyDescriptorName = "vpp-sr-policy"
)
View Source
const (
	// LocalSIDDescriptorName is the name of the descriptor for VPP LocalSIDs
	SRv6GlobalDescriptorName = "vpp-srv6-global"
)
View Source
const (
	// SteeringDescriptorName is the name of the descriptor for VPP SRv6 steering
	SteeringDescriptorName = "vpp-sr-steering"
)

Variables

This section is empty.

Functions

func NewLocalSIDDescriptor

func NewLocalSIDDescriptor(srHandler vppcalls.SRv6VppAPI, log logging.PluginLogger) *scheduler.KVDescriptor

NewLocalSIDDescriptor creates a new instance of the LocalSID descriptor.

func NewPolicyDescriptor

func NewPolicyDescriptor(srHandler vppcalls.SRv6VppAPI, log logging.PluginLogger) *scheduler.KVDescriptor

NewPolicyDescriptor creates a new instance of the Srv6 policy descriptor.

func NewSRv6GlobalDescriptor

func NewSRv6GlobalDescriptor(srHandler vppcalls.SRv6VppAPI, log logging.PluginLogger) *scheduler.KVDescriptor

NewSRv6GlobalDescriptor creates a new instance of the SRv6GlobalDescriptor.

func NewSteeringDescriptor

func NewSteeringDescriptor(srHandler vppcalls.SRv6VppAPI, log logging.PluginLogger) *scheduler.KVDescriptor

NewSteeringDescriptor creates a new instance of the Srv6 steering descriptor.

func ParseIPv4

func ParseIPv4(str string) (net.IP, error)

ParseIPv4 parses string <str> to IPv4 address

func ParseIPv6

func ParseIPv6(str string) (net.IP, error)

ParseIPv6 parses string <str> to IPv6 address (including IPv4 address converted to IPv6 address)

Types

type LocalSIDDescriptor

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

LocalSIDDescriptor teaches KVScheduler how to configure VPP LocalSIDs.

func (*LocalSIDDescriptor) Create

func (d *LocalSIDDescriptor) Create(key string, value *srv6.LocalSID) (metadata interface{}, err error)

Create creates new Local SID into VPP using VPP's binary api

func (*LocalSIDDescriptor) Delete

func (d *LocalSIDDescriptor) Delete(key string, value *srv6.LocalSID, metadata interface{}) error

Delete removes Local SID from VPP using VPP's binary api

func (*LocalSIDDescriptor) Dependencies

func (d *LocalSIDDescriptor) Dependencies(key string, localSID *srv6.LocalSID) (dependencies []scheduler.Dependency)

Dependencies for LocalSIDs are represented by interface (interface in up state)

func (*LocalSIDDescriptor) EquivalentLocalSIDs

func (d *LocalSIDDescriptor) EquivalentLocalSIDs(key string, oldLocalSID, newLocalSID *srv6.LocalSID) bool

EquivalentLocalSIDs determines whether 2 localSIDs are logically equal. This comparison takes into consideration also semantics that couldn't be modeled into proto models (i.e. SID is IPv6 address and not only string)

func (*LocalSIDDescriptor) Validate

func (d *LocalSIDDescriptor) Validate(key string, localSID *srv6.LocalSID) error

Validate validates VPP LocalSIDs.

type PolicyDescriptor

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

PolicyDescriptor teaches KVScheduler how to configure VPP SRv6 policies.

Implementation note: according to https://tools.ietf.org/html/draft-ietf-spring-segment-routing-policy-02#section-2.6, (weight,segments) tuple is not unique identification of candidate path(segment list) in policy (VPP also allows to have multiple segment lists that have the same (weight,segments) but differs in index (in ietf material they call it "Discriminator of a Candidate Path")). However, in validation and equivalency stage of vpp-agent there is no way how to get from VPP the index (validation precedes creation call and VPP doesn't have it). As result, restriction must be made, (weight,segments) is unique within given Policy. The drawback is that you can't create multiple segment lists with the same (weight,segments), but that is not issue if you don't want to explicitly rely on special attributes used by tie-breaking rules from https://tools.ietf.org/html/draft-ietf-spring-segment-routing-policy-02#section-2.9 (i.e. VPP-internal index). These special attributes can't be explicitly set in VPP, so can't rely on them anyway. So we should not miss any client use case for current VPP implementation (by removing duplicated segment list we don't break any use case).

func (*PolicyDescriptor) Create

func (d *PolicyDescriptor) Create(key string, policy *srv6.Policy) (metadata interface{}, err error)

Create creates new Policy into VPP using VPP's binary api

func (*PolicyDescriptor) Delete

func (d *PolicyDescriptor) Delete(key string, policy *srv6.Policy, metadata interface{}) error

Delete removes Policy from VPP using VPP's binary api

func (*PolicyDescriptor) Dependencies

func (d *PolicyDescriptor) Dependencies(key string, policy *srv6.Policy) (dependencies []scheduler.Dependency)

func (*PolicyDescriptor) EquivalentPolicies

func (d *PolicyDescriptor) EquivalentPolicies(key string, oldPolicy, newPolicy *srv6.Policy) bool

EquivalentPolicies determines whether 2 policies are logically equal. This comparison takes into consideration also semantics that couldn't be modeled into proto models (i.e. SID is IPv6 address and not only string)

func (*PolicyDescriptor) Update

func (d *PolicyDescriptor) Update(key string, oldPolicy, newPolicy *srv6.Policy, oldMetadata interface{}) (newMetadata interface{}, err error)

Update updates Policy in VPP using VPP's binary api. Only changes of segment list handled here. Other updates are handle by recreation (see function UpdateWithRecreate)

func (*PolicyDescriptor) UpdateWithRecreate

func (d *PolicyDescriptor) UpdateWithRecreate(key string, oldPolicy, newPolicy *srv6.Policy, oldMetadata interface{}) bool

UpdateWithRecreate define whether update case should be handled by complete policy recreation

func (*PolicyDescriptor) Validate

func (d *PolicyDescriptor) Validate(key string, policy *srv6.Policy) error

Validate validates VPP policies.

type PolicyMetadata

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

PolicyMetadata are Policy-related metadata that KVscheduler bundles with Policy data. They are served by KVScheduler in Create/Update descriptor methods.

type SRv6GlobalDescriptor

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

SRv6GlobalDescriptor teaches KVScheduler how to configure VPP SR Encap Source Address.

func (*SRv6GlobalDescriptor) Create

func (d *SRv6GlobalDescriptor) Create(key string, value *srv6.SRv6Global) (metadata interface{}, err error)

Create adds VPP IP Scan Neighbor.

func (*SRv6GlobalDescriptor) Delete

func (d *SRv6GlobalDescriptor) Delete(key string, value *srv6.SRv6Global, metadata interface{}) error

Delete deletes VPP IP Scan Neighbor.

func (*SRv6GlobalDescriptor) EquivalentSRv6Global

func (d *SRv6GlobalDescriptor) EquivalentSRv6Global(key string, oldValue, newValue *srv6.SRv6Global) bool

EquivalentSRv6Global compares the IP Scan Neighbor values.

func (*SRv6GlobalDescriptor) Update

func (d *SRv6GlobalDescriptor) Update(key string, oldValue, newValue *srv6.SRv6Global, oldMetadata interface{}) (newMetadata interface{}, err error)

Update modifies VPP IP Scan Neighbor.

type SteeringDescriptor

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

SteeringDescriptor teaches KVScheduler how to configure VPP SRv6 steering.

func (*SteeringDescriptor) Create

func (d *SteeringDescriptor) Create(key string, steering *srv6.Steering) (metadata interface{}, err error)

Create adds new steering into VPP using VPP's binary api

func (*SteeringDescriptor) Delete

func (d *SteeringDescriptor) Delete(key string, steering *srv6.Steering, metadata interface{}) error

Delete removes steering from VPP using VPP's binary api

func (*SteeringDescriptor) Dependencies

func (d *SteeringDescriptor) Dependencies(key string, steering *srv6.Steering) (dependencies []scheduler.Dependency)

Dependencies defines dependencies of Steering descriptor

func (*SteeringDescriptor) EquivalentSteering

func (d *SteeringDescriptor) EquivalentSteering(key string, oldSteering, newSteering *srv6.Steering) bool

EquivalentSteering determines whether 2 steerings are logically equal. This comparison takes into consideration also semantics that couldn't be modeled into proto models (i.e. SID is IPv6 address and not only string)

func (*SteeringDescriptor) Validate

func (d *SteeringDescriptor) Validate(key string, steering *srv6.Steering) error

Validate validates VPP SRv6 steerings.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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