2011-12-26 18:27:02 +01:00
|
|
|
#ifndef _DNS_H_
|
|
|
|
#define _DNS_H_ 1
|
|
|
|
|
|
|
|
#include <stdint.h>
|
|
|
|
|
2012-05-25 15:41:27 +02:00
|
|
|
typedef struct {
|
|
|
|
int v;
|
|
|
|
union {
|
|
|
|
unsigned char v4[4];
|
|
|
|
unsigned char v6[16];
|
|
|
|
} data;
|
|
|
|
} addr_t;
|
|
|
|
|
2011-12-26 18:27:02 +01:00
|
|
|
typedef struct {
|
|
|
|
int port;
|
|
|
|
int datattl;
|
|
|
|
int nsttl;
|
|
|
|
const char *host;
|
|
|
|
const char *ns;
|
|
|
|
const char *mbox;
|
2012-05-25 15:41:27 +02:00
|
|
|
int (*cb)(void *opt, addr_t *addr, int max, int ipv4, int ipv6);
|
2011-12-26 18:27:02 +01:00
|
|
|
// stats
|
|
|
|
uint64_t nRequests;
|
|
|
|
} dns_opt_t;
|
|
|
|
|
|
|
|
extern int dnsserver(dns_opt_t *opt);
|
|
|
|
|
|
|
|
#endif
|