2019-04-21 16:44:27 +00:00
|
|
|
#ifndef LLARP_SERVICE_HIDDEN_SERVICE_ADDRESS_LOOKUP_HPP
|
|
|
|
#define LLARP_SERVICE_HIDDEN_SERVICE_ADDRESS_LOOKUP_HPP
|
|
|
|
|
2019-06-15 14:55:13 +00:00
|
|
|
#include <routing/dht_message.hpp>
|
2019-04-22 18:35:19 +00:00
|
|
|
#include <service/intro_set.hpp>
|
2019-04-21 16:44:27 +00:00
|
|
|
#include <service/lookup.hpp>
|
|
|
|
|
|
|
|
namespace llarp
|
|
|
|
{
|
|
|
|
namespace service
|
|
|
|
{
|
|
|
|
struct Endpoint;
|
|
|
|
struct HiddenServiceAddressLookup : public IServiceLookup
|
|
|
|
{
|
2020-01-27 21:30:41 +00:00
|
|
|
const PubKey rootkey;
|
2020-02-14 18:06:19 +00:00
|
|
|
uint64_t relayOrder;
|
2020-01-27 21:30:41 +00:00
|
|
|
const dht::Key_t location;
|
2020-04-07 18:38:56 +00:00
|
|
|
using HandlerFunc =
|
2020-05-01 19:51:15 +00:00
|
|
|
std::function<bool(const Address&, std::optional<IntroSet>, const RouterID&)>;
|
2019-04-21 16:44:27 +00:00
|
|
|
HandlerFunc handle;
|
|
|
|
|
2020-04-07 18:38:56 +00:00
|
|
|
HiddenServiceAddressLookup(
|
|
|
|
Endpoint* p,
|
|
|
|
HandlerFunc h,
|
|
|
|
const dht::Key_t& location,
|
|
|
|
const PubKey& rootkey,
|
|
|
|
uint64_t relayOrder,
|
|
|
|
uint64_t tx);
|
2019-04-21 16:44:27 +00:00
|
|
|
|
2019-07-30 23:42:13 +00:00
|
|
|
~HiddenServiceAddressLookup() override = default;
|
2019-04-21 16:44:27 +00:00
|
|
|
|
|
|
|
bool
|
2020-09-17 19:18:08 +00:00
|
|
|
HandleIntrosetResponse(const std::set<EncryptedIntroSet>& results) override;
|
2019-04-21 16:44:27 +00:00
|
|
|
|
2020-04-07 18:38:56 +00:00
|
|
|
std::shared_ptr<routing::IMessage>
|
2019-07-30 23:42:13 +00:00
|
|
|
BuildRequestMessage() override;
|
2019-04-21 16:44:27 +00:00
|
|
|
};
|
|
|
|
} // namespace service
|
|
|
|
} // namespace llarp
|
|
|
|
|
|
|
|
#endif
|