lokinet/llarp/service/hidden_service_address_lookup.hpp

41 lines
1.0 KiB
C++
Raw Normal View History

#pragma once
#include <llarp/routing/dht_message.hpp>
#include "intro_set.hpp"
#include "lookup.hpp"
namespace llarp
{
namespace service
{
struct Endpoint;
struct HiddenServiceAddressLookup : public IServiceLookup
{
2020-01-27 21:30:41 +00:00
const PubKey rootkey;
uint64_t relayOrder;
2020-01-27 21:30:41 +00:00
const dht::Key_t location;
using HandlerFunc = std::function<bool(
const Address&, std::optional<IntroSet>, const RouterID&, llarp_time_t, uint64_t)>;
HandlerFunc handle;
HiddenServiceAddressLookup(
Endpoint* p,
HandlerFunc h,
const dht::Key_t& location,
const PubKey& rootkey,
const RouterID& routerAsked,
uint64_t relayOrder,
uint64_t tx,
llarp_time_t timeout);
2019-07-30 23:42:13 +00:00
~HiddenServiceAddressLookup() override = default;
bool
HandleIntrosetResponse(const std::set<EncryptedIntroSet>& results) override;
std::shared_ptr<routing::IMessage>
2019-07-30 23:42:13 +00:00
BuildRequestMessage() override;
};
} // namespace service
} // namespace llarp