egress

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Jul 31, 2018 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// FIXME(kormat): these relative sizes will fail if there are lots of egress dispatchers.
	EgressFreePktsCap = 1024
	EgressBufPkts     = 32
)

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) String

func (r *RemoteInfo) String() string

type Runner

type Runner interface {
	Run()
}

Runner is implemented by objects that operate as goroutines.

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) ExpireFails

func (sp *SessPath) ExpireFails()

func (*SessPath) Fail

func (sp *SessPath) Fail()

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]*SessPath

func (SessPathPool) Get

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

Return the path with the fewest failures, excluding the current path (if specified).

func (SessPathPool) Update

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

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
	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
}

type SessionSet

type SessionSet map[mgmt.SessionType]Session

type WorkerFactory

type WorkerFactory func(Session, log.Logger) Runner

WorkerFactory build a worker for a specific session.

Directories

Path Synopsis
Package dispatcher reads from input ring buffer, decides on a Session and puts data on the ring buffer of the Session.
Package dispatcher reads from input ring buffer, decides on a Session and puts data on the ring buffer of the Session.
Package reader implements a reader object that reads from tun, routes with support from egress/router to determine the correct egressDispatcher, and puts data on the ring buffer of the egressDispatcher.
Package reader implements a reader object that reads from tun, routes with support from egress/router to determine the correct egressDispatcher, and puts data on the ring buffer of the egressDispatcher.
Package router implements an IPv4/IPv6 router.
Package router implements an IPv4/IPv6 router.
Package session monitors session health and maintains a concurrency-safe remote SIG address (that includes a working path) for each session.
Package session monitors session health and maintains a concurrency-safe remote SIG address (that includes a working path) for each session.
Package worker implements the logic for reading packets from a session's ring buffer, encapsulating them and writing them to the network as frames.
Package worker implements the logic for reading packets from a session's ring buffer, encapsulating them and writing them to the network as frames.

Jump to

Keyboard shortcuts

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