2018-06-29 14:25:09 +00:00
|
|
|
#ifndef LLARP_MESSAGES_DHT_HPP
|
|
|
|
#define LLARP_MESSAGES_DHT_HPP
|
2019-01-11 00:12:43 +00:00
|
|
|
|
|
|
|
#include <dht/message.hpp>
|
2018-12-12 02:04:32 +00:00
|
|
|
#include <routing/message.hpp>
|
2018-06-29 14:25:09 +00:00
|
|
|
|
|
|
|
#include <vector>
|
|
|
|
|
|
|
|
namespace llarp
|
|
|
|
{
|
|
|
|
namespace routing
|
|
|
|
{
|
2018-11-05 11:27:12 +00:00
|
|
|
struct DHTMessage final : public IMessage
|
2018-06-29 14:25:09 +00:00
|
|
|
{
|
2019-05-03 13:15:03 +00:00
|
|
|
std::vector< llarp::dht::IMessage::Ptr_t > M;
|
2018-06-29 14:25:09 +00:00
|
|
|
uint64_t V = 0;
|
|
|
|
|
2019-06-15 14:55:13 +00:00
|
|
|
~DHTMessage() = default;
|
2018-06-29 14:25:09 +00:00
|
|
|
|
|
|
|
bool
|
2019-02-05 00:41:33 +00:00
|
|
|
DecodeKey(const llarp_buffer_t& key, llarp_buffer_t* val) override;
|
2018-06-29 14:25:09 +00:00
|
|
|
|
|
|
|
bool
|
2018-11-05 11:27:12 +00:00
|
|
|
BEncode(llarp_buffer_t* buf) const override;
|
2018-06-29 14:25:09 +00:00
|
|
|
|
|
|
|
bool
|
2019-02-11 19:45:42 +00:00
|
|
|
HandleMessage(IMessageHandler* h, AbstractRouter* r) const override;
|
2018-12-27 14:32:37 +00:00
|
|
|
|
2019-01-11 00:12:43 +00:00
|
|
|
void
|
|
|
|
Clear() override
|
2018-12-27 14:32:37 +00:00
|
|
|
{
|
|
|
|
M.clear();
|
2019-01-07 12:27:29 +00:00
|
|
|
V = 0;
|
2018-12-27 14:32:37 +00:00
|
|
|
}
|
2018-06-29 14:25:09 +00:00
|
|
|
};
|
|
|
|
} // namespace routing
|
|
|
|
} // namespace llarp
|
|
|
|
|
2018-09-02 18:25:42 +00:00
|
|
|
#endif
|