tun

package
v0.0.0-...-d687121 Latest Latest
Warning

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

Go to latest
Published: Apr 4, 2024 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	BufferSize = 1024 * 16
)
View Source
const (
	NumRedundantLinks = 3
)

Variables

View Source
var (
	ErrLookupFailed             = fmt.Errorf("tun: failed to lookup tunnel on specter network")
	ErrDestinationNotFound      = fmt.Errorf("tun: tunnel not found on specter network")
	ErrTunnelClientNotConnected = fmt.Errorf("tun: tunnel client is not connected to any nodes")
	ErrHostnameNotFound         = fmt.Errorf("tun: custom hostname is not registered")
)

Functions

func ALPN

func ALPN(a protocol.Link_ALPN) string

func ClientHostnamesPrefix

func ClientHostnamesPrefix(token *protocol.ClientToken) string

func ClientLeaseKey

func ClientLeaseKey(token *protocol.ClientToken) string

func ClientTokenKey

func ClientTokenKey(token *protocol.ClientToken) string

func CustomHostnameKey

func CustomHostnameKey(hostname string) string

func DestinationByChordKey

func DestinationByChordKey(chord *protocol.Node) string

func DestinationByTunnelKey

func DestinationByTunnelKey(tunnel *protocol.Node) string

func DrainStatusProto

func DrainStatusProto(src io.Reader) (err error)

func FindCustomHostname

func FindCustomHostname(ctx context.Context, kv chord.KV, hostname string) (*protocol.CustomHostname, error)

func IsNoDirect

func IsNoDirect(err error) bool

func IsTimeout

func IsTimeout(err error) bool

func Pipe

func Pipe(src, dst io.ReadWriteCloser) <-chan error

func RemoveCustomHostname

func RemoveCustomHostname(ctx context.Context, kv chord.KV, hostname string) error

func RoutingKey

func RoutingKey(hostname string, num int) string

func SaveCustomHostname

func SaveCustomHostname(ctx context.Context, kv chord.KV, hostname string, bundle *protocol.CustomHostname) (err error)

func SendStatusProto

func SendStatusProto(dest io.Writer, err error)

Types

type DNSResolver

type DNSResolver interface {
	LookupCNAME(ctx context.Context, host string) (string, error)
}

type Server

type Server interface {
	Identity() *protocol.Node
	DialClient(context.Context, *protocol.Link) (net.Conn, error)
	DialInternal(context.Context, *protocol.Node) (net.Conn, error)
}

Jump to

Keyboard shortcuts

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