packetaddr

package
v5.57.2 Latest Latest
Warning

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

Go to latest
Published: Nov 30, 2026 License: MIT Imports: 18 Imported by: 2 modules, 9 packages

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

This section is empty.

Variables

View Source
var (
	PacketAddrType_name = map[int32]string{
		0: "None",
		1: "Packet",
		2: "Stream",
	}
	PacketAddrType_value = map[string]int32{
		"None":   0,
		"Packet": 1,
		"Stream": 2,
	}
)

Enum value maps for PacketAddrType.

View Source
var File_common_net_packetaddr_config_proto protoreflect.FileDescriptor

Functions

func AttachAddressToPacket

func AttachAddressToPacket(data *buf.Buffer, address gonet.Addr) (*buf.Buffer, error)

AttachAddressToPacket relinquish ownership of data gain ownership of the returning value

func AttachLengthToPacket added in v5.53.0

func AttachLengthToPacket(data *buf.Buffer) (*buf.Buffer, error)

AttachLengthToPacket prefixes a packetaddr segment with its big-endian uint16 length. relinquish ownership of data gain ownership of the returning value

func CreatePacketAddrConn

func CreatePacketAddrConn(ctx context.Context, dispatcher routing.Dispatcher, isStream bool) (net.PacketConn, error)

func ExtractAddressFromPacket

func ExtractAddressFromPacket(data *buf.Buffer) (*buf.Buffer, gonet.Addr, error)

ExtractAddressFromPacket relinquish ownership of data gain ownership of the returning value

func ExtractPacketFromStream added in v5.53.0

func ExtractPacketFromStream(reader io.Reader) (*buf.Buffer, error)

func GetDestinationSubsetOf

func GetDestinationSubsetOf(dest net.Destination) (bool, error)

func ToPacketAddrConn

func ToPacketAddrConn(link *transport.Link, dest net.Destination) (net.PacketConn, error)

Types

type FusedConnection

type FusedConnection interface {
	net.PacketConn
	net.Conn
}

func ToPacketAddrConnWrapper

func ToPacketAddrConnWrapper(conn net.PacketConn, isStream bool) FusedConnection

type PacketAddrType

type PacketAddrType int32
const (
	PacketAddrType_None   PacketAddrType = 0
	PacketAddrType_Packet PacketAddrType = 1
	PacketAddrType_Stream PacketAddrType = 2
)

func (PacketAddrType) Descriptor

func (PacketAddrType) Enum

func (x PacketAddrType) Enum() *PacketAddrType

func (PacketAddrType) EnumDescriptor deprecated

func (PacketAddrType) EnumDescriptor() ([]byte, []int)

Deprecated: Use PacketAddrType.Descriptor instead.

func (PacketAddrType) Number

func (PacketAddrType) String

func (x PacketAddrType) String() string

func (PacketAddrType) Type

Jump to

Keyboard shortcuts

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