message

package
v0.2.2 Latest Latest
Warning

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

Go to latest
Published: Nov 3, 2023 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (

	// traffic data
	MessageTypePacket = 0
	// routing info
	MessageTypeRouting = 1
	// routing
	RoutingRegisterFailed = 2
	RoutingRegisterAck    = 3
	// ttl
	PacketTTL = 32
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Message

type Message struct {
	Type    int
	Payload interface{}
}

wire message

func (*Message) Decode

func (m *Message) Decode(buf []byte) error

decode from bytes

func (*Message) Encode

func (m *Message) Encode() ([]byte, error)

encode to bytes

func (*Message) Split

func (m *Message) Split() ([]Message, error)

split routing message into multiple small messages

type Packet

type Packet struct {
	// dst
	Dst net.IP
	// src
	Src net.IP
	// ttl
	TTL int
	// the real ip packet
	Data []byte
}

packet of network traffic

type Routing

type Routing struct {
	// type
	Type int
	// peer's provided routings
	Routings []RoutingEntry
	// message
	Message string
}

routing register msg

type RoutingEntry

type RoutingEntry struct {
	// network
	Network net.IPNet
	// metric
	Metric int
	// Rtt
	Rtt int
	// origin
	Origin string
	// name
	Name string
}

routing entry

Jump to

Keyboard shortcuts

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