Documentation
¶
Index ¶
- Constants
- type Packet
- type PacketConfig
- type PacketReceipt
- func (pr *PacketReceipt) Cancel()
- func (pr *PacketReceipt) GetHash() []byte
- func (pr *PacketReceipt) GetRTT() time.Duration
- func (pr *PacketReceipt) GetStatus() byte
- func (pr *PacketReceipt) IsDelivered() bool
- func (pr *PacketReceipt) IsFailed() bool
- func (pr *PacketReceipt) IsTimedOut() bool
- func (pr *PacketReceipt) SetDeliveryCallback(callback func(*PacketReceipt))
- func (pr *PacketReceipt) SetDestinationIdentity(ident *identity.Identity)
- func (pr *PacketReceipt) SetLink(link interface{})
- func (pr *PacketReceipt) SetTimeout(timeout time.Duration)
- func (pr *PacketReceipt) SetTimeoutCallback(callback func(*PacketReceipt))
- func (pr *PacketReceipt) ValidateLinkProof(proof []byte, link interface{}, proofPacket *Packet) bool
- func (pr *PacketReceipt) ValidateProof(proof []byte, proofPacket *Packet) bool
- func (pr *PacketReceipt) ValidateProofPacket(proofPacket *Packet) bool
Constants ¶
View Source
const ( // MTU constants EncryptedMDU = 383 // Maximum size of payload data in encrypted packet PlainMDU = 464 // Maximum size of payload data in unencrypted packet // Propagation Types PropagationBroadcast = 0 PropagationTransport = 1 // Destination Types DestinationSingle = 0 DestinationGroup = 1 DestinationPlain = 2 DestinationLink = 3 // Minimum packet sizes MinAnnounceSize = 170 // header(2) + desthash(16) + context(1) + enckey(32) + signkey(32) + )
View Source
const ( // Packet Types PacketTypeData = 0x00 PacketTypeAnnounce = 0x01 PacketTypeLinkReq = 0x02 PacketTypeProof = 0x03 // Header Types HeaderType1 = 0x00 HeaderType2 = 0x01 // Context Types ContextNone = 0x00 ContextResource = 0x01 ContextResourceAdv = 0x02 ContextResourceReq = 0x03 ContextResourceHMU = 0x04 ContextResourcePRF = 0x05 ContextResourceICL = 0x06 ContextResourceRCL = 0x07 ContextCacheReq = 0x08 ContextRequest = 0x09 ContextResponse = 0x0A ContextPathResponse = 0x0B ContextCommand = 0x0C ContextCmdStatus = 0x0D ContextChannel = 0x0E ContextKeepalive = 0xFA ContextLinkIdentify = 0xFB ContextLinkClose = 0xFC ContextLinkProof = 0xFD ContextLRRTT = 0xFE ContextLRProof = 0xFF // Flag Values FlagSet = 0x01 FlagUnset = 0x00 // Header sizes HeaderMaxSize = 64 MTU = 500 AddressSize = 32 // Size of address/hash fields in bytes )
View Source
const ( RECEIPT_FAILED = 0x00 RECEIPT_SENT = 0x01 RECEIPT_DELIVERED = 0x02 RECEIPT_CULLED = 0xFF EXPL_LENGTH = (identity.HASHLENGTH + identity.SIGLENGTH) / 8 IMPL_LENGTH = identity.SIGLENGTH / 8 )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Packet ¶
type Packet struct {
HeaderType byte
PacketType byte
TransportType byte
Context byte
ContextFlag byte
Hops byte
DestinationType byte
DestinationHash []byte
Destination interface{}
TransportID []byte
Data []byte
Raw []byte
Packed bool
Sent bool
CreateReceipt bool
FromPacked bool
SentAt time.Time
PacketHash []byte
RatchetID []byte
RSSI *float64
SNR *float64
Q *float64
Addresses []byte
Link interface{}
// contains filtered or unexported fields
}
func NewAnnouncePacket ¶
func (*Packet) TruncatedHash ¶
type PacketConfig ¶
type PacketReceipt ¶
type PacketReceipt struct {
// contains filtered or unexported fields
}
func NewPacketReceipt ¶
func NewPacketReceipt(pkt *Packet) *PacketReceipt
func (*PacketReceipt) Cancel ¶
func (pr *PacketReceipt) Cancel()
func (*PacketReceipt) GetHash ¶
func (pr *PacketReceipt) GetHash() []byte
func (*PacketReceipt) GetRTT ¶
func (pr *PacketReceipt) GetRTT() time.Duration
func (*PacketReceipt) GetStatus ¶
func (pr *PacketReceipt) GetStatus() byte
func (*PacketReceipt) IsDelivered ¶
func (pr *PacketReceipt) IsDelivered() bool
func (*PacketReceipt) IsFailed ¶
func (pr *PacketReceipt) IsFailed() bool
func (*PacketReceipt) IsTimedOut ¶
func (pr *PacketReceipt) IsTimedOut() bool
func (*PacketReceipt) SetDeliveryCallback ¶
func (pr *PacketReceipt) SetDeliveryCallback(callback func(*PacketReceipt))
func (*PacketReceipt) SetDestinationIdentity ¶
func (pr *PacketReceipt) SetDestinationIdentity(ident *identity.Identity)
func (*PacketReceipt) SetLink ¶
func (pr *PacketReceipt) SetLink(link interface{})
func (*PacketReceipt) SetTimeout ¶
func (pr *PacketReceipt) SetTimeout(timeout time.Duration)
func (*PacketReceipt) SetTimeoutCallback ¶
func (pr *PacketReceipt) SetTimeoutCallback(callback func(*PacketReceipt))
func (*PacketReceipt) ValidateLinkProof ¶
func (pr *PacketReceipt) ValidateLinkProof(proof []byte, link interface{}, proofPacket *Packet) bool
func (*PacketReceipt) ValidateProof ¶
func (pr *PacketReceipt) ValidateProof(proof []byte, proofPacket *Packet) bool
func (*PacketReceipt) ValidateProofPacket ¶
func (pr *PacketReceipt) ValidateProofPacket(proofPacket *Packet) bool
Click to show internal directories.
Click to hide internal directories.