daemon

package
v0.7.0 Latest Latest
Warning

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

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

Documentation

Overview

Package daemon provides APIs for querying SCION Daemons.

Index

Constants

View Source
const (
	// DefaultAPIAddress contains the system default for a daemon API socket.
	DefaultAPIAddress = "127.0.0.1:30255"
	// DefaultAPIPort contains the default port for a daemon client API socket.
	DefaultAPIPort = 30255
)

Variables

View Source
var (
	ErrUnableToConnect = serrors.New("unable to connect to the SCION Daemon")
)

Errors for SCION Daemon API requests

Functions

This section is empty.

Types

type ASInfo

type ASInfo struct {
	IA  addr.IA
	MTU uint16
}

ASInfo provides information about the local AS.

type Connector

type Connector interface {
	// LocalIA requests from the daemon the local ISD-AS number.
	LocalIA(ctx context.Context) (addr.IA, error)
	// Paths requests from the daemon a set of end to end paths between the source and destination.
	Paths(ctx context.Context, dst, src addr.IA, f PathReqFlags) ([]snet.Path, error)
	// ASInfo requests from the daemon information about AS ia, the zero IA can be
	// use to detect the local IA.
	ASInfo(ctx context.Context, ia addr.IA) (ASInfo, error)
	// IFInfo requests from SCION Daemon addresses and ports of interfaces. Slice
	// ifs contains interface IDs of BRs. If empty, a fresh (i.e., uncached)
	// answer containing all interfaces is returned.
	IFInfo(ctx context.Context, ifs []common.IFIDType) (map[common.IFIDType]*net.UDPAddr, error)
	// SVCInfo requests from the daemon information about addresses and ports of
	// infrastructure services.  Slice svcTypes contains a list of desired
	// service types. If unset, a fresh (i.e., uncached) answer containing all
	// service types is returned. The reply is a map from service type to URI of
	// the service.
	SVCInfo(ctx context.Context, svcTypes []addr.HostSVC) (map[addr.HostSVC]string, error)
	// RevNotification sends a RevocationInfo message to the daemon.
	RevNotification(ctx context.Context, revInfo *path_mgmt.RevInfo) error
	// Close shuts down the connection to the daemon.
	Close(ctx context.Context) error
}

A Connector is used to query the SCION daemon. All connector methods block until either an error occurs, or the method successfully returns.

type Metrics

type Metrics struct {
	Connects                   metrics.Counter
	PathsRequests              metrics.Counter
	ASRequests                 metrics.Counter
	InterfacesRequests         metrics.Counter
	ServicesRequests           metrics.Counter
	InterfaceDownNotifications metrics.Counter
}

Metrics can be used to inject metrics counters into the SCION Daemon API. Each counter may be set or unset.

type PathReqFlags

type PathReqFlags struct {
	Refresh bool
	Hidden  bool
}

type Querier

type Querier struct {
	Connector Connector
	IA        addr.IA
}

func (Querier) Query

func (q Querier) Query(ctx context.Context, dst addr.IA) ([]snet.Path, error)

type RevHandler

type RevHandler struct {
	Connector Connector
}

RevHandler is an adapter for SCION Daemon connector to implement snet.RevocationHandler.

func (RevHandler) Revoke

func (h RevHandler) Revoke(ctx context.Context, revInfo *path_mgmt.RevInfo) error

type Service

type Service struct {
	// Address is the address of the SCION daemon to connect to.
	Address string
	// Metrics are the metric counters that should be incremented when using the
	// connector.
	Metrics Metrics
}

Service exposes the API to connect to a SCION daemon service.

func NewService

func NewService(name string) Service

NewService returns a SCION Daemon API connection factory. Deprecated: Use Service struct directly instead.

func (Service) Connect

func (s Service) Connect(ctx context.Context) (Connector, error)

type TopoQuerier

type TopoQuerier struct {
	Connector Connector
}

TopoQuerier can be used to get topology information from the SCION Daemon.

func (TopoQuerier) UnderlayAnycast

func (h TopoQuerier) UnderlayAnycast(ctx context.Context, svc addr.HostSVC) (*net.UDPAddr, error)

UnderlayAnycast provides any address for the given svc type.

Directories

Path Synopsis
internal
Package mock_daemon is a generated GoMock package.
Package mock_daemon is a generated GoMock package.

Jump to

Keyboard shortcuts

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