packet

package
v0.20.6 Latest Latest
Warning

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

Go to latest
Published: Aug 16, 2023 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (

	// PeerKeyHashSize - constant for peer key hash size
	PeerKeyHashSize = 16

	// MessageProxyTransportSize - constant for proxy transport message size
	MessageProxyTransportSize = 36

	// MessageProxyTransportType - constant for proxy transport message
	MessageProxyTransportType MessageType = 6

	// constant for proxy server buffer size
	DefaultBodySize = 65000 + MessageProxyTransportSize
)

Variables

This section is empty.

Functions

func ExtractInfo

func ExtractInfo(buffer []byte, n int) (int, string, string, error)

ExtractInfo - extracts proxy transport message from the data buffer

func ProcessPacketBeforeSending

func ProcessPacketBeforeSending(buf []byte, n int, srckey, dstKey string) ([]byte, int, string, string)

ProcessPacketBeforeSending - encodes data required for proxy transport message

Types

type MessageType

type MessageType uint32

MessageType - custom type for message type

type ProxyMessage

type ProxyMessage struct {
	Type     MessageType
	Sender   [PeerKeyHashSize]byte
	Reciever [PeerKeyHashSize]byte
}

ProxyMessage - struct for proxy message

Jump to

Keyboard shortcuts

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