crew

package
v0.5.6 Latest Latest
Warning

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

Go to latest
Published: Dec 5, 2022 License: AGPL-3.0 Imports: 27 Imported by: 2 modules, 1 package

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

View Source
const ConnectOpType string = "connect"

ConnectOpType is the type ID for the connection operation.

Variables

This section is empty.

Functions

func ConnectErrors added in v0.4.4

func ConnectErrors() <-chan *terminal.Error

ConnectErrors returns errors of connect operations. It only has a small and shared buffer and may only be used for indications, not for full monitoring.

func EnableConnecting

func EnableConnecting(my *hub.Hub)

EnableConnecting enables connecting from this Hub.

func HandleSluiceRequest

func HandleSluiceRequest(connInfo *network.Connection, conn net.Conn)

HandleSluiceRequest handles a sluice request to build a tunnel.

Types

type ConnectOp

type ConnectOp struct {
	terminal.OpBase
	*terminal.DuplexFlowQueue
	// contains filtered or unexported fields
}

ConnectOp is used to connect data tunnels to servers on the Internet.

func NewConnectOp

func NewConnectOp(tunnel *Tunnel) (*ConnectOp, *terminal.Error)

NewConnectOp starts a new connect operation.

func (*ConnectOp) Abandon

func (op *ConnectOp) Abandon(err *terminal.Error)

Abandon ends the operation.

func (*ConnectOp) Ctx

func (op *ConnectOp) Ctx() context.Context

Ctx returns the operation context.

func (*ConnectOp) Deliver

func (op *ConnectOp) Deliver(c *container.Container) *terminal.Error

Deliver delivers a messages to the operation.

func (*ConnectOp) End

func (op *ConnectOp) End(err *terminal.Error) (errorToSend *terminal.Error)

End ends the operation.

func (*ConnectOp) FmtID

func (op *ConnectOp) FmtID() string

FmtID formats the operation ID.

func (*ConnectOp) Type

func (op *ConnectOp) Type() string

Type returns the type ID.

type ConnectRequest

type ConnectRequest struct {
	// TODO: Switch to json tags when everyone has the update.
	Domain              string            `cbor:"d,omitempty"`
	IP                  net.IP            `cbor:"ip,omitempty"`
	UsePriorityDataMsgs bool              `cbor:"pr,omitempty"`
	Protocol            packet.IPProtocol `cbor:"p,omitempty"`
	Port                uint16            `cbor:"po,omitempty"`
	QueueSize           uint32            `cbor:"qs,omitempty"`
}

ConnectRequest holds all the information necessary for a connect operation.

func (*ConnectRequest) Address

func (r *ConnectRequest) Address() string

Address returns the address of the connext request.

func (*ConnectRequest) String

func (r *ConnectRequest) String() string

type Tunnel

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

Tunnel represents the local information and endpoint of a data tunnel.

type TunnelContext added in v0.3.5

type TunnelContext struct {
	Path       []*TunnelContextHop
	PathCost   float32
	RoutingAlg string
	// contains filtered or unexported fields
}

TunnelContext holds additional information about the tunnel to be added to a connection.

func (*TunnelContext) GetExitNodeID added in v0.4.13

func (tc *TunnelContext) GetExitNodeID() string

GetExitNodeID returns the ID of the exit node. It returns an empty string in case no path exists.

func (*TunnelContext) StopTunnel added in v0.5.2

func (tc *TunnelContext) StopTunnel() error

StopTunnel stops the tunnel.

type TunnelContextHop added in v0.3.5

type TunnelContextHop struct {
	ID   string
	Name string
	IPv4 *TunnelContextHopIPInfo `json:",omitempty"`
	IPv6 *TunnelContextHopIPInfo `json:",omitempty"`
}

TunnelContextHop holds hop data for TunnelContext.

type TunnelContextHopIPInfo added in v0.3.5

type TunnelContextHopIPInfo struct {
	IP      net.IP
	Country string
	ASN     uint
	ASOwner string
}

TunnelContextHopIPInfo holds hop IP data for TunnelContextHop.

Jump to

Keyboard shortcuts

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