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 GetDefaultSCIONDPath(ia *addr.IA) string
- type ASInfoReply
- type ASInfoReplyEntry
- type ASInfoReq
- type Adapter
- type Connector
- type FwdPathMeta
- 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
Constants ¶
const ( // DefaultSCIONDPath contains the system default for a SCIOND socket. DefaultSCIONDPath = "/run/shm/sciond/default.sock" // DefaultSocketFileMode allows read/write to the user and group only. DefaultSocketFileMode = 0770 )
Variables ¶
var (
ErrUnableToConnect = serrors.New("unable to connect to SCIOND")
)
Errors for SCIOND API requests
Functions ¶
func GetDefaultSCIONDPath ¶
GetDefaultSCIONDPath 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 { // Paths requests from SCIOND a set of end to end paths between src and // dst. max specifies the maximum number of paths returned. Paths(ctx context.Context, dst, src addr.IA, max uint16, f PathReqFlags) (*PathReply, 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) (*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(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. 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 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 PathErrorCode ¶
type PathErrorCode uint16
const ( ErrorOk PathErrorCode = iota ErrorNoPaths ErrorPSTimeout ErrorInternal ErrorBadSrcIA ErrorBadDstIA )
func (PathErrorCode) String ¶
func (c PathErrorCode) String() string
type PathInterface ¶
func NewPathInterface ¶ added in v0.4.0
func NewPathInterface(str string) (PathInterface, error)
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) IfId ¶ added in v0.4.0
func (iface PathInterface) IfId() 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 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 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
Directories ¶
Path | Synopsis |
---|---|
internal
|
|
Package mock_sciond is a generated GoMock package.
|
Package mock_sciond is a generated GoMock package. |