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
- Variables
- func GetDefaultSCIONDAddress(ia *addr.IA) string
- func Send(pld *Pld, conn net.Conn) error
- type ASInfoReply
- type ASInfoReplyEntry
- type ASInfoReq
- type Connector
- type FwdPathMeta
- type IFInfoReply
- type IFInfoReplyEntry
- type IFInfoRequest
- type Path
- func (p Path) Copy() snet.Path
- func (p Path) Destination() addr.IA
- func (p Path) Expiry() time.Time
- func (p Path) Fingerprint() snet.PathFingerprint
- func (p Path) Interfaces() []snet.PathInterface
- func (p Path) MTU() uint16
- func (p Path) OverlayNextHop() *net.UDPAddr
- func (p Path) Path() *spath.Path
- func (p Path) String() string
- type PathErrorCode
- type PathInterface
- type PathReply
- type PathReplyEntry
- type PathReq
- type PathReqFlags
- type Pld
- type Querier
- type RevHandler
- type RevNotification
- type RevReply
- type RevResult
- type Service
- type ServiceInfoReply
- type ServiceInfoReplyEntry
- type ServiceInfoRequest
- type TopoQuerier
Constants ¶
const ( // DefaultSCIONDAddress contains the system default for a SCIOND socket. DefaultSCIONDAddress = "127.0.0.1:30255" // DefaultSCIONDPort contains the default port for a SCIOND client API socket. DefaultSCIONDPort = 30255 )
Variables ¶
var (
ErrUnableToConnect = serrors.New("unable to connect to SCIOND")
)
Errors for SCIOND API requests
Functions ¶
func GetDefaultSCIONDAddress ¶ added in v0.5.0
GetDefaultSCIONDAddress return default sciond path for a given IA
Types ¶
type ASInfoReply ¶
type ASInfoReply struct {
Entries []ASInfoReplyEntry
}
type ASInfoReplyEntry ¶
func (*ASInfoReplyEntry) ISD_AS ¶
func (entry *ASInfoReplyEntry) ISD_AS() addr.IA
func (ASInfoReplyEntry) String ¶
func (entry ASInfoReplyEntry) String() string
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. ASInfo(ctx context.Context, ia addr.IA) (*ASInfoReply, error) // IFInfo requests from SCIOND 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. SVCInfo(ctx context.Context, svcTypes []proto.ServiceType) (*ServiceInfoReply, error) // RevNotification sends a raw revocation to SCIOND, as contained in an // SCMP message. RevNotificationFromRaw(ctx context.Context, b []byte) (*RevReply, error) // RevNotification sends a RevocationInfo message to SCIOND. RevNotification(ctx context.Context, sRevInfo *path_mgmt.SignedRevInfo) (*RevReply, 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 FwdPathMeta ¶
type FwdPathMeta struct { FwdPath []byte Mtu uint16 Interfaces []PathInterface ExpTime uint32 }
func (*FwdPathMeta) Copy ¶ added in v0.4.0
func (fpm *FwdPathMeta) Copy() *FwdPathMeta
func (*FwdPathMeta) DstIA ¶
func (fpm *FwdPathMeta) DstIA() addr.IA
func (*FwdPathMeta) Expiry ¶
func (fpm *FwdPathMeta) Expiry() time.Time
func (*FwdPathMeta) SrcIA ¶
func (fpm *FwdPathMeta) SrcIA() addr.IA
func (*FwdPathMeta) String ¶
func (fpm *FwdPathMeta) String() string
type IFInfoReply ¶
type IFInfoReply struct {
RawEntries []IFInfoReplyEntry `capnp:"entries"`
}
type IFInfoReplyEntry ¶
type IFInfoRequest ¶
func (IFInfoRequest) String ¶ added in v0.4.0
func (r IFInfoRequest) String() string
type Path ¶ added in v0.5.0
type Path struct {
// contains filtered or unexported fields
}
func (Path) Destination ¶ added in v0.5.0
func (Path) Fingerprint ¶ added in v0.5.0
func (p Path) Fingerprint() snet.PathFingerprint
func (Path) Interfaces ¶ added in v0.5.0
func (p Path) Interfaces() []snet.PathInterface
func (Path) OverlayNextHop ¶ added in v0.5.0
type PathErrorCode ¶
type PathErrorCode uint16
const ( ErrorOk PathErrorCode = iota ErrorNoPaths ErrorPSTimeout ErrorInternal ErrorBadSrcIA ErrorBadDstIA )
func (PathErrorCode) String ¶
func (c PathErrorCode) String() string
type PathInterface ¶
func (*PathInterface) Equal ¶ added in v0.4.0
func (iface *PathInterface) Equal(other *PathInterface) bool
func (PathInterface) IA ¶ added in v0.4.0
func (iface PathInterface) IA() addr.IA
func (PathInterface) ID ¶ added in v0.5.0
func (iface PathInterface) ID() common.IFIDType
func (PathInterface) String ¶
func (iface PathInterface) String() string
type PathReply ¶
type PathReply struct { ErrorCode PathErrorCode Entries []PathReplyEntry }
type PathReplyEntry ¶
type PathReplyEntry struct { Path *FwdPathMeta HostInfo hostinfo.Host }
func (*PathReplyEntry) Copy ¶ added in v0.4.0
func (e *PathReplyEntry) Copy() *PathReplyEntry
func (*PathReplyEntry) String ¶ added in v0.4.0
func (e *PathReplyEntry) String() string
type PathReq ¶
type PathReqFlags ¶
type Pld ¶
type Pld struct { Id uint64 TraceId []byte Which proto.SCIONDMsg_Which PathReq *PathReq PathReply *PathReply AsInfoReq *ASInfoReq AsInfoReply *ASInfoReply RevNotification *RevNotification RevReply *RevReply IfInfoRequest *IFInfoRequest IfInfoReply *IFInfoReply ServiceInfoRequest *ServiceInfoRequest ServiceInfoReply *ServiceInfoReply }
func (*Pld) ProtoId ¶
func (p *Pld) ProtoId() proto.ProtoIdType
type RevHandler ¶ added in v0.5.0
type RevHandler struct {
Connector Connector
}
RevHandler is an adapter for sciond connector to implement snet.RevocationHandler.
type RevNotification ¶
type RevNotification struct {
SRevInfo *path_mgmt.SignedRevInfo
}
func (*RevNotification) String ¶ added in v0.4.0
func (rN *RevNotification) String() string
type Service ¶
type Service interface { // Connect connects to the SCIOND server described by Service. Future // method calls on the returned Connector request information from SCIOND. Connect(context.Context) (Connector, error) }
Service describes a SCIOND endpoint. New connections to SCIOND can be initialized via Connect.
func NewService ¶
NewService returns a SCIOND API connection factory.
type ServiceInfoReply ¶
type ServiceInfoReply struct {
Entries []ServiceInfoReplyEntry
}
type ServiceInfoReplyEntry ¶
type ServiceInfoReplyEntry struct { ServiceType proto.ServiceType Ttl uint32 HostInfos []hostinfo.Host }
type ServiceInfoRequest ¶
type ServiceInfoRequest struct {
ServiceTypes []proto.ServiceType
}
func (ServiceInfoRequest) String ¶ added in v0.4.0
func (r ServiceInfoRequest) String() string
type TopoQuerier ¶ added in v0.5.0
type TopoQuerier struct {
Connector Connector
}
TopoQuerier can be used to get topology information from sciond.
func (TopoQuerier) OverlayAnycast ¶ added in v0.5.0
OverlayAnycast 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. |