Documentation
¶
Overview ¶
Package datagram owns WireGuard-facing UDP endpoint behavior.
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // ErrNoLocalPeer indicates that no WireGuard process has sent a local datagram yet. ErrNoLocalPeer = errors.New("no local UDP peer") // ErrDatagramDropped indicates a per-datagram rejection or failure that does not invalidate the UDP endpoint. ErrDatagramDropped = errors.New("UDP datagram dropped") )
Functions ¶
This section is empty.
Types ¶
type Endpoint ¶
type Endpoint interface {
// Read returns one accepted packet with a caller-owned payload. Read calls on the same endpoint must not overlap.
Read(context.Context) (Packet, error)
// Write synchronously delivers one accepted WireGuard packet before deadline, or only the context deadline when
// deadline is zero. It must not retain payload after returning.
Write(context.Context, []byte, time.Time) error
Close() error
}
Endpoint reads and writes one side of a WireHop UDP relay session.
type Local ¶
type Local struct {
// contains filtered or unexported fields
}
Local is a client UDP listener that tracks the latest valid local WireGuard source.
func ListenLocal ¶
ListenLocal binds a client UDP listener.
type Remote ¶
type Remote struct {
// contains filtered or unexported fields
}
Remote is a server-side logical target with DNS candidates and WireGuard index affinity.
func OpenRemote ¶
func OpenRemote(parent context.Context, endpoint target.Endpoint, resolver target.Resolver) (*Remote, error)
OpenRemote resolves target and opens the required per-family UDP sockets.
Click to show internal directories.
Click to hide internal directories.