announce

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Dec 30, 2025 License: 0BSD Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	PACKET_TYPE_DATA     = 0x00
	PACKET_TYPE_ANNOUNCE = 0x01
	PACKET_TYPE_LINK     = 0x02
	PACKET_TYPE_PROOF    = 0x03

	// Announce Types
	ANNOUNCE_NONE     = 0x00
	ANNOUNCE_PATH     = 0x01
	ANNOUNCE_IDENTITY = 0x02

	// Header Types
	HEADER_TYPE_1 = 0x00 // One address field
	HEADER_TYPE_2 = 0x01 // Two address fields

	// Propagation Types
	PROP_TYPE_BROADCAST = 0x00
	PROP_TYPE_TRANSPORT = 0x01

	DEST_TYPE_SINGLE = 0x00
	DEST_TYPE_GROUP  = 0x01
	DEST_TYPE_PLAIN  = 0x02
	DEST_TYPE_LINK   = 0x03

	// IFAC Flag
	IFAC_NONE = 0x00
	IFAC_AUTH = 0x80

	MAX_HOPS         = 128
	PROPAGATION_RATE = 0.02 // 2% of interface bandwidth
	RETRY_INTERVAL   = 300  // 5 minutes
	MAX_RETRIES      = 3
)

Variables

This section is empty.

Functions

func CreateHeader

func CreateHeader(ifacFlag byte, headerType byte, contextFlag byte, propType byte, destType byte, packetType byte, hops byte) []byte

CreateHeader creates a Reticulum packet header according to spec

Types

type Announce

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

func New

func New(dest *identity.Identity, destinationHash []byte, destinationName string, appData []byte, pathResponse bool, config *common.ReticulumConfig) (*Announce, error)

func NewAnnounce

func NewAnnounce(identity *identity.Identity, destinationHash []byte, appData []byte, ratchetID []byte, pathResponse bool, config *common.ReticulumConfig) (*Announce, error)

NewAnnounce creates a new announce packet for a destination

func (*Announce) CreatePacket

func (a *Announce) CreatePacket() []byte

func (*Announce) DeregisterHandler

func (a *Announce) DeregisterHandler(handler AnnounceHandler)

func (*Announce) GetPacket

func (a *Announce) GetPacket() []byte

func (*Announce) HandleAnnounce

func (a *Announce) HandleAnnounce(data []byte) error

func (*Announce) Hash

func (a *Announce) Hash() []byte

func (*Announce) Propagate

func (a *Announce) Propagate(interfaces []common.NetworkInterface) error

func (*Announce) RegisterHandler

func (a *Announce) RegisterHandler(handler AnnounceHandler)

func (*Announce) RequestPath

func (a *Announce) RequestPath(destHash []byte, onInterface common.NetworkInterface) error

type AnnounceHandler

type AnnounceHandler interface {
	AspectFilter() []string
	ReceivedAnnounce(destinationHash []byte, announcedIdentity interface{}, appData []byte) error
	ReceivePathResponses() bool
}

type AnnouncePacket

type AnnouncePacket struct {
	Data []byte
}

func NewAnnouncePacket

func NewAnnouncePacket(pubKey []byte, appData []byte, announceID []byte) *AnnouncePacket

type Handler

type Handler interface {
	AspectFilter() []string
	ReceivedAnnounce(destHash []byte, identity interface{}, appData []byte) error
	ReceivePathResponses() bool
}

Jump to

Keyboard shortcuts

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