l2lib

package module
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Nov 3, 2022 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ExperimentalEthertype          = "88b5"
	PtpEthertype                   = "88f7"
	LocalInterfaces                = "0000"
	L2DaemonsetManagedString       = "MANAGED"
	L2DaemonsetPreConfiguredString = "PRECONFIGURED"
	L2DiscoveryDsName              = "l2discovery"
	L2DiscoveryNsName              = "default"
	L2DiscoveryContainerName       = "l2discovery"

	L2DiscoveryDuration = time.Second * 15
)

Variables

This section is empty.

Functions

This section is empty.

Types

type L2DaemonsetMode

type L2DaemonsetMode int64
const (
	// In managed mode, the L2 Topology discovery Daemonset is created by the conformance suite
	Managed L2DaemonsetMode = iota
	// In pre-configured mode, the L2 topology daemonset is pre-configured by the user in the cluster
	PreConfigured
)

func StringToL2Mode

func StringToL2Mode(aString string) L2DaemonsetMode

func (L2DaemonsetMode) String

func (mode L2DaemonsetMode) String() string

type L2DiscoveryConfig

type L2DiscoveryConfig struct {
	// Map of L2 topology as discovered by L2 discovery mechanism
	DiscoveryMap map[string]map[string]map[string]*l2.Neighbors
	// L2 topology graph created from discovery map. This is the main internal graph
	L2ConnectivityMap *graph.Mutable
	// Max size of graph
	MaxL2GraphSize int
	// list of cluster interfaces indexed with a simple integer (X) for readability in the graph
	PtpIfList []*l2.PtpIf
	// list of L2discovery daemonset pods
	L2DiscoveryPods map[string]*v1core.Pod
	// Mapping between clusterwide interface index and Mac address
	ClusterMacs map[l2.IfClusterIndex]string
	// Mapping between clusterwide interface index and a simple integer (X) for readability in the graph
	ClusterIndexToInt map[l2.IfClusterIndex]int
	// Mapping between a cluster wide MAC address and a simple integer (X) for readability in the graph
	ClusterMacToInt map[string]int
	// Mapping between a Mac address and a cluster wide interface index
	ClusterIndexes map[string]l2.IfClusterIndex
	// indicates whether the L2discovery daemonset is created by the test suite (managed) or not
	L2DsMode L2DaemonsetMode
	// LANs identified in the graph
	LANs *[][]int
	// List of port receiving PTP frames (assuming valid GM signal received)
	PortsGettingPTP []*l2.PtpIf
	// interfaces to avoid when running the tests
	SkippedInterfaces []string
	// contains filtered or unexported fields
}
var GlobalL2DiscoveryConfig L2DiscoveryConfig

func (*L2DiscoveryConfig) DiscoverL2Connectivity

func (config *L2DiscoveryConfig) DiscoverL2Connectivity(ptpInterfacesOnly bool) error

Discovers the L2 connectivity using l2discovery daemonset

func (*L2DiscoveryConfig) GetL2DiscoveryConfig

func (config *L2DiscoveryConfig) GetL2DiscoveryConfig(ptpInterfacesOnly bool) (L2Info, error)

Gets existing L2 configuration or creates a new one (if refresh is set to true)

func (*L2DiscoveryConfig) GetLANs

func (config *L2DiscoveryConfig) GetLANs() *[][]int

func (*L2DiscoveryConfig) GetPortsGettingPTP

func (config *L2DiscoveryConfig) GetPortsGettingPTP() []*l2.PtpIf

func (*L2DiscoveryConfig) GetPtpIfList

func (config *L2DiscoveryConfig) GetPtpIfList() []*l2.PtpIf

func (*L2DiscoveryConfig) PrintAllNICs

func (config *L2DiscoveryConfig) PrintAllNICs()

Print database with all NICs

func (*L2DiscoveryConfig) SetL2Client

func (config *L2DiscoveryConfig) SetL2Client(k8sClient kubernetes.Interface, restClient *rest.Config)

type L2Info

type L2Info interface {
	// list of cluster interfaces indexed with a simple integer (X) for readability in the graph
	GetPtpIfList() []*l2.PtpIf
	// LANs identified in the graph
	GetLANs() *[][]int
	// List of port receiving PTP frames (assuming valid GM signal received)
	GetPortsGettingPTP() []*l2.PtpIf

	SetL2Client(kubernetes.Interface, *rest.Config)
	GetL2DiscoveryConfig(ptpInterfacesOnly bool) (config L2Info, err error)
}

Directories

Path Synopsis
pkg

Jump to

Keyboard shortcuts

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