You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
lokinet/llarp/dht/messages/pubintro.hpp

47 lines
1.1 KiB
C++

#ifndef LLARP_DHT_MESSAGES_PUB_INTRO_HPP
#define LLARP_DHT_MESSAGES_PUB_INTRO_HPP
#include <dht/message.hpp>
#include <llarp/service/IntroSet.hpp>
6 years ago
#include <vector>
namespace llarp
{
namespace dht
{
struct PublishIntroMessage final : public IMessage
{
llarp::service::IntroSet I;
6 years ago
std::vector< Key_t > E;
uint64_t R = 0;
uint64_t S = 0;
uint64_t txID = 0;
bool hasS = false;
PublishIntroMessage() : IMessage({})
{
}
6 years ago
PublishIntroMessage(const llarp::service::IntroSet& i, uint64_t tx,
6 years ago
uint64_t s, const std::vector< Key_t >& exclude = {})
: IMessage({}), E(exclude), txID(tx)
{
I = i;
6 years ago
S = s;
}
~PublishIntroMessage();
bool
BEncode(llarp_buffer_t* buf) const override;
bool
DecodeKey(llarp_buffer_t key, llarp_buffer_t* val) override;
virtual bool
HandleMessage(
llarp_dht_context* ctx,
std::vector< std::unique_ptr< IMessage > >& replies) const override;
};
} // namespace dht
} // namespace llarp
#endif