infraenv

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Dec 4, 2020 License: Apache-2.0 Imports: 25 Imported by: 0

Documentation

Overview

Package infraenv contains convenience function common to SCION infra services.

Index

Constants

View Source
const (
	ErrAppUnableToInitMessenger common.ErrMsg = "Unable to initialize SCION Infra Messenger"
)

Variables

This section is empty.

Functions

func GenerateTLSConfig added in v0.6.0

func GenerateTLSConfig() (*tls.Config, error)

GenerateTLSConfig generates a self-signed certificate.

func InitInfraEnvironment added in v0.4.0

func InitInfraEnvironment(topologyPath string)

func InitInfraEnvironmentFunc added in v0.4.0

func InitInfraEnvironmentFunc(topologyPath string, f func())

InitInfraEnvironmentFunc sets up the environment by first calling env.RealoadTopology and then the provided function.

func NewRouter added in v0.4.0

func NewRouter(localIA addr.IA, sd env.SCIONDClient) (snet.Router, error)

NewRouter constructs a path router for paths starting from localIA.

Types

type NetworkConfig added in v0.4.0

type NetworkConfig struct {
	// IA is the local AS number.
	IA addr.IA
	// Public is the Internet-reachable address in the case where the service
	// is behind NAT.
	Public *net.UDPAddr
	// ReconnectToDispatcher sets up sockets that automatically reconnect if
	// the dispatcher closes the connection (e.g., if the dispatcher goes
	// down).
	ReconnectToDispatcher bool
	// QUIC contains configuration details for QUIC servers. If the listening
	// address is the empty string, then no QUIC socket is opened.
	QUIC QUIC
	// SVCRouter is used to discover the underlay addresses of intra-AS SVC
	// servers.
	SVCRouter messenger.LocalSVCRouter
	// SCMPHandler is the SCMP handler to use. This handler is only applied to
	// client connections. The connection the server listens on will always
	// ignore SCMP messages. Otherwise, the server will shutdown when receiving
	// an SCMP error message.
	SCMPHandler snet.SCMPHandler
}

NetworkConfig describes the networking configuration of a SCION control-plane RPC endpoint.

func (*NetworkConfig) AddressRewriter added in v0.4.0

func (nc *NetworkConfig) AddressRewriter(
	connFactory snet.PacketDispatcherService) *messenger.AddressRewriter

AddressRewriter initializes path and svc resolvers for infra servers.

The connection factory is used to open sockets for SVC resolution requests. If the connection factory is nil, the default connection factory is used.

func (*NetworkConfig) QUICStack added in v0.6.0

func (nc *NetworkConfig) QUICStack() (*QUICStack, error)

func (*NetworkConfig) TCPStack added in v0.6.0

func (nc *NetworkConfig) TCPStack() (net.Listener, error)

type QUIC added in v0.4.0

type QUIC struct {
	// Address is the UDP address to start the QUIC server on.
	Address string
}

QUIC contains the QUIC configuration for control-plane speakers.

type QUICStack added in v0.6.0

type QUICStack struct {
	Listener       *squic.ConnListener
	Dialer         *squic.ConnDialer
	RedirectCloser func()
}

QUICStack contains everything to run a QUIC based RPC stack.

Jump to

Keyboard shortcuts

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