Documentation ¶
Overview ¶
Package segreq contains everything that is needed to handle segment requests in the path server. It relies on the segfetcher module and therefore has many helper types to use the segfetcher module.
Index ¶
Constants ¶
const ErrNoConnectivity common.ErrMsg = "no connectivity to remote PS"
ErrNoConnectivity indicates that connectivity to the remote PS is not available.
Variables ¶
This section is empty.
Functions ¶
func NewHandler ¶
func NewHandler(args handlers.HandlerArgs) infra.Handler
Types ¶
type BaseValidator ¶
type BaseValidator struct {
CoreChecker
}
BaseValidator is the base validation for all PSes.
func (*BaseValidator) Validate ¶
func (v *BaseValidator) Validate(ctx context.Context, r segfetcher.Request) error
Validate validates the request.
type CoreChecker ¶
type CoreChecker struct {
Inspector infra.ASInspector
}
CoreChecker checks whether a given ia is core.
type CoreLocalInfo ¶
type CoreLocalInfo struct { CoreChecker CoreChecker LocalIA addr.IA }
CoreLocalInfo implements local info for core PSes.
func (*CoreLocalInfo) IsParamsLocal ¶
func (i *CoreLocalInfo) IsParamsLocal(params *query.Params) bool
IsParamsLocal returns whether params is a core segment request.
func (*CoreLocalInfo) IsSegLocal ¶
IsSegLocal returns whether the segments described by src and dst would be a core segments or a local down segment.
type CoreValidator ¶
type CoreValidator struct {
BaseValidator
}
CoreValidator is the validator for core PSes.
func (*CoreValidator) Validate ¶
func (v *CoreValidator) Validate(ctx context.Context, r segfetcher.Request) error
Validate validates the request.
type LocalInfo ¶
type LocalInfo interface { IsSegLocal(ctx context.Context, src, dst addr.IA) (bool, error) IsParamsLocal(*query.Params) bool }
LocalInfo indicates whether something is always local.
type NonCoreLocalInfo ¶
NonCoreLocalInfo is the local info for non core PSes.
func (*NonCoreLocalInfo) IsParamsLocal ¶
func (i *NonCoreLocalInfo) IsParamsLocal(params *query.Params) bool
IsParamsLocal returns whether params is a up segments request.
func (*NonCoreLocalInfo) IsSegLocal ¶
IsSegLocal checks if the segment described by src and dst is an up segment to the local core.
type PathDB ¶
PathDB is a wrapper around the path db that handles retries and changes GetNextQuery behavior for usage in segfetcher.
func (*PathDB) Get ¶
Get implements the path db's get function. It retries the underlying connection for local segments. For example a non-core path server will retry for local up segments since there is a chance it will receive them from the beacon server. A core path server will retry on core segments since there is a chance it receives them from the beacon server.
type SegSelector ¶
SegSelector selects segments to use for a connection to a remote server.
func (*SegSelector) SelectSeg ¶
func (s *SegSelector) SelectSeg(ctx context.Context, params *query.Params) (*seg.PathSegment, error)
SelectSeg selects a suitable segment for the given path db query.
type Splitter ¶
type Splitter struct {
ASInspector infra.ASInspector
}
Splitter splits requests for the PS.
func (*Splitter) Split ¶
func (s *Splitter) Split(ctx context.Context, r segfetcher.Request) (segfetcher.RequestSet, error)
Source Files ¶
Directories ¶
Path | Synopsis |
---|---|
Package mock_segreq is a generated GoMock package.
|
Package mock_segreq is a generated GoMock package. |