2017-07-07 09:32:30 +02:00
|
|
|
#ifndef GB_GBDNS_H
|
|
|
|
#define GB_GBDNS_H
|
|
|
|
|
|
|
|
#include <vector>
|
|
|
|
#include <string>
|
|
|
|
#include <netinet/in.h>
|
|
|
|
|
|
|
|
namespace GbDns {
|
|
|
|
struct DnsResponse {
|
2017-07-11 16:03:58 +02:00
|
|
|
DnsResponse();
|
|
|
|
|
2017-07-07 09:32:30 +02:00
|
|
|
std::vector<in_addr_t> m_ips;
|
|
|
|
std::vector<std::string> m_nameservers;
|
2017-07-11 16:03:58 +02:00
|
|
|
int m_errno;
|
2017-07-07 09:32:30 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
bool initialize();
|
2017-07-11 11:39:34 +02:00
|
|
|
bool initializeSettings();
|
|
|
|
|
2017-07-07 09:32:30 +02:00
|
|
|
void finalize();
|
|
|
|
|
2017-07-19 14:08:03 +02:00
|
|
|
void getARecord(const char *hostname, size_t hostnameLen, void (*callback)(DnsResponse *response, void *state), void *state);
|
|
|
|
void getNSRecord(const char *hostname, size_t hostnameLen, void (*callback)(DnsResponse *response, void *state), void *state);
|
2017-07-07 09:32:30 +02:00
|
|
|
|
|
|
|
void makeCallbacks();
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
#endif //GB_GBDNS_H
|