messages

package
v0.0.0-...-3697f30 Latest Latest
Warning

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

Go to latest
Published: Oct 9, 2024 License: BSD-3-Clause Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ISUDP  = 1
	ISIPV4 = 1 << 1
	ISIPV6 = 1 << 2

	IPADDRSIZE = 16
)

Variables

This section is empty.

Functions

This section is empty.

Types

type ErrNotUdp

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

func (ErrNotUdp) Error

func (e ErrNotUdp) Error() string

type TunnelMessage

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

/ For UDP we need to convey additional info - so put a header in the packet that goes down the tunnel

func NewTunnelMessage

func NewTunnelMessage(bufsize int) *TunnelMessage

func (*TunnelMessage) Read

func (t *TunnelMessage) Read(data []byte) (msgdata []byte, needmore bool, addr *net.UDPAddr, nextmsgoffset int, err error)

// If need more is set, read in more data and pass this current data + the new data in again

func (*TunnelMessage) Write

func (t *TunnelMessage) Write(data []byte, from *net.UDPAddr) (fullmsg []byte)

Jump to

Keyboard shortcuts

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