sciond

package
v0.5.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 30, 2020 License: Apache-2.0 Imports: 21 Imported by: 0

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

View Source
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

View Source
var (
	ErrUnableToConnect = serrors.New("unable to connect to SCIOND")
)

Errors for SCIOND API requests

Functions

func GetDefaultSCIONDAddress added in v0.5.0

func GetDefaultSCIONDAddress(ia *addr.IA) string

GetDefaultSCIONDAddress return default sciond path for a given IA

func Send added in v0.5.0

func Send(pld *Pld, conn net.Conn) error

Types

type ASInfoReply

type ASInfoReply struct {
	Entries []ASInfoReplyEntry
}

type ASInfoReplyEntry

type ASInfoReplyEntry struct {
	RawIsdas addr.IAInt `capnp:"isdas"`
	Mtu      uint16
	IsCore   bool
}

func (*ASInfoReplyEntry) ISD_AS

func (entry *ASInfoReplyEntry) ISD_AS() addr.IA

func (ASInfoReplyEntry) String

func (entry ASInfoReplyEntry) String() string

type ASInfoReq

type ASInfoReq struct {
	Isdas addr.IAInt
}

func (ASInfoReq) String added in v0.4.0

func (r ASInfoReq) 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 IFInfoReplyEntry struct {
	IfID     common.IFIDType
	HostInfo hostinfo.Host
}

type IFInfoRequest

type IFInfoRequest struct {
	IfIDs []common.IFIDType
}

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) Copy added in v0.5.0

func (p Path) Copy() snet.Path

func (Path) Destination added in v0.5.0

func (p Path) Destination() addr.IA

func (Path) Expiry added in v0.5.0

func (p Path) Expiry() time.Time

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) MTU added in v0.5.0

func (p Path) MTU() uint16

func (Path) OverlayNextHop added in v0.5.0

func (p Path) OverlayNextHop() *net.UDPAddr

func (Path) Path added in v0.5.0

func (p Path) Path() *spath.Path

func (Path) String added in v0.5.0

func (p Path) 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

type PathInterface struct {
	RawIsdas addr.IAInt `capnp:"isdas"`
	IfID     common.IFIDType
}

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
}

func (*PathReply) String added in v0.4.0

func (r *PathReply) String() string

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 PathReq struct {
	Dst    addr.IAInt
	Src    addr.IAInt
	HPCfgs []*path_mgmt.HPGroupId `capnp:"hpCfgs"`
	Flags  PathReqFlags
}

func (*PathReq) Copy

func (pathReq *PathReq) Copy() *PathReq

func (*PathReq) String added in v0.4.0

func (pathReq *PathReq) String() string

type PathReqFlags

type PathReqFlags struct {
	PathCount uint16 `capnp:"-"`
	Refresh   bool
	Hidden    bool
}

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 NewPldFromRaw

func NewPldFromRaw(b common.RawBytes) (*Pld, error)

func (*Pld) ProtoId

func (p *Pld) ProtoId() proto.ProtoIdType

func (*Pld) String

func (p *Pld) String() string

type Querier added in v0.5.0

type Querier struct {
	Connector Connector
	IA        addr.IA
	MaxPaths  uint16
}

func (Querier) Query added in v0.5.0

func (q Querier) Query(ctx context.Context, dst addr.IA) ([]snet.Path, error)

type RevHandler added in v0.5.0

type RevHandler struct {
	Connector Connector
}

RevHandler is an adapter for sciond connector to implement snet.RevocationHandler.

func (RevHandler) RevokeRaw added in v0.5.0

func (h RevHandler) RevokeRaw(ctx context.Context, rawSRevInfo common.RawBytes)

type RevNotification

type RevNotification struct {
	SRevInfo *path_mgmt.SignedRevInfo
}

func (*RevNotification) String added in v0.4.0

func (rN *RevNotification) String() string

type RevReply

type RevReply struct {
	Result RevResult
}

type RevResult

type RevResult uint16
const (
	RevValid RevResult = iota
	RevStale
	RevInvalid
	RevUnknown
)

func (RevResult) String

func (c RevResult) 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

func NewService(name string) Service

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

func (h TopoQuerier) OverlayAnycast(ctx context.Context, svc addr.HostSVC) (*net.UDPAddr, error)

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL