header

package
v0.0.0-...-69b9976 Latest Latest
Warning

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

Go to latest
Published: Mar 18, 2024 License: BSD-3-Clause Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const (
	HeaderVersion        = 1
	HeaderLen            = 16
	HeaderPadding uint16 = 0xfeed
)
View Source
const (
	None      uint8 = 0
	Handshake uint8 = 1
	Data      uint8 = 2
	Reset     uint8 = 3 // Redundant?
	Rekey     uint8 = 4
	Close     uint8 = 5
	Discovery uint8 = 6
	Punch     uint8 = 0xff
)

Message Types

Variables

This section is empty.

Functions

This section is empty.

Types

type Header struct {
	Version     uint8
	Type        uint8
	SenderIndex uint32
	Counter     uint64
	Padding     uint16
}

func NewHeader

func NewHeader() *Header

func (*Header) Encode

func (h *Header) Encode(b []byte, t uint8, index uint32, counter uint64) ([]byte, error)

func (*Header) Parse

func (h *Header) Parse(b []byte) error

func (*Header) Reset

func (h *Header) Reset()

func (*Header) String

func (h *Header) String() string

Jump to

Keyboard shortcuts

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