DHT Messages - rubdos/libap2p GitHub Wiki
Code @ 8 januari: 7372d99ff1b4a1b114e7ea3856eaf0606aafb625
MESSAGE_DHT_SEARCH = 21, /**<Searches the Node for a DHTEntry with the tags*/
MESSAGE_DHT_INFO = 22, /**<Fetches info about a DHTEntry object */
MESSAGE_DHT_FETCH = 23, /**<Fetches the DHTEntry object part */
MESSAGE_DHT_SEARCH_RESULT = 24, /**<Returns the result of a DHT_SEARCH */
MESSAGE_DHT_INFO_RESULT = 25, /**<Returns the result of an info request */
MESSAGE_DHT_PUSH = 26, /**<The answer on a DHT_FETCH */
Searches for a DHT entry on another node. XML stucture in data:
<data>
<tag>[[TAG TO SEARCH FOR]]</tag>
</data>
Response to MESSAGE_DHT_SEARCH XML stucture in data:
<data>
<entries_count>[[int: count of found]]</entries_count>
<entry_[no]>[[hash]]</entry_[no]>
</data>
tag entry_[no], eg. entry_0 entry_1 ...
Request for info about a sha256sum received on a MESSAGE_DHT_SEARCH_RESULT XML structure in data:
<data>
<sha>[[sha]]</sha>
</data>
Returns info about the MESSAGE_DHT_INFO request. XML structure in data:
<data>
<sha>[[sha of the entry we're talking about]]</sha>
<part_count>[[int: the amount of parts in which the data is split]]</part_count>
<part_length>[[the length of every part in bytes]]</part_length>
<part_[no]>[[the sha checksum of the part with number [no] ]]</part_[no]>
</data>
Requests a part of the DHT object: XML structure in data:
<data>
<entry_sha>[[sha of the entry]]</entry_sha>
<part_sha>[[sha of the part of the entry]]</part_sha>
</data>
Returns the data of a part (answer to MESSAGE_DHT_FETCH): XML structure in data:
<data>
<sha>[[sha we're talking about]]</sha>
<content>[[base64 encoded content of the part]]</content>
</data>