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