Documentation
¶
Overview ¶
Package infraenv contains convenience function common to SCION infra services.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GenerateTLSConfig ¶
GenerateTLSConfig generates a self-signed certificate.
Types ¶
type AddressRewriter ¶
type AddressRewriter struct { // Router obtains path information to fill in address paths, if they are // required and missing. Router snet.Router // SVCRouter builds underlay addresses for intra-AS SVC traffic, based on // information found in the topology. SVCRouter SVCResolver // Resolver performs SVC resolution if enabled. Resolver Resolver }
AddressRewriter is used to compute paths and replace SVC destinations with unicast addresses.
func (AddressRewriter) RedirectToQUIC ¶
RedirectToQUIC takes an address and adds a path (if one does not already exist but is required), and replaces SVC destinations with QUIC unicast ones, if possible.
If the address is already unicast, no redirection to QUIC is attempted.
type IntraASPathQuerier ¶ added in v0.9.0
IntraASPathQuerier implements the PathQuerier interface. It will only provide AS-internal paths, i.e., zero-hops paths with only the IA as destination. This should only be used in places where you know that you only need to communicate inside the AS. The type of Path returned is a complete implementation with proper metadata.
type NetworkConfig ¶
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 // QUIC contains configuration details for QUIC servers. QUIC QUIC // SVCResolver is used to discover the underlay addresses of intra-AS SVC // servers. SVCResolver SVCResolver // 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 // Metrics injected into SCIONNetwork. SCIONNetworkMetrics snet.SCIONNetworkMetrics // Metrics injected into SCIONPacketConn. SCIONPacketConnMetrics snet.SCIONPacketConnMetrics // MTU of the local AS MTU uint16 // Topology is the helper class to get control-plane information for the // local AS. Topology snet.Topology }
NetworkConfig describes the networking configuration of a SCION control-plane RPC endpoint.
func (*NetworkConfig) AddressRewriter ¶
func (nc *NetworkConfig) AddressRewriter() *AddressRewriter
AddressRewriter initializes path and svc resolvers for infra servers.
The connector is used to open sockets for SVC resolution requests. If the connector is nil, the default connection factory is used.
func (*NetworkConfig) QUICStack ¶
func (nc *NetworkConfig) QUICStack() (*QUICStack, error)
type QUIC ¶
type QUIC struct { GetCertificate func(*tls.ClientHelloInfo) (*tls.Certificate, error) GetClientCertificate func(*tls.CertificateRequestInfo) (*tls.Certificate, error) TLSVerifier *trust.TLSCryptoVerifier }
QUIC contains the QUIC configuration for control-plane speakers.
type QUICStack ¶
type QUICStack struct { Listener *squic.ConnListener InsecureDialer *squic.ConnDialer Dialer *squic.ConnDialer }
QUICStack contains everything to run a QUIC based RPC stack.
type Resolver ¶
type Resolver interface { // LookupSVC resolves the SVC address for the AS terminating the path. LookupSVC(ctx context.Context, path snet.Path, svc addr.SVC) (*svc.Reply, error) }
Resolver performs SVC resolution for a remote AS, thus converting an anycast SVC address to a unicast IP/UDP one.
type SVCResolver ¶
type SVCResolver interface { // GetUnderlay returns the underlay address of a SVC server of the specified // type. When multiple servers are available, the choice is random. If no // servers are available an error should be returned. GetUnderlay(svc addr.SVC) (*net.UDPAddr, error) }
SVCResolver is used to construct underlay information for SVC servers running in the local AS.
Directories
¶
Path | Synopsis |
---|---|
Package mock_infraenv is a generated GoMock package.
|
Package mock_infraenv is a generated GoMock package. |