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;
|
|
|
|
using HandlerFunc = std::function< bool(
|
2020-02-19 21:58:01 +00:00
|
|
|
const Address&, nonstd::optional< IntroSet >, const RouterID&) >;
|
2019-04-21 16:44:27 +00:00
|
|
|
HandlerFunc handle;
|
|
|
|
|
|
|
|
HiddenServiceAddressLookup(Endpoint* p, HandlerFunc h,
|
2020-01-27 21:30:41 +00:00
|
|
|
const dht::Key_t& location,
|
2020-02-14 18:06:19 +00:00
|
|
|
const PubKey& rootkey, uint64_t relayOrder,
|
2020-02-13 22:19:12 +00:00
|
|
|
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-01-27 21:30:41 +00:00
|
|
|
HandleResponse(const std::set< EncryptedIntroSet >& results) override;
|
2019-04-21 16:44:27 +00:00
|
|
|
|
2019-04-23 14:28:59 +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
|