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
- type ASInfoReply
- type ASInfoReplyEntry
- type ASInfoReq
- type Connector
- type FwdPathMeta
- type HostInfo
- type IFInfoReply
- type IFInfoReplyEntry
- type IFInfoRequest
- type PathErrorCode
- type PathInterface
- type PathReply
- type PathReplyEntry
- type PathReq
- type PathReqFlags
- type Pld
- type RevNotification
- type RevReply
- type RevResult
- type Service
- type ServiceInfoReply
- type ServiceInfoReplyEntry
- type ServiceInfoRequest
- type ServiceType
Constants ¶
Time to live for cache entries
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ASInfoReply ¶
type ASInfoReply struct {
Entries []ASInfoReplyEntry
}
type ASInfoReplyEntry ¶
func (*ASInfoReplyEntry) ISD_AS ¶
func (entry *ASInfoReplyEntry) ISD_AS() *addr.ISD_AS
func (ASInfoReplyEntry) String ¶
func (entry ASInfoReplyEntry) String() string
type Connector ¶
type Connector interface { // Paths requests from SCIOND a set of end to end paths between src and // dst. max specifices the maximum number of paths returned. Paths(dst, src *addr.ISD_AS, max uint16, f PathReqFlags) (*PathReply, error) // ASInfo requests from SCIOND information about AS ia. ASInfo(ia *addr.ISD_AS) (*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(ifs []uint64) (*IFInfoReply, 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(svcTypes []ServiceType) (*ServiceInfoReply, error) // RevNotification sends a raw revocation to SCIOND, as contained in an // SCMP message. RevNotificationFromRaw(revInfo []byte) (*RevReply, error) // RevNotification sends a RevocationInfo message to SCIOND. RevNotification(revInfo *path_mgmt.RevInfo) (*RevReply, error) // Close shuts down the connection to a SCIOND server. Close() error // SetDeadline sets a deadline associated with any SCIOND query. If // underlying protocol operations exceed the deadline, the queries return // immediately with an error. // // A zero value for t means queries will not time out. // // To check for exceeded deadlines, type assert the returned error to // *net.OpError and call method Timeout(). // // Following a timeout error the underlying protocol to SCIOND is probably // desynchronized. Establishing a fresh connection to SCIOND is // recommended. SetDeadline(t time.Time) error }
A Connector is used to query SCIOND. The connector maintains an internal cache for interface, service and AS information. 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 }
func (FwdPathMeta) DstIA ¶
func (fpm FwdPathMeta) DstIA() *addr.ISD_AS
func (FwdPathMeta) SrcIA ¶
func (fpm FwdPathMeta) SrcIA() *addr.ISD_AS
func (FwdPathMeta) String ¶
func (fpm FwdPathMeta) String() string
type IFInfoReply ¶
type IFInfoReply struct {
RawEntries []IFInfoReplyEntry `capnp:"entries"`
}
func (*IFInfoReply) Entries ¶
func (reply *IFInfoReply) Entries() map[uint64]HostInfo
Entries maps IFIDs to their addresses and ports; the map is rebuilt each time.
type IFInfoReplyEntry ¶
type IFInfoRequest ¶
type IFInfoRequest struct {
IfIDs []uint64
}
type PathErrorCode ¶
type PathErrorCode uint16
const ( ErrorOk PathErrorCode = iota ErrorNoPaths ErrorPSTimeout ErrorInternal )
func (PathErrorCode) String ¶
func (c PathErrorCode) String() string
type PathInterface ¶
func (*PathInterface) ISD_AS ¶
func (iface *PathInterface) ISD_AS() *addr.ISD_AS
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 }
type PathReqFlags ¶
type Pld ¶
type Pld struct { Id uint64 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 RevNotification ¶
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. // The information is not guaranteed to be fresh, as the returned connector // caches ASInfo replies for ASInfoTTL time, IFInfo replies for IFInfoTTL // time and SVCInfo for SVCInfoTTL time. Connect() (Connector, error) // ConnectTimeout acts like Connect but takes a timeout. // // A negative timeout means infinite timeout. // // To check for timeout errors, type assert the returned error to // *net.OpError and call method Timeout(). ConnectTimeout(timeout time.Duration) (Connector, error) }
Service describes a SCIOND endpoint. New connections to SCIOND can be initialized via Connect and ConnectTimeout.
func NewService ¶
type ServiceInfoReply ¶
type ServiceInfoReply struct {
Entries []ServiceInfoReplyEntry
}
type ServiceInfoReplyEntry ¶
type ServiceInfoReplyEntry struct { ServiceType ServiceType Ttl uint32 HostInfos []HostInfo }
type ServiceInfoRequest ¶
type ServiceInfoRequest struct {
ServiceTypes []ServiceType
}
type ServiceType ¶
type ServiceType uint16
const ( SvcBS ServiceType = iota SvcPS SvcCS SvcBR SvcSB )
func (ServiceType) String ¶
func (st ServiceType) String() string