vrf

package
v1.11.2-rc.1 Latest Latest
Warning

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

Go to latest
Published: Nov 28, 2023 License: Apache-2.0 Imports: 16 Imported by: 2

Documentation

Overview

Package vrf provides networkservice.NetworkService chain elements for vrf creating

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Delete

func Delete(ctx context.Context, isClient, isIPv6 bool)

Delete deletes the vrfID stored in per Connection.Id metadata

func Load

func Load(ctx context.Context, isClient, isIPv6 bool) (value uint32, ok bool)

Load returns the vrfID stored in per Connection.Id metadata, or nil if no value is present. The ok result indicates whether value was found in the per Connection.Id metadata.

func LoadAndDelete

func LoadAndDelete(ctx context.Context, isClient, isIPv6 bool) (value uint32, ok bool)

LoadAndDelete deletes the vrfID stored in per Connection.Id metadata, returning the previous value if any. The loaded result reports whether the key was present.

func LoadOrStore

func LoadOrStore(ctx context.Context, isClient, isIPv6 bool, vrfID uint32) (value uint32, ok bool)

LoadOrStore returns the existing vrfID stored in per Connection.Id metadata if present. Otherwise, it stores and returns the given vrfID. The loaded result is true if the value was loaded, false if stored.

func NewClient

func NewClient(vppConn api.Connection, opts ...Option) networkservice.NetworkServiceClient

NewClient creates a NetworkServiceClient chain element to create the ip table in vpp

func NewServer

func NewServer(vppConn api.Connection, opts ...Option) networkservice.NetworkServiceServer

NewServer creates a NetworkServiceServer chain element to create the ip table in vpp

func Store

func Store(ctx context.Context, isClient, isIPv6 bool, vrfID uint32)

Store sets the vrfID stored in per Connection.Id metadata.

Types

type Map

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

Map contains ipv6 and ipv4 vrf entries.

func NewMap

func NewMap() *Map

NewMap creates a new vrf.Map that can be used together with client and server.

type Option

type Option func(o *options)

Option is an option pattern for upClient/Server

func WithLoadInterface

func WithLoadInterface(loadFn ifindex.LoadInterfaceFn) Option

WithLoadInterface replaces for for loading iface to attach the vrf table.

func WithSharedMap

func WithSharedMap(v *Map) Option

WithSharedMap - sets shared vrfV4 and vrfV6 map.

Jump to

Keyboard shortcuts

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