control

package
v0.12.0 Latest Latest
Warning

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

Go to latest
Published: Oct 10, 2024 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

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.

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 netip.AddrPort) error
	AddExternalInterface(localIfID iface.ID, info LinkInfo, owned bool) error
	AddSvc(ia addr.IA, svc addr.SVC, a netip.AddrPort) error
	DelSvc(ia addr.IA, svc addr.SVC, a netip.AddrPort) error
	SetKey(ia addr.IA, index int, key []byte) error
	SetPortRange(start, end uint16)
}

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.
	IfID 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 netip.AddrPort
}

InternalInterface represents the internal interface of a router.

type LinkEnd

type LinkEnd struct {
	IA   addr.IA
	Addr netip.AddrPort
	IfID iface.ID
}

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.
	IfID uint16
	// InternalInterfaces is the local address (internal interface)
	// of the sibling router that owns this interface.
	InternalInterface netip.AddrPort
	// 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