control

package
v0.10.0 Latest Latest
Warning

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

Go to latest
Published: Dec 21, 2023 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	BFDDefaults = BFD{
		DetectMult:            3,
		DesiredMinTxInterval:  200 * time.Millisecond,
		RequiredMinRxInterval: 200 * time.Millisecond,

		Disable: false,
	}
)

Functions

func ConfigDataplane

func ConfigDataplane(dp Dataplane, cfg *Config) error

ConfigDataplane configures the data-plane with the new configuration.

func DeriveHFMacKey

func DeriveHFMacKey(k []byte) []byte

DeriveHFMacKey derives the MAC key from the given key.

Types

type BFD

type BFD topology.BFD

BFD is the configuration for the BFD sessions.

func WithDefaults

func WithDefaults(cfg BFD) BFD

XXX(sgmonroy) note that env values only affect defaults, which in turn are only used if there were no BFD related settings in the topology.

type Config

type Config struct {
	// Topo contains the names of all local infrastructure elements, a map
	// of interface IDs to routers, and the actual topology.
	Topo topology.Topology
	// IA is the current ISD-AS.
	IA addr.IA
	// BR is the topology information of this router.
	BR *topology.BRInfo
	// MasterKeys holds the local AS master keys.
	MasterKeys keyconf.Master
}

Config stores the runtime configuration state of an ISD-AS context.

func LoadConfig

func LoadConfig(id, confDir string) (*Config, error)

LoadConfig sets up the configuration, loading it from the supplied config directory.

func (*Config) String

func (cfg *Config) String() string

type Dataplane

type Dataplane interface {
	CreateIACtx(ia addr.IA) error
	AddInternalInterface(ia addr.IA, local net.UDPAddr) error
	AddExternalInterface(localIfID common.IFIDType, info LinkInfo, owned bool) error
	AddSvc(ia addr.IA, svc addr.SVC, ip net.IP) error
	DelSvc(ia addr.IA, svc addr.SVC, ip net.IP) error
	SetKey(ia addr.IA, index int, key []byte) error
}

Dataplane is the interface that a dataplane has to support to be controlled by this controller.

type ExternalInterface

type ExternalInterface struct {
	// InterfaceID is the identifier of the external interface.
	InterfaceID uint16
	// Link is the information associated with this link.
	Link LinkInfo
	// State indicates the interface state.
	State InterfaceState
}

ExternalInterface represents an external interface of a router.

type IACtx

type IACtx struct {
	// Config is the router topology configuration
	Config *Config
	// DP is the underlying data plane.
	DP Dataplane
}

IACtx is the context for the router for a given IA.

func (*IACtx) Configure

func (iac *IACtx) Configure() error

Configure configures the dataplane for the given context.

type InterfaceState

type InterfaceState string

InterfaceState indicates the state of the interface.

const (
	InterfaceUp   InterfaceState = "up"
	InterfaceDown InterfaceState = "down"
)

type InternalInterface

type InternalInterface struct {
	IA   addr.IA
	Addr *net.UDPAddr
}

InternalInterface represents the internal interface of a router.

type LinkEnd

type LinkEnd struct {
	IA   addr.IA
	Addr *net.UDPAddr
	IFID common.IFIDType
}

LinkEnd represents one end of a link.

type LinkInfo

type LinkInfo struct {
	Local    LinkEnd
	Remote   LinkEnd
	Instance string
	LinkTo   topology.LinkType
	BFD      BFD
	MTU      int
}

LinkInfo contains the information about a link between an internal and external router.

type ObservableDataplane

type ObservableDataplane interface {
	ListInternalInterfaces() ([]InternalInterface, error)
	ListExternalInterfaces() ([]ExternalInterface, error)
	ListSiblingInterfaces() ([]SiblingInterface, error)
}

type SiblingInterface

type SiblingInterface struct {
	// InterfaceID is the identifier of the external interface.
	InterfaceID uint16
	// InternalInterfaces is the local address (internal interface)
	// of the sibling router that owns this interface.
	InternalInterface *net.UDPAddr
	// Relationship describes the type of inter-AS links.
	Relationship topology.LinkType
	// MTU is the maximum Transmission Unit for SCION packets.
	MTU int
	// NeighborIA is the ISD-AS number of the neighbor AS this interface connects to.
	NeighborIA addr.IA
	// State indicates the interface state. This refers to the connectivity state
	// of the internal network to reach this interface. It does not specify the
	// state of the interface itself.
	State InterfaceState
}

SiblingInterface represents a sibling interface of a router.

Directories

Path Synopsis
internal
metrics
Package metrics defines and exports router metrics to be scraped by prometheus.
Package metrics defines and exports router metrics to be scraped by prometheus.
Package mock_api is a generated GoMock package.
Package mock_api is a generated GoMock package.

Jump to

Keyboard shortcuts

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