vppcalls

package
v1.9.0-alpha Latest Latest
Warning

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

Go to latest
Published: Dec 12, 2018 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Overview

Package vppcalls contains wrappers over VPP binary APIs to simplify their usage

Index

Constants

View Source
const (
	BehaviorEnd    uint8 = iota + 1 // Behavior of simple endpoint
	BehaviorX                       // Behavior of endpoint with Layer-3 cross-connect
	BehaviorT                       // Behavior of endpoint with specific IPv6 table lookup
	BehaviorDfirst                  // Unused. Separator in between regular and D
	BehaviorDX2                     // Behavior of endpoint with decapulation and Layer-2 cross-connect (or DX2 with egress VLAN rewrite when VLAN notzero - not supported this variant yet)
	BehaviorDX6                     // Behavior of endpoint with decapsulation and IPv6 cross-connect
	BehaviorDX4                     // Behavior of endpoint with decapsulation and IPv4 cross-connect
	BehaviorDT6                     // Behavior of endpoint with decapsulation and specific IPv6 table lookup
	BehaviorDT4                     // Behavior of endpoint with decapsulation and specific IPv4 table lookup
	BehaviorLast                    // seems unused, note in VPP: "Must always be the last one"
)

Constants for behavior function hardcoded into VPP (there can be also custom behavior functions implemented as VPP plugins) Constants are taken from VPP's vnet/srv6/sr.h (names are modified to Golang from original C form in VPP code)

View Source
const (
	SteerTypeL2   uint8 = 2
	SteerTypeIPv4 uint8 = 4
	SteerTypeIPv6 uint8 = 6
)

Constants for steering type Constants are taken from VPP's vnet/srv6/sr.h (names are modified to Golang from original C form in VPP code)

View Source
const (
	AddSRList            uint8 = iota + 1 // Add SR List to an existing SR policy
	DeleteSRList                          // Delete SR List from an existing SR policy
	ModifyWeightOfSRList                  // Modify the weight of an existing SR List
)

Constants for operation of SR policy modify binary API method

Variables

This section is empty.

Functions

This section is empty.

Types

type SRv6VPPRead added in v1.8.1

type SRv6VPPRead interface {
}

SRv6VPPRead provides read methods for segment routing

type SRv6VPPWrite added in v1.8.1

type SRv6VPPWrite interface {
	// AddLocalSid adds local sid given by <sidAddr> and <localSID> into VPP
	AddLocalSid(sidAddr net.IP, localSID *srv6.LocalSID, swIfIndex ifaceidx.SwIfIndex) error
	// DeleteLocalSid delets local sid given by <sidAddr> in VPP
	DeleteLocalSid(sidAddr net.IP) error
	// SetEncapsSourceAddress sets for SRv6 in VPP the source address used for encapsulated packet
	SetEncapsSourceAddress(address string) error
	// AddPolicy adds SRv6 policy given by identified <bindingSid>,initial segment for policy <policySegment> and other policy settings in <policy>
	AddPolicy(bindingSid net.IP, policy *srv6.Policy, policySegment *srv6.PolicySegment) error
	// DeletePolicy deletes SRv6 policy given by binding SID <bindingSid>
	DeletePolicy(bindingSid net.IP) error
	// AddPolicySegment adds segment <policySegment> to SRv6 policy <policy> that has policy BSID <bindingSid>
	AddPolicySegment(bindingSid net.IP, policy *srv6.Policy, policySegment *srv6.PolicySegment) error
	// DeletePolicySegment removes segment <policySegment> (with segment index <segmentIndex>) from SRv6 policy <policy> that has policy BSID <bindingSid>
	DeletePolicySegment(bindingSid net.IP, policy *srv6.Policy, policySegment *srv6.PolicySegment, segmentIndex uint32) error
	// AddSteering sets in VPP steering into SRv6 policy.
	AddSteering(steering *srv6.Steering, swIfIndex ifaceidx.SwIfIndex) error
	// RemoveSteering removes in VPP steering into SRv6 policy.
	RemoveSteering(steering *srv6.Steering, swIfIndex ifaceidx.SwIfIndex) error
}

SRv6VPPWrite provides write methods for segment routing

type SRv6VppAPI added in v1.8.1

type SRv6VppAPI interface {
	SRv6VPPWrite
	SRv6VPPRead
}

SRv6VppAPI is API boundary for vppcall package access, introduced to properly test code dependent on vppcalls package

type SRv6VppHandler added in v1.8.1

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

SRv6VppHandler is accessor for SRv6-related vppcalls methods

func NewSRv6VppHandler added in v1.8.1

func NewSRv6VppHandler(vppChan govppapi.Channel, log logging.Logger) *SRv6VppHandler

NewSRv6VppHandler creates new instance of SRv6 vppcalls handler

func (*SRv6VppHandler) AddLocalSid added in v1.8.1

func (h *SRv6VppHandler) AddLocalSid(sidAddr net.IP, localSID *srv6.LocalSID, swIfIndex ifaceidx.SwIfIndex) error

AddLocalSid adds local sid given by <sidAddr> and <localSID> into VPP

func (*SRv6VppHandler) AddPolicy added in v1.8.1

func (h *SRv6VppHandler) AddPolicy(bindingSid net.IP, policy *srv6.Policy, policySegment *srv6.PolicySegment) error

AddPolicy adds SRv6 policy given by identified <bindingSid>,initial segment for policy <policySegment> and other policy settings in <policy>

func (*SRv6VppHandler) AddPolicySegment added in v1.8.1

func (h *SRv6VppHandler) AddPolicySegment(bindingSid net.IP, policy *srv6.Policy, policySegment *srv6.PolicySegment) error

AddPolicySegment adds segment <policySegment> to SRv6 policy <policy> that has policy BSID <bindingSid>

func (*SRv6VppHandler) AddSteering added in v1.8.1

func (h *SRv6VppHandler) AddSteering(steering *srv6.Steering, swIfIndex ifaceidx.SwIfIndex) error

AddSteering sets in VPP steering into SRv6 policy.

func (*SRv6VppHandler) DeleteLocalSid added in v1.8.1

func (h *SRv6VppHandler) DeleteLocalSid(sidAddr net.IP) error

DeleteLocalSid delets local sid given by <sidAddr> in VPP

func (*SRv6VppHandler) DeletePolicy added in v1.8.1

func (h *SRv6VppHandler) DeletePolicy(bindingSid net.IP) error

DeletePolicy deletes SRv6 policy given by binding SID <bindingSid>

func (*SRv6VppHandler) DeletePolicySegment added in v1.8.1

func (h *SRv6VppHandler) DeletePolicySegment(bindingSid net.IP, policy *srv6.Policy, policySegment *srv6.PolicySegment,
	segmentIndex uint32) error

DeletePolicySegment removes segment <policySegment> (with segment index <segmentIndex>) from SRv6 policy <policy> that has policy BSID <bindingSid>

func (*SRv6VppHandler) RemoveSteering added in v1.8.1

func (h *SRv6VppHandler) RemoveSteering(steering *srv6.Steering, swIfIndex ifaceidx.SwIfIndex) error

RemoveSteering removes in VPP steering into SRv6 policy.

func (*SRv6VppHandler) SetEncapsSourceAddress added in v1.8.1

func (h *SRv6VppHandler) SetEncapsSourceAddress(address string) error

SetEncapsSourceAddress sets for SRv6 in VPP the source address used for encapsulated packet

Jump to

Keyboard shortcuts

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