iface

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Nov 14, 2019 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Overview

iface contains interfaces that different components within egress use to communicate.

Index

Constants

View Source
const (
	// FIXME(kormat): these relative sizes will fail if there are lots of egress dispatchers.
	EgressFreePktsCap = 2048
	EgressRemotePkts  = 512
	EgressBufPkts     = 32
	SafetyInterval    = 60 * time.Second
)

Variables

View Source
var EgressFreePkts *ringbuf.Ring

Functions

func Init

func Init()

Types

type PathPool

type PathPool interface {
	// Paths returns the paths contained in the pool.
	Paths() spathmeta.AppPathSet
	// Destroy cleans up any resources associated with the PathPool.
	Destroy() error
}

PathPool is implemented by objects that maintain sets of paths. PathPools must be safe for concurrent use by multiple goroutines.

type RemoteInfo

type RemoteInfo struct {
	Sig      *siginfo.Sig
	SessPath *SessPath
}

func (*RemoteInfo) Copy

func (r *RemoteInfo) Copy() *RemoteInfo

Copy created a deep copy of the object.

func (*RemoteInfo) String

func (r *RemoteInfo) String() string

type SessPath

type SessPath struct {
	// contains filtered or unexported fields
}

A SessPath contains a path and metadata related to path health.

func NewSessPath

func NewSessPath(key spathmeta.PathKey, pathEntry *sciond.PathReplyEntry) *SessPath

func (*SessPath) Copy

func (sp *SessPath) Copy() *SessPath

func (*SessPath) IsCloseToExpiry

func (sp *SessPath) IsCloseToExpiry() bool

func (*SessPath) Key

func (sp *SessPath) Key() spathmeta.PathKey

func (*SessPath) PathEntry

func (sp *SessPath) PathEntry() *sciond.PathReplyEntry

func (*SessPath) String

func (sp *SessPath) String() string

type SessPathPool

type SessPathPool map[spathmeta.PathKey]*SessPathStats

func NewSessPathPool

func NewSessPathPool() *SessPathPool

func (SessPathPool) ExpireFails

func (spp SessPathPool) ExpireFails()

func (SessPathPool) Get

func (spp SessPathPool) Get(exclude spathmeta.PathKey) *SessPath

Get returns the most suitable path. Excludes a specific path, if possible.

func (SessPathPool) GetByKey

func (spp SessPathPool) GetByKey(key spathmeta.PathKey) *SessPath

func (SessPathPool) PathCount

func (spp SessPathPool) PathCount() int

func (SessPathPool) Reply

func (spp SessPathPool) Reply(path *SessPath, sent time.Time)

Reply is called when a probe reply arrives. 'sent' is the time when the original probe was sent.

func (SessPathPool) Timeout

func (spp SessPathPool) Timeout(path *SessPath, sent time.Time)

Timeout is called when a reply to a probe is not received in time. 'sent' is the time when the original probe was sent.

func (SessPathPool) Update

func (spp SessPathPool) Update(aps spathmeta.AppPathSet)

type SessPathStats

type SessPathStats struct {
	SessPath *SessPath
	// contains filtered or unexported fields
}

func NewSessPathStats

func NewSessPathStats(key spathmeta.PathKey, pathEntry *sciond.PathReplyEntry) *SessPathStats

type Session

type Session interface {
	// Logger defines common logging primitives
	log.Logger
	// IA returns the session's remote IA
	IA() addr.IA
	// ID returns the session's ID.
	ID() mgmt.SessionType
	// Conn returns the session's outbound snet Conn.
	// The returned value must be the same for the entire lifetime of the object.
	Conn() snet.Conn
	// Ring returns the session's ring buffer.
	Ring() *ringbuf.Ring
	// Remote returns the session's currently chosen SIG and path.
	Remote() *RemoteInfo
	// Cleanup shuts down the session and cleans resources.
	Cleanup() error
	// Healthy returns true if the session has a remote SIG and is receiving
	// keepalive responses from it.
	Healthy() bool
	// PathPool returns the session's available pool of paths.
	PathPool() PathPool
	// AnnounceWorkerStopped is used to inform the session that its worker needed to shut down.
	AnnounceWorkerStopped()
}

Session defines a stateful context for sending traffic to a remote AS.

type SessionSelector

type SessionSelector interface {
	ChooseSess(b common.RawBytes) Session
}

Directories

Path Synopsis
Package mock_iface is a generated GoMock package.
Package mock_iface is a generated GoMock package.

Jump to

Keyboard shortcuts

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