[−][src]Module tox_packet::dht
Top-level DHT udp packets according to Tox spec
Modules
packed_node | A pair of SocketAddr & PublicKey. |
Structs
BootstrapInfo | Sent by both client and server, only server will respond. When server receives this packet it may respond with the version of the library plus MoTD (message of the day). The max length of MoTD is 256 bytes so the max packet lenght of server BootstrapInfo is 261=(1+4+256) bytes. |
Cookie | Cookie is a struct that holds two public keys of a node: long term key and short term DHT key. |
CookieRequest | CookieRequest packet struct. According to https://zetok.github.io/tox-spec/#net-crypto |
CookieRequestPayload | CookieRequestPayload packet struct. |
CookieResponse | Response to a |
CookieResponsePayload | Unencrypted payload of |
CryptoData | Packet used to send data over |
CryptoDataPayload | Unencrypted payload of |
CryptoHandshake | Packet used to establish |
CryptoHandshakePayload | Unencrypted payload of |
DhtPkAnnounce | Packet to announce self short term DHT |
DhtPkAnnouncePayload | Packet used to announce our DHT |
DhtRequest | DHT Request packet struct. DHT Request packet consists of NatPingRequest and NatPingResponse. When my known friend is not connected directly, send NatPingRequest to peers which are in Ktree. When NatPingResponse arrives to me, it means that my known friend is also searching me, and running behind NAT, so start hole-punching. |
EncryptedCookie | Encrypted with symmetric key |
GetPayloadError | Error that can happen when calling |
HardeningRequest | Hardening nodes request of DHT Request packet. |
HardeningResponse | Hardening nodes response of DHT Request packet. |
LanDiscovery | LanDiscovery packet struct. LanDiscovery packets contain the DHT public key of the sender. When a LanDiscovery packet is received, a NodesRequest packet will be sent to the sender of the packet. This means that the DHT instance will bootstrap itself to every peer from which it receives one of these packet. Through this mechanism, Tox clients will bootstrap themselve automatically from other Tox clients running on the local network. |
NatPingRequest | NatPing request of DHT Request packet. |
NatPingResponse | NatPing response of DHT Request packet. |
NodesRequest | Nodes request packet struct. It's used to get up to 4 closest nodes to
requested public key. Every 20 seconds DHT node sends |
NodesRequestPayload | Request to get address of given DHT PK, or nodes that are closest in DHT to the given PK. Request id is used for resistance against replay attacks. |
NodesResponse | Nodes response packet struct. When DHT node receives |
NodesResponsePayload | Response to |
PingRequest | Ping request packet struct. Every 60 seconds DHT node sends |
PingRequestPayload | Used to request/respond to ping. Used in an encrypted form. Request id is used for resistance against replay attacks. |
PingResponse | Ping response packet struct. When |
PingResponsePayload | Used to request/respond to ping. Used in an encrypted form. Request id is used for resistance against replay attacks. |
Enums
DhtRequestPayload | Standart DHT Request packet that embedded in the payload of
|
GetPayloadErrorKind | The specific kind of error that can occur. |
Packet | DHT packet enum that encapsulates all types of DHT packets. |
Constants
BOOSTRAP_CLIENT_MAX_MOTD_LENGTH | Length of in bytes of MoTD field of |
BOOSTRAP_SERVER_MAX_MOTD_LENGTH | Length of in bytes of MoTD field of |
COOKIE_TIMEOUT | Number of seconds that generated cookie is valid |
MAX_CRYPTO_DATA_SIZE | The maximum size of data in packets. |
MAX_DHT_PACKET_SIZE | A serialized |
Functions
unix_time |