SpecialProxy/dns.h

21 lines
441 B
C
Raw Normal View History

2017-07-12 12:29:56 +08:00
#ifndef DNS_H
#define DNS_H
#include "main.h"
2018-12-07 09:29:41 +08:00
#define DEFAULT_DNS_IP "114.114.114.114"
2017-07-12 12:29:56 +08:00
struct dns {
2017-07-12 12:52:46 +08:00
char request[512]; //UDP的DNS请求不超512字节
2017-07-12 12:29:56 +08:00
uint16_t request_len, sent_len;
};
extern void dns_connect(struct sockaddr_in *dnsAddr);
extern struct dns dns_list[MAX_CONNECTION / 2];
extern int dnsFd;
extern int8_t build_dns_req(struct dns *dns, char *domain);
extern void read_dns_rsp();
extern void dns_query();
#endif