endpoint

package
v0.0.0-...-3af4ba0 Latest Latest
Warning

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

Go to latest
Published: Dec 27, 2023 License: GPL-3.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrNoPeerConnected = fmt.Errorf("没有连接到任一节点")
View Source
var ProtocolID = protocol.ID("/wireguard/tunnel")

Functions

This section is empty.

Types

type Endpoint

type Endpoint struct {
	network.Stream
}

func New

func New(stream network.Stream) *Endpoint

func (*Endpoint) ClearSrc

func (ep *Endpoint) ClearSrc()

func (*Endpoint) DstIP

func (ep *Endpoint) DstIP() netip.Addr

func (*Endpoint) DstToBytes

func (ep *Endpoint) DstToBytes() []byte

used for mac2 cookie calculations

func (*Endpoint) DstToString

func (ep *Endpoint) DstToString() string

func (*Endpoint) SrcIP

func (ep *Endpoint) SrcIP() netip.Addr

func (*Endpoint) SrcToString

func (ep *Endpoint) SrcToString() string

type Outboud

type Outboud struct {
	Endpoint
	RDGetter
	// contains filtered or unexported fields
}

func NewOutbound

func NewOutbound(rd RDGetter, pubkey string) *Outboud

func (*Outboud) Connect

func (ep *Outboud) Connect() (err error)

func (*Outboud) DstToBytes

func (ep *Outboud) DstToBytes() []byte

func (*Outboud) Messages

func (ep *Outboud) Messages() <-chan []byte

func (*Outboud) Send

func (ep *Outboud) Send(buf []byte) (err error)

type RDGetter

type RDGetter interface {
	GetRoutingDiscovery() *drouting.RoutingDiscovery
	GetHost() host.Host
}

type Sender

type Sender interface {
	Send(buf []byte) error
}

Jump to

Keyboard shortcuts

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