discovery

package
v0.9.1 Latest Latest
Warning

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

Go to latest
Published: May 20, 2022 License: GPL-3.0 Imports: 11 Imported by: 0

Documentation

Overview

Package discovery contains code for peer/neighbor discovery of other DTN nodes through UDP multicast packages.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MarshalAnnouncements

func MarshalAnnouncements(announcements []Announcement) (data []byte, err error)

MarshalAnnouncements into a CBOR byte string.

Types

type Announcement

type Announcement struct {
	Type     cla.CLAType
	Endpoint bpv7.EndpointID
	Port     uint
}

Announcement of some node's CLA.

func UnmarshalAnnouncements

func UnmarshalAnnouncements(data []byte) (announcements []Announcement, err error)

UnmarshalAnnouncements creates a new array of Announcement based on a CBOR byte string.

func (*Announcement) MarshalCbor

func (announcement *Announcement) MarshalCbor(w io.Writer) error

MarshalCbor creates a CBOR representation for an Announcement.

func (Announcement) String

func (announcement Announcement) String() string

func (*Announcement) UnmarshalCbor

func (announcement *Announcement) UnmarshalCbor(r io.Reader) error

UnmarshalCbor creates an Announcement from its CBOR representation.

type Manager

type Manager struct {
	NodeId       bpv7.EndpointID
	RegisterFunc func(cla.Convergable) `json:"-"`
	// contains filtered or unexported fields
}

Manager publishes and receives Announcements.

func NewManager

func NewManager(
	nodeId bpv7.EndpointID, registerFunc func(cla.Convergable),
	announcements []Announcement, announcementInterval time.Duration,
	ipv4, ipv6 bool) (*Manager, error)

NewManager for Announcements will be created and started.

func (*Manager) Close

func (manager *Manager) Close()

Close this Manager.

func (*Manager) String

func (manager *Manager) String() string

Jump to

Keyboard shortcuts

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