1
1
Fork 0
mirror of https://github.com/oxen-io/lokinet synced 2023-12-14 06:53:00 +01:00
lokinet/include/llarp/dht/messages/gotintro.hpp

48 lines
1.1 KiB
C++
Raw Normal View History

#ifndef LLARP_DHT_MESSAGES_GOT_INTRO_HPP
#define LLARP_DHT_MESSAGES_GOT_INTRO_HPP
#include <llarp/dht/message.hpp>
#include <llarp/service/IntroSet.hpp>
namespace llarp
{
namespace dht
{
/// acknologement to PublishIntroMessage or reply to FinIntroMessage
struct GotIntroMessage : public IMessage
{
2018-07-19 06:58:39 +02:00
std::set< llarp::service::IntroSet > I;
uint64_t T = 0;
GotIntroMessage(const Key_t& from) : IMessage(from)
{
}
2018-07-18 05:10:21 +02:00
GotIntroMessage(const std::set< llarp::service::IntroSet >& results,
uint64_t txid);
~GotIntroMessage();
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;
};
struct RelayedGotIntroMessage : public GotIntroMessage
{
RelayedGotIntroMessage() : GotIntroMessage({})
{
}
bool
HandleMessage(llarp_dht_context* ctx,
std::vector< IMessage* >& replies) const;
};
} // namespace dht
} // namespace llarp
#endif