~singpolyma/biboumi

ref: ffb402f0adb9f808c7b8bc9616e71f7b3f8931ac biboumi/src/network/dns_handler.hpp -rw-r--r-- 719 bytes
ffb402f0 — louiz’ Drop support for botan < 2.0 5 years ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#pragma once

#include <biboumi.h>
#ifdef UDNS_FOUND

class Poller;

#include <network/dns_socket_handler.hpp>

#include <string>
#include <vector>
#include <memory>

class DNSHandler
{
public:
  explicit DNSHandler(std::shared_ptr<Poller>& poller);
  ~DNSHandler() = default;

  DNSHandler(const DNSHandler&) = delete;
  DNSHandler(DNSHandler&&) = delete;
  DNSHandler& operator=(const DNSHandler&) = delete;
  DNSHandler& operator=(DNSHandler&&) = delete;

  void destroy();

  static void watch();
  static void unwatch();

private:
  /**
   * Manager for the socket returned by udns, that we need to watch with the poller
   */
  static std::unique_ptr<DNSSocketHandler> socket_handler;
};

#endif /* UDNS_FOUND */