segreq

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Dec 4, 2020 License: Apache-2.0 Imports: 20 Imported by: 0

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

This section is empty.

Variables

This section is empty.

Functions

func NewFetcher added in v0.6.0

func NewFetcher(cfg FetcherConfig) *segfetcher.Fetcher

NewFetcher creates a segment fetcher configured for fetching segments from inside the control service

func NewRouter added in v0.6.0

func NewRouter(cfg FetcherConfig) snet.Router

NewRouter creates a new Router/Pather/Fetcher, configured for obtaining paths from inside the control service

func NewSplitter added in v0.6.0

func NewSplitter(ia addr.IA, core bool, inspector trust.Inspector,
	pathDB pathdb.PathDB) segfetcher.Splitter

NewSplitter creates a segfetcher.Splitter for a segfetcher.Pather used in the path service.

Types

type AuthoritativeLookup added in v0.6.0

type AuthoritativeLookup struct {
	LocalIA     addr.IA
	CoreChecker CoreChecker
	PathDB      pathdb.PathDB
}

AuthoritativeLookup handles path segment lookup requests in a core AS. It only returns down and core segments starting at this core AS. It should only be used in a core AS.

func (AuthoritativeLookup) LookupSegments added in v0.6.0

func (a AuthoritativeLookup) LookupSegments(ctx context.Context, src,
	dst addr.IA) (segfetcher.Segments, error)

type CoreChecker

type CoreChecker struct {
	Inspector trust.Inspector
}

CoreChecker checks whether a given ia is core.

func (*CoreChecker) IsCore

func (c *CoreChecker) IsCore(ctx context.Context, ia addr.IA) (bool, error)

IsCore checks whether ia is a wildcard or core

type FetcherConfig added in v0.6.0

type FetcherConfig struct {
	IA           addr.IA
	TopoProvider topology.Provider
	Inspector    trust.Inspector

	// QueryInterval specifies after how much time segments should be
	// refetched at the remote server.
	QueryInterval time.Duration
	// Verifier is the verifier to use.
	Verifier infra.Verifier
	// PathDB is the path db to use.
	PathDB pathdb.PathDB
	// RevCache is the revocation cache to use.
	RevCache revcache.RevCache
	// RPC is the RPC used to request segments.
	RPC segfetcher.RPC
}

type ForwardingLookup added in v0.6.0

type ForwardingLookup struct {
	LocalIA     addr.IA
	CoreChecker CoreChecker
	Fetcher     *segfetcher.Fetcher
	Expander    WildcardExpander
}

ForwardingLookup handles path segment lookup requests in a non-core AS. If segments are missing, the request is forwarded to the respective core ASes. It should only be used in a non-core AS.

func (ForwardingLookup) LookupSegments added in v0.6.0

func (f ForwardingLookup) LookupSegments(ctx context.Context, src,
	dst addr.IA) (segfetcher.Segments, error)

LookupSegments looks up the segments for the given request

  • requests for up segment are answered directly, from the local DB
  • down and core segments are forwarded to the responsible core ASes, and results are cached

type Pather added in v0.6.0

type Pather interface {
	GetPath(svc addr.HostSVC, ps *seg.PathSegment) (*snet.SVCAddr, error)
}

Pather computes the remote address with a path based on the provided segment.

type SegSelector

type SegSelector struct {
	PathDB       pathdb.PathDB
	RevCache     revcache.RevCache
	TopoProvider topology.Provider
	Pather       Pather
}

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) (snet.Path, error)

SelectSeg selects a suitable segment for the given path db query.

type WildcardExpander added in v0.6.0

type WildcardExpander struct {
	LocalIA   addr.IA
	Core      bool
	Inspector trust.Inspector
	PathDB    pathdb.PathDB
}

func (*WildcardExpander) ExpandSrcWildcard added in v0.6.0

func (e *WildcardExpander) ExpandSrcWildcard(ctx context.Context,
	req segfetcher.Request) (segfetcher.Requests, error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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