2018-07-11 13:20:14 +00:00
|
|
|
#ifndef LLARP_DHT_MESSAGES_GOT_INTRO_HPP
|
|
|
|
#define LLARP_DHT_MESSAGES_GOT_INTRO_HPP
|
|
|
|
#include <llarp/dht/message.hpp>
|
|
|
|
#include <llarp/service/IntroSet.hpp>
|
2018-07-20 04:50:28 +00:00
|
|
|
#include <vector>
|
2018-07-11 13:20:14 +00:00
|
|
|
|
|
|
|
namespace llarp
|
|
|
|
{
|
|
|
|
namespace dht
|
|
|
|
{
|
|
|
|
/// acknologement to PublishIntroMessage or reply to FinIntroMessage
|
|
|
|
struct GotIntroMessage : public IMessage
|
|
|
|
{
|
2018-07-20 04:50:28 +00:00
|
|
|
std::vector< llarp::service::IntroSet > I;
|
2018-07-11 16:11:19 +00:00
|
|
|
uint64_t T = 0;
|
|
|
|
|
2018-07-12 13:43:37 +00:00
|
|
|
GotIntroMessage(const Key_t& from) : IMessage(from)
|
2018-07-11 16:11:19 +00:00
|
|
|
{
|
|
|
|
}
|
2018-07-11 13:20:14 +00:00
|
|
|
|
2018-07-20 04:50:28 +00:00
|
|
|
GotIntroMessage(const std::vector< llarp::service::IntroSet >& results,
|
2018-07-18 03:10:21 +00:00
|
|
|
uint64_t txid);
|
2018-07-11 13:20:14 +00:00
|
|
|
|
|
|
|
~GotIntroMessage();
|
|
|
|
|
|
|
|
bool
|
|
|
|
BEncode(llarp_buffer_t* buf) const;
|
|
|
|
|
|
|
|
bool
|
|
|
|
DecodeKey(llarp_buffer_t key, llarp_buffer_t* val);
|
|
|
|
|
2018-07-12 13:43:37 +00:00
|
|
|
virtual bool
|
|
|
|
HandleMessage(llarp_dht_context* ctx,
|
|
|
|
std::vector< IMessage* >& replies) const;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct RelayedGotIntroMessage : public GotIntroMessage
|
|
|
|
{
|
|
|
|
RelayedGotIntroMessage() : GotIntroMessage({})
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2018-07-11 16:11:19 +00:00
|
|
|
bool
|
2018-07-11 13:20:14 +00:00
|
|
|
HandleMessage(llarp_dht_context* ctx,
|
|
|
|
std::vector< IMessage* >& replies) const;
|
|
|
|
};
|
2018-07-12 13:43:37 +00:00
|
|
|
} // namespace dht
|
|
|
|
} // namespace llarp
|
2018-07-11 13:20:14 +00:00
|
|
|
#endif
|