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 ¶
This section is empty.
Types ¶
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 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. |