seeder/dns.h

30 lines
474 B
C
Raw Normal View History

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