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 ¶
- func NewFetcher(cfg FetcherConfig) *segfetcher.Fetcher
- func NewRouter(cfg FetcherConfig) snet.Router
- func NewSplitter(ia addr.IA, core bool, inspector trust.Inspector, pathDB pathdb.DB) segfetcher.Splitter
- type AuthoritativeLookup
- type CoreChecker
- type FetcherConfig
- type ForwardingLookup
- type Pather
- type SegSelector
- type WildcardExpander
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewFetcher ¶
func NewFetcher(cfg FetcherConfig) *segfetcher.Fetcher
NewFetcher creates a segment fetcher configured for fetching segments from inside the control service
func NewRouter ¶
func NewRouter(cfg FetcherConfig) snet.Router
NewRouter creates a new Router/Pather/Fetcher, configured for obtaining paths from inside the control service
Types ¶
type AuthoritativeLookup ¶
type AuthoritativeLookup struct { LocalIA addr.IA CoreChecker CoreChecker PathDB pathdb.DB }
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 ¶
func (a AuthoritativeLookup) LookupSegments(ctx context.Context, src, dst addr.IA) (segfetcher.Segments, error)
type CoreChecker ¶
CoreChecker checks whether a given ia is core.
type FetcherConfig ¶
type FetcherConfig struct { IA addr.IA MTU uint16 Core bool NextHopper interface { UnderlayNextHop(uint16) *net.UDPAddr } 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.DB // RevCache is the revocation cache to use. RevCache revcache.RevCache // RPC is the RPC used to request segments. RPC segfetcher.RPC }
type ForwardingLookup ¶
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 ¶
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 SegSelector ¶
SegSelector selects segments to use for a connection to a remote server.
type WildcardExpander ¶
type WildcardExpander struct { LocalIA addr.IA Core bool Inspector trust.Inspector PathDB pathdb.DB }
func (*WildcardExpander) ExpandSrcWildcard ¶
func (e *WildcardExpander) ExpandSrcWildcard(ctx context.Context, req segfetcher.Request) (segfetcher.Requests, error)