hook to get dnsd_context it was called from

pull/7/head
Ryan Tharp 6 years ago
parent 604d1ade0e
commit 05e34e7b2f

@ -28,9 +28,10 @@ handle_signal(int sig)
}
sockaddr *
hookChecker(std::string name)
hookChecker(std::string name, struct dnsd_context *context)
{
llarp::LogInfo("Hooked ", name);
// cast your context->user;
return nullptr;
}

@ -166,7 +166,7 @@ handle_recvfrom(const char *buffer, ssize_t nbytes, const struct sockaddr *from,
if(request->context->intercept)
{
sockaddr *intercept = request->context->intercept(request->question.name);
sockaddr *intercept = request->context->intercept(request->question.name, request->context);
// if(!forward_dns_request(m_qName))
if(intercept != nullptr)
{

@ -30,7 +30,7 @@ struct dnsd_question_request
// we could have passed in the source sockaddr in case you wanted to
// handle the response yourself
typedef sockaddr *(*intercept_query_hook)(std::string name);
typedef sockaddr *(*intercept_query_hook)(std::string name, struct dnsd_context *context);
struct dnsd_context
{

Loading…
Cancel
Save