Documentation
¶
Overview ¶
Package daemon provides APIs for querying SCION Daemons.
Index ¶
Constants ¶
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 ¶
var (
ErrUnableToConnect = serrors.New("unable to connect to the SCION Daemon")
)
Errors for SCION Daemon API requests
Functions ¶
Types ¶
type Connector ¶
type Connector interface {
// LocalIA requests from the daemon the local ISD-AS number.
// TODO: Caching this value to avoid contacting the daemon, since this never changes.
LocalIA(ctx context.Context) (addr.IA, error)
// PortRange returns the beginning and the end of the SCION/UDP endhost port range, configured
// for the local IA.
PortRange(ctx context.Context) (uint16, uint16, error)
// Interfaces returns the map of interface identifiers to the underlay internal address.
Interfaces(ctx context.Context) (map[uint16]netip.AddrPort, 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
// used to detect the local IA.
ASInfo(ctx context.Context, ia addr.IA) (ASInfo, 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 a list
// of URIs of the service in the local AS.
SVCInfo(ctx context.Context, svcTypes []addr.SVC) (map[addr.SVC][]string, error)
// RevNotification sends a RevocationInfo message to the daemon.
RevNotification(ctx context.Context, revInfo *path_mgmt.RevInfo) error
// DRKeyGetASHostKey requests a AS-Host Key from the daemon.
DRKeyGetASHostKey(ctx context.Context, meta drkey.ASHostMeta) (drkey.ASHostKey, error)
// DRKeyGetHostASKey requests a Host-AS Key from the daemon.
DRKeyGetHostASKey(ctx context.Context, meta drkey.HostASMeta) (drkey.HostASKey, error)
// DRKeyGetHostHostKey requests a Host-Host Key from the daemon.
DRKeyGetHostHostKey(ctx context.Context, meta drkey.HostHostMeta) (drkey.HostHostKey, error)
// Close shuts down the connection to the daemon.
Close() 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 ReloadingTopology ¶ added in v0.13.0
type ReloadingTopology struct {
// contains filtered or unexported fields
}
ReloadingTopology is a topology that reloads the interface information periodically. It is safe for concurrent use.
func NewReloadingTopology ¶ added in v0.13.0
func NewReloadingTopology(ctx context.Context, conn Connector) (*ReloadingTopology, error)
NewReloadingTopology creates a new ReloadingTopology that reloads the interface information periodically. The Run method must be called for interface information to be populated.
func (*ReloadingTopology) Run ¶ added in v0.13.0
func (t *ReloadingTopology) Run(ctx context.Context, period time.Duration)
func (*ReloadingTopology) Topology ¶ added in v0.13.0
func (t *ReloadingTopology) Topology() snet.Topology
type RevHandler ¶
type RevHandler struct {
Connector Connector
}
RevHandler is an adapter for SCION Daemon connector to implement snet.RevocationHandler.
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 ¶
NewService returns a SCION Daemon API connection factory. Deprecated: Use Service struct directly instead.
type TopoQuerier ¶
type TopoQuerier struct {
Connector Connector
}
TopoQuerier can be used to get topology information from the SCION Daemon.
func (TopoQuerier) UnderlayAnycast ¶
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. |