Documentation ¶
Overview ¶
Package sciond queries local SCIOND servers for information.
To query SCIOND, initialize a Service object by passing in the path to the UNIX socket. It is then possible to establish connections to SCIOND by calling Connect or ConnectTimeout on the service. The connections implement interface Connector, whose methods can be used to talk to SCIOND.
Connector method calls return the entire answer of SCIOND.
Fields prefixed with Raw (e.g., RawErrorCode) contain data in the format received from SCIOND. These are used internally, and the accessors without the prefix (e.g., ErrorCode()) should be used instead.
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 SCIOND")
)
Errors for SCIOND API requests
Functions ¶
This section is empty.
Types ¶
type Connector ¶
type Connector interface { // LocalIA requests from SCIOND the local ISD-AS number. LocalIA(ctx context.Context) (addr.IA, error) // Paths requests from SCIOND 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 SCIOND 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 SCIOND 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 raw revocation to SCIOND, as contained in an // SCMP message. RevNotificationFromRaw(ctx context.Context, b []byte) error // RevNotification sends a RevocationInfo message to SCIOND. RevNotification(ctx context.Context, sRevInfo *path_mgmt.SignedRevInfo) error // Close shuts down the connection to a SCIOND server. Close(ctx context.Context) error }
A Connector is used to query SCIOND. All connector methods block until either an error occurs, or the method successfully returns.
type Metrics ¶ added in v0.6.0
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 sciond API. Each counter may be set or unset.
type PathReqFlags ¶
type RevHandler ¶ added in v0.5.0
type RevHandler struct {
Connector Connector
}
RevHandler is an adapter for sciond 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 SCIOND API connection factory. Deprecated: Use Service struct directly instead.
type TopoQuerier ¶ added in v0.5.0
type TopoQuerier struct {
Connector Connector
}
TopoQuerier can be used to get topology information from sciond.
func (TopoQuerier) UnderlayAnycast ¶ added in v0.6.0
UnderlayAnycast provides any address for the given svc type.
Directories ¶
Path | Synopsis |
---|---|
internal
|
|
Package mock_sciond is a generated GoMock package.
|
Package mock_sciond is a generated GoMock package. |
Package pathprobe contains methods to probe scion paths.
|
Package pathprobe contains methods to probe scion paths. |