link

package
v0.3.8 Latest Latest
Warning

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

Go to latest
Published: Mar 12, 2025 License: MIT Imports: 19 Imported by: 0

Documentation

Index

Constants

View Source
const (
	CURVE = "Curve25519"

	ESTABLISHMENT_TIMEOUT_PER_HOP = 6
	KEEPALIVE_TIMEOUT_FACTOR      = 4
	STALE_GRACE                   = 2
	KEEPALIVE                     = 360
	STALE_TIME                    = 720

	ACCEPT_NONE = 0x00
	ACCEPT_ALL  = 0x01
	ACCEPT_APP  = 0x02

	STATUS_PENDING = 0x00
	STATUS_ACTIVE  = 0x01
	STATUS_CLOSED  = 0x02
	STATUS_FAILED  = 0x03

	PROVE_NONE = 0x00
	PROVE_ALL  = 0x01
	PROVE_APP  = 0x02

	WATCHDOG_MIN_SLEEP = 0.025
	WATCHDOG_INTERVAL  = 0.1
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Link struct {
	// contains filtered or unexported fields
}
func NewLink(dest *destination.Destination, transport *transport.Transport, networkIface common.NetworkInterface, establishedCallback func(*Link), closedCallback func(*Link)) *Link

func (*Link) Establish

func (l *Link) Establish() error

func (*Link) GetAge

func (l *Link) GetAge() float64

func (*Link) GetEstablishmentRate

func (l *Link) GetEstablishmentRate() float64

func (*Link) GetQ

func (l *Link) GetQ() float64

func (*Link) GetRSSI

func (l *Link) GetRSSI() float64

func (*Link) GetRTT

func (l *Link) GetRTT() float64

func (*Link) GetRemoteIdentity

func (l *Link) GetRemoteIdentity() *identity.Identity

func (*Link) GetSNR

func (l *Link) GetSNR() float64

func (*Link) GetStatus

func (l *Link) GetStatus() byte

func (*Link) HandleIdentification

func (l *Link) HandleIdentification(data []byte) error

func (*Link) HandleInbound

func (l *Link) HandleInbound(data []byte) error

func (*Link) HandleProofRequest

func (l *Link) HandleProofRequest(packet *packet.Packet) bool

func (*Link) Identify

func (l *Link) Identify(id *identity.Identity) error

func (*Link) InactiveFor

func (l *Link) InactiveFor() float64

func (*Link) IsActive

func (l *Link) IsActive() bool

func (*Link) NoDataFor

func (l *Link) NoDataFor() float64

func (*Link) NoInboundFor

func (l *Link) NoInboundFor() float64

func (*Link) NoOutboundFor

func (l *Link) NoOutboundFor() float64

func (*Link) Request

func (l *Link) Request(path string, data []byte, timeout time.Duration) (*RequestReceipt, error)

func (*Link) SendPacket

func (l *Link) SendPacket(data []byte) error

func (*Link) SendResource

func (l *Link) SendResource(res *resource.Resource) error

func (*Link) SetLinkClosedCallback

func (l *Link) SetLinkClosedCallback(callback func(*Link))

func (*Link) SetPacketCallback

func (l *Link) SetPacketCallback(callback func([]byte, *packet.Packet))

func (*Link) SetProofCallback

func (l *Link) SetProofCallback(callback func(*packet.Packet) bool)

func (*Link) SetProofStrategy

func (l *Link) SetProofStrategy(strategy byte) error

func (*Link) SetRTT

func (l *Link) SetRTT(rtt float64)

func (*Link) SetRemoteIdentifiedCallback

func (l *Link) SetRemoteIdentifiedCallback(callback func(*Link, *identity.Identity))

func (*Link) SetResourceCallback

func (l *Link) SetResourceCallback(callback func(interface{}) bool)

func (*Link) SetResourceConcludedCallback

func (l *Link) SetResourceConcludedCallback(callback func(interface{}))

func (*Link) SetResourceStartedCallback

func (l *Link) SetResourceStartedCallback(callback func(interface{}))

func (*Link) SetResourceStrategy

func (l *Link) SetResourceStrategy(strategy byte) error

func (*Link) Start

func (l *Link) Start()

func (*Link) Teardown

func (l *Link) Teardown()

func (*Link) TrackPhyStats

func (l *Link) TrackPhyStats(track bool)

func (*Link) UpdatePhyStats

func (l *Link) UpdatePhyStats(rssi, snr, q float64)

type RequestReceipt

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

func (*RequestReceipt) Concluded

func (r *RequestReceipt) Concluded() bool

func (*RequestReceipt) GetRequestID

func (r *RequestReceipt) GetRequestID() []byte

func (*RequestReceipt) GetResponse

func (r *RequestReceipt) GetResponse() []byte

func (*RequestReceipt) GetResponseTime

func (r *RequestReceipt) GetResponseTime() float64

func (*RequestReceipt) GetStatus

func (r *RequestReceipt) GetStatus() byte

Jump to

Keyboard shortcuts

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