Documentation
¶
Index ¶
- Constants
- type Link
- func (l *Link) Establish() error
- func (l *Link) GenerateLinkProof(ownerIdentity *identity.Identity) (*packet.Packet, error)
- func (l *Link) GetAge() float64
- func (l *Link) GetChannel() *channel.Channel
- func (l *Link) GetEstablishmentRate() float64
- func (l *Link) GetLinkID() []byte
- func (l *Link) GetQ() float64
- func (l *Link) GetRSSI() float64
- func (l *Link) GetRTT() float64
- func (l *Link) GetRemoteIdentity() *identity.Identity
- func (l *Link) GetSNR() float64
- func (l *Link) GetStatus() byte
- func (l *Link) HandleIdentification(data []byte) error
- func (l *Link) HandleInbound(pkt *packet.Packet) error
- func (l *Link) HandleLinkRequest(pkt *packet.Packet, ownerIdentity *identity.Identity) error
- func (l *Link) HandleProofRequest(packet *packet.Packet) bool
- func (l *Link) Identify(id *identity.Identity) error
- func (l *Link) InactiveFor() float64
- func (l *Link) IsActive() bool
- func (l *Link) NoDataFor() float64
- func (l *Link) NoInboundFor() float64
- func (l *Link) NoOutboundFor() float64
- func (l *Link) RTT() float64
- func (l *Link) Request(path string, data []byte, timeout time.Duration) (*RequestReceipt, error)
- func (l *Link) Resend(pkt interface{}) error
- func (l *Link) Send(data []byte) interface{}
- func (l *Link) SendLinkRequest() error
- func (l *Link) SendPacket(data []byte) error
- func (l *Link) SendResource(res *resource.Resource) error
- func (l *Link) SetLinkClosedCallback(callback func(*Link))
- func (l *Link) SetPacketCallback(callback func([]byte, *packet.Packet))
- func (l *Link) SetPacketDelivered(pkt interface{}, callback func(interface{}))
- func (l *Link) SetPacketTimeout(pkt interface{}, callback func(interface{}), timeout time.Duration)
- func (l *Link) SetProofCallback(callback func(*packet.Packet) bool)
- func (l *Link) SetProofStrategy(strategy byte) error
- func (l *Link) SetRTT(rtt float64)
- func (l *Link) SetRemoteIdentifiedCallback(callback func(*Link, *identity.Identity))
- func (l *Link) SetResourceCallback(callback func(interface{}) bool)
- func (l *Link) SetResourceConcludedCallback(callback func(interface{}))
- func (l *Link) SetResourceStartedCallback(callback func(interface{}))
- func (l *Link) SetResourceStrategy(strategy byte) error
- func (l *Link) Start()
- func (l *Link) Teardown()
- func (l *Link) TrackPhyStats(track bool)
- func (l *Link) UpdatePhyStats(rssi, snr, q float64)
- func (l *Link) Validate(signature, message []byte) bool
- func (l *Link) ValidateLinkProof(pkt *packet.Packet, networkIface common.NetworkInterface) error
- type RequestReceipt
- func (r *RequestReceipt) Concluded() bool
- func (r *RequestReceipt) GetRequestID() []byte
- func (r *RequestReceipt) GetResponse() []byte
- func (r *RequestReceipt) GetResponseTime() float64
- func (r *RequestReceipt) GetStatus() byte
- func (r *RequestReceipt) SetFailedCallback(cb func(*RequestReceipt))
- func (r *RequestReceipt) SetProgressCallback(cb func(*RequestReceipt))
- func (r *RequestReceipt) SetResponseCallback(cb func(*RequestReceipt))
Constants ¶
View Source
const ( CURVE = "Curve25519" ECPUBSIZE = 64 KEYSIZE = 32 LINK_MTU_SIZE = 3 MTU_BYTEMASK = 0xFFFFFF MODE_BYTEMASK = 0xE0 ESTABLISHMENT_TIMEOUT_PER_HOP = 6 KEEPALIVE_TIMEOUT_FACTOR = 4 STALE_GRACE = 2 KEEPALIVE = 360 STALE_TIME = 720 TRAFFIC_TIMEOUT_FACTOR = 6 ACCEPT_NONE = 0x00 ACCEPT_ALL = 0x01 ACCEPT_APP = 0x02 STATUS_PENDING = 0x00 STATUS_HANDSHAKE = 0x01 STATUS_ACTIVE = 0x02 STATUS_STALE = 0x03 STATUS_CLOSED = 0x04 STATUS_FAILED = 0x05 PROVE_NONE = 0x00 PROVE_ALL = 0x01 PROVE_APP = 0x02 MODE_AES128_CBC = 0x00 MODE_AES256_CBC = 0x01 MODE_DEFAULT = MODE_AES256_CBC WATCHDOG_MIN_SLEEP = 0.025 WATCHDOG_INTERVAL = 0.1 DEST_TYPE_LINK = 0x03 MIN_REQUEST_DATA_LEN = 3 MIN_RESPONSE_DATA_LEN = 2 )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Link ¶
type Link struct {
// contains filtered or unexported fields
}
func HandleIncomingLinkRequest ¶
func HandleIncomingLinkRequest(pkt *packet.Packet, dest *destination.Destination, transport *transport.Transport, networkIface common.NetworkInterface) (*Link, error)
func NewLink ¶
func NewLink(dest *destination.Destination, transport *transport.Transport, networkIface common.NetworkInterface, establishedCallback func(*Link), closedCallback func(*Link)) *Link
func (*Link) GenerateLinkProof ¶
func (*Link) GetChannel ¶
func (*Link) GetEstablishmentRate ¶
func (*Link) GetRemoteIdentity ¶
func (*Link) HandleIdentification ¶
func (*Link) HandleLinkRequest ¶
func (*Link) InactiveFor ¶
func (*Link) NoInboundFor ¶
func (*Link) NoOutboundFor ¶
func (*Link) SendLinkRequest ¶
func (*Link) SendPacket ¶
func (*Link) SetLinkClosedCallback ¶
func (*Link) SetPacketCallback ¶
func (*Link) SetPacketDelivered ¶
func (l *Link) SetPacketDelivered(pkt interface{}, callback func(interface{}))
func (*Link) SetPacketTimeout ¶
func (*Link) SetProofStrategy ¶
func (*Link) SetRemoteIdentifiedCallback ¶
func (*Link) SetResourceCallback ¶
func (*Link) SetResourceConcludedCallback ¶
func (l *Link) SetResourceConcludedCallback(callback func(interface{}))
func (*Link) SetResourceStartedCallback ¶
func (l *Link) SetResourceStartedCallback(callback func(interface{}))
func (*Link) SetResourceStrategy ¶
func (*Link) TrackPhyStats ¶
func (*Link) UpdatePhyStats ¶
func (*Link) ValidateLinkProof ¶
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
func (*RequestReceipt) SetFailedCallback ¶
func (r *RequestReceipt) SetFailedCallback(cb func(*RequestReceipt))
func (*RequestReceipt) SetProgressCallback ¶
func (r *RequestReceipt) SetProgressCallback(cb func(*RequestReceipt))
func (*RequestReceipt) SetResponseCallback ¶
func (r *RequestReceipt) SetResponseCallback(cb func(*RequestReceipt))
Click to show internal directories.
Click to hide internal directories.