common

package
v0.0.0-...-e58ac12 Latest Latest
Warning

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

Go to latest
Published: Oct 28, 2021 License: Apache-2.0 Imports: 25 Imported by: 5

Documentation

Index

Constants

View Source
const (
	NSMBaseDirKey                        = "NSM_BASEDIR"
	NSMBaseDirDefault                    = "/var/lib/networkservicemesh/"
	ForwarderRegistrarSocketKey          = "FORWARDER_REGISTRAR_SOCKET"
	ForwarderRegistrarSocketDefault      = "/var/lib/networkservicemesh/nsm.forwarder-registrar.io.sock"
	ForwarderRegistrarSocketTypeKey      = "FORWARDER_REGISTRAR_SOCKET_TYPE"
	ForwarderRegistrarSocketTypeDefault  = "unix"
	ForwarderMetricsEnabledKey           = "METRICS_COLLECTOR_ENABLED"
	ForwarderMetricsEnabledDefault       = false
	ForwarderMetricsRequestPeriodKey     = "METRICS_COLLECTOR_REQUEST_PERIOD"
	ForwarderMetricsRequestPeriodDefault = time.Second * 2
	ForwarderNameKey                     = "FORWARDER_NAME"
	ForwarderNameDefault                 = "vppagent"
	ForwarderSocketKey                   = "FORWARDER_SOCKET"
	ForwarderSocketDefault               = "/var/lib/networkservicemesh/nsm-vppagent.forwarder.sock"
	ForwarderSocketTypeKey               = "FORWARDER_SOCKET_TYPE"
	ForwarderSocketTypeDefault           = "unix"
	ForwarderSrcIPKey                    = "NSM_FORWARDER_SRC_IP"
)

TODO Convert all the defaults to properly use NsmBaseDir

Variables

This section is empty.

Functions

func CreateNSMonitor

func CreateNSMonitor(crossConnectServer monitor_crossconnect.MonitorServer, handler func())

CreateNSMonitor creates a new MonitorNetNsInodeServer

func SanityCheckConnectionType

func SanityCheckConnectionType(mechanisms *Mechanisms, crossConnect *crossconnect.CrossConnect) error

SanityCheckConnectionType checks whether the forwarding plane supports the connection type in the request

Types

type ARPEntry

type ARPEntry struct {
	Interface   string
	IPAddress   string
	PhysAddress string
}

type EgressInterfaceType

type EgressInterfaceType interface {
	SrcIPNet() *net.IPNet
	SrcIPV6Net() *net.IPNet
	SrcLocalSID() net.IP
	DefaultGateway() *net.IP
	Interface() *net.Interface
	Name() string
	HardwareAddr() *net.HardwareAddr
	OutgoingInterface() string
	ArpEntries() []*ARPEntry
}

EgressInterfaceType describes the info about the egress interface used for tunneling

func NewEgressInterface

func NewEgressInterface(srcIP net.IP) (EgressInterfaceType, error)

NewEgressInterface creates a new egress interface object

type ForwarderConfig

type ForwarderConfig struct {
	Name                    string
	NSMBaseDir              string
	RegistrarSocket         string
	RegistrarSocketType     string
	ForwarderSocket         string
	ForwarderSocketType     string
	MechanismsUpdateChannel chan *Mechanisms
	Mechanisms              *Mechanisms
	MetricsEnabled          bool
	MetricsPeriod           time.Duration
	SrcIP                   net.IP
	EgressInterface         EgressInterfaceType
	GRPCserver              *grpc.Server
	Monitor                 monitor_crossconnect.MonitorServer
	Listener                net.Listener
}

ForwarderConfig keeps the common configuration for a forwarding plane

type ForwarderProbeGoals

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

ForwarderProbeGoals represents probes goals for Forwarder

func (*ForwarderProbeGoals) IsComplete

func (g *ForwarderProbeGoals) IsComplete() bool

IsComplete if all goals have done

func (*ForwarderProbeGoals) SetNewEgressIFReady

func (g *ForwarderProbeGoals) SetNewEgressIFReady()

SetNewEgressIFReady sets true for NewEgressIFReady

func (*ForwarderProbeGoals) SetSocketCleanReady

func (g *ForwarderProbeGoals) SetSocketCleanReady()

SetSocketCleanReady sets true for SocketCleanReady

func (*ForwarderProbeGoals) SetSocketListenReady

func (g *ForwarderProbeGoals) SetSocketListenReady()

SetSocketListenReady sets true for SocketListenReady

func (*ForwarderProbeGoals) SetSrcIPReady

func (g *ForwarderProbeGoals) SetSrcIPReady()

SetSrcIPReady sets true for SrcIPReady

func (*ForwarderProbeGoals) SetValidIPReady

func (g *ForwarderProbeGoals) SetValidIPReady()

SetValidIPReady sets true for ValidIPReady

func (*ForwarderProbeGoals) Status

func (g *ForwarderProbeGoals) Status() string

Status returns current goals status

type ForwarderRegistrarClient

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

func NewForwarderRegistrarClient

func NewForwarderRegistrarClient(network, registrarSocket string) *ForwarderRegistrarClient

func (*ForwarderRegistrarClient) Register

func (n *ForwarderRegistrarClient) Register(ctx context.Context, forwarderName, forwarderSocket string, onConnect OnConnectFunc, onDisconnect OnDisConnectFunc) *ForwarderRegistration

Register creates and register new ForwarderRegistration client

type ForwarderRegistration

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

ForwarderRegistration contains Forwarder registrar client info and connection events callbacks

func CreateForwarder

func CreateForwarder(ctx context.Context, dp NSMForwarder, forwarderGoals *ForwarderProbeGoals) *ForwarderRegistration

CreateForwarder creates new Forwarder Registrar client

func (*ForwarderRegistration) Close

func (dr *ForwarderRegistration) Close()

Close forwarder registrar client

type InodeSet

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

func NewInodeSet

func NewInodeSet(inodes []uint64) *InodeSet

func (*InodeSet) Contains

func (i *InodeSet) Contains(inode uint64) bool

type Mechanisms

type Mechanisms struct {
	RemoteMechanisms []*connection.Mechanism
	LocalMechanisms  []*connection.Mechanism
}

Mechanisms is a message used to communicate any changes in operational parameters and constraints

type MonitorNetNsInodeServer

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

func (*MonitorNetNsInodeServer) MonitorNetNsInode

func (m *MonitorNetNsInodeServer) MonitorNetNsInode()

func (*MonitorNetNsInodeServer) SendMsg

func (m *MonitorNetNsInodeServer) SendMsg(msg interface{}) error

type NSMForwarder

type NSMForwarder interface {
	forwarder.MechanismsMonitorServer
	Init(*ForwarderConfig) error
	CreateForwarderServer(*ForwarderConfig) forwarder.ForwarderServer
}

type OnConnectFunc

type OnConnectFunc func() error

type OnDisConnectFunc

type OnDisConnectFunc func() error

Jump to

Keyboard shortcuts

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