2019-01-11 01:19:36 +00:00
|
|
|
#ifndef LLARP_DNS_DOTLOKILOOKUP_HPP
|
|
|
|
#define LLARP_DNS_DOTLOKILOOKUP_HPP
|
2018-09-22 10:17:22 +00:00
|
|
|
|
2018-12-12 02:52:51 +00:00
|
|
|
#include <dnsd.hpp>
|
2018-12-12 02:15:08 +00:00
|
|
|
#include <service/address.hpp>
|
2018-09-22 10:17:22 +00:00
|
|
|
|
2018-11-22 23:59:03 +00:00
|
|
|
using map_address_hook_func =
|
2018-12-02 18:07:07 +00:00
|
|
|
std::function< bool(const byte_t *addr, bool isSNode, uint32_t ip) >;
|
2018-09-22 10:17:22 +00:00
|
|
|
|
2018-10-03 10:48:31 +00:00
|
|
|
/// dotLokiLookup context/config
|
2018-09-22 10:17:22 +00:00
|
|
|
struct dotLokiLookup
|
|
|
|
{
|
|
|
|
/// for timers (MAYBEFIXME? maybe we decouple this, yes pls have a generic
|
|
|
|
/// passed in)
|
2018-10-18 12:15:41 +00:00
|
|
|
// we can use DNSc for access to the logic
|
2018-12-10 14:14:55 +00:00
|
|
|
llarp::Logic *logic;
|
2018-10-18 12:15:41 +00:00
|
|
|
|
2018-09-22 10:17:22 +00:00
|
|
|
/// which ip tracker to use
|
|
|
|
struct dns_iptracker *ip_tracker;
|
2018-10-03 10:48:31 +00:00
|
|
|
|
2018-09-22 10:17:22 +00:00
|
|
|
/// tunEndpoint
|
2018-09-22 10:20:15 +00:00
|
|
|
// llarp::handlers::TunEndpoint *tunEndpoint; // is this even needed here?
|
2018-10-03 10:48:31 +00:00
|
|
|
void *user; // well dotLokiLookup current uses it to access the tun if
|
2018-09-22 10:17:22 +00:00
|
|
|
// pointer to tunendpoint properties?
|
2018-10-03 10:48:31 +00:00
|
|
|
// llarp::service::Context *hiddenServiceContext;
|
2018-09-22 10:17:22 +00:00
|
|
|
|
|
|
|
// need a way to reference
|
|
|
|
// 1. mapaddress
|
|
|
|
map_address_hook_func map_address_handler;
|
2018-09-22 10:20:15 +00:00
|
|
|
// std::function< bool(const llarp::service::Address &addr, uint32_t ip),
|
|
|
|
// llarp::handlers::TunEndpoint * > callback;
|
2018-09-22 10:17:22 +00:00
|
|
|
// 2. prefetch
|
|
|
|
};
|
|
|
|
|
|
|
|
dnsd_query_hook_response *
|
2018-11-18 23:48:50 +00:00
|
|
|
llarp_dotlokilookup_handler(std::string name,
|
2018-12-02 18:07:07 +00:00
|
|
|
const dnsd_question_request *request);
|
2018-09-22 10:17:22 +00:00
|
|
|
|
|
|
|
#endif
|