2018-07-11 13:20:14 +00:00
|
|
|
#ifndef LLARP_DHT_MESSAGES_PUB_INTRO_HPP
|
|
|
|
#define LLARP_DHT_MESSAGES_PUB_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
|
|
|
|
{
|
|
|
|
struct PublishIntroMessage : public IMessage
|
|
|
|
{
|
|
|
|
llarp::service::IntroSet I;
|
2018-07-20 04:50:28 +00:00
|
|
|
std::vector< Key_t > E;
|
2018-07-11 13:20:14 +00:00
|
|
|
uint64_t R = 0;
|
|
|
|
uint64_t S = 0;
|
|
|
|
uint64_t txID = 0;
|
|
|
|
bool hasS = false;
|
|
|
|
PublishIntroMessage() : IMessage({})
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2018-07-18 22:50:16 +00:00
|
|
|
PublishIntroMessage(const llarp::service::IntroSet& i, uint64_t tx,
|
2018-07-20 04:50:28 +00:00
|
|
|
uint64_t s, const std::vector< Key_t >& exclude = {})
|
2018-07-19 04:58:39 +00:00
|
|
|
: IMessage({}), E(exclude), txID(tx)
|
2018-07-11 16:11:19 +00:00
|
|
|
{
|
|
|
|
I = i;
|
2018-07-18 22:50:05 +00:00
|
|
|
S = s;
|
2018-07-11 16:11:19 +00:00
|
|
|
}
|
|
|
|
|
2018-07-11 13:20:14 +00:00
|
|
|
~PublishIntroMessage();
|
|
|
|
|
|
|
|
bool
|
|
|
|
BEncode(llarp_buffer_t* buf) const;
|
|
|
|
|
|
|
|
bool
|
|
|
|
DecodeKey(llarp_buffer_t key, llarp_buffer_t* val);
|
|
|
|
|
|
|
|
virtual bool
|
|
|
|
HandleMessage(llarp_dht_context* ctx,
|
|
|
|
std::vector< IMessage* >& replies) const;
|
|
|
|
};
|
2018-07-17 04:37:50 +00:00
|
|
|
} // namespace dht
|
|
|
|
} // namespace llarp
|
2018-07-11 13:20:14 +00:00
|
|
|
#endif
|