discovery

package
v1.1.6 Latest Latest
Warning

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

Go to latest
Published: Feb 23, 2023 License: Apache-2.0 Imports: 22 Imported by: 0

Documentation

Overview

Package discovery implements the link and host discovery control logic

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	EmitFrequency               int64 `mapstructure:"emitFrequency" yaml:"emitFrequency"`
	MaxLinkAge                  int64 `mapstructure:"maxLinkAge" yaml:"maxLinkAge"`
	PipelineValidationFrequency int64 `mapstructure:"pipelineValidationFrequency" yaml:"pipelineValidationFrequency"`
	PortRediscoveryFrequency    int64 `mapstructure:"portRediscoveryFrequency" yaml:"portRediscoveryFrequency"`
	LinkPruneFrequency          int64 `mapstructure:"linkPruneFrequency" yaml:"linkPruneFrequency"`
}

Config contains configuration parameters for the link discovery

type Controller

type Controller struct {
	configtree.Configurable
	configtree.GNMIConfigurable

	TargetAddress   string
	IngressDeviceID string
	// contains filtered or unexported fields
}

Controller represents the link discovery control

func NewController

func NewController(targetAddress string, agentID string) *Controller

NewController creates a new link discovery controller

func (c *Controller) GetLinks() []*Link

GetLinks returns a list of currently discovered links, sorted by ingress port

func (*Controller) RefreshConfig

func (c *Controller) RefreshConfig()

RefreshConfig refreshes the config tree state from any relevant external source state

func (*Controller) Start

func (c *Controller) Start()

Start starts the controller

func (*Controller) Stop

func (c *Controller) Stop()

Stop stops the controller

func (*Controller) UpdateConfig

func (c *Controller) UpdateConfig()

UpdateConfig should be called after the configuration tree has been updated to save the configuration and to reflect it back to the controller's Config structure for easy access.

type Host

type Host struct {
	MAC        string
	IP         string
	Port       uint32
	LastUpdate time.Time
}

Host is a simple representation of a host network interface discovered by the ONOS lite

type Link struct {
	EgressPort     uint32
	EgressDeviceID string
	IngressPort    uint32
	LastUpdate     time.Time
}

Link holds data about each discovered ingress links

type Port

type Port struct {
	ID         string
	Number     uint32
	Status     string
	LastChange uint64
}

Port holds data about each discovered switch ports

type State

type State int

State represents the various states of controller lifecycle

const (
	// Disconnected represents the default/initial state
	Disconnected State = iota
	// Connected represents state where Stratum connection(s) have been established
	Connected
	// PipelineConfigAvailable represents state where P4Info has been obtained
	PipelineConfigAvailable
	// Elected represents state where the link agent established mastership for its role
	Elected
	// PortsDiscovered represents state where the link agent discovered all Stratum ports
	PortsDiscovered
	// Configured represents state where the link agent has been fully configured and can discover links
	Configured
	// Reconfigured represents state where new configuration has been received
	Reconfigured
	// Stopped represents state where the link agent has been issued a stop command
	Stopped
)

Jump to

Keyboard shortcuts

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