97 |
|
* firedns_add_query() |
98 |
|
*/ |
99 |
|
unsigned char id[2]; |
100 |
< |
unsigned short class; |
101 |
< |
unsigned short type; |
100 |
> |
uint16_t class; |
101 |
> |
uint16_t type; |
102 |
|
/* file descriptor returned from sockets */ |
103 |
|
int fd; |
104 |
|
void *info; |
111 |
|
|
112 |
|
struct s_rr_middle |
113 |
|
{ |
114 |
< |
unsigned short type; |
115 |
< |
unsigned short class; |
114 |
> |
uint16_t type; |
115 |
> |
uint16_t class; |
116 |
|
/* XXX - firedns depends on this being 4 bytes */ |
117 |
|
uint32 ttl; |
118 |
< |
unsigned short rdlength; |
118 |
> |
uint16_t rdlength; |
119 |
|
}; |
120 |
|
|
121 |
|
/* DNS query header */ |
135 |
|
#define FLAGS2_MASK_Z 0x70 |
136 |
|
#define FLAGS2_MASK_RCODE 0x0f |
137 |
|
|
138 |
< |
unsigned short qdcount; |
139 |
< |
unsigned short ancount; |
140 |
< |
unsigned short nscount; |
141 |
< |
unsigned short arcount; |
138 |
> |
uint16_t qdcount; |
139 |
> |
uint16_t ancount; |
140 |
> |
uint16_t nscount; |
141 |
> |
uint16_t arcount; |
142 |
|
/* DNS question, populated by firedns_build_query_payload() */ |
143 |
|
unsigned char payload[512]; |
144 |
|
}; |
148 |
|
static struct s_connection *firedns_add_query(void); |
149 |
|
static int firedns_doquery(struct s_connection *s); |
150 |
|
static int firedns_build_query_payload(const char * const name, |
151 |
< |
unsigned short rr, unsigned short class, unsigned char * payload); |
151 |
> |
uint16_t, uint16_t, unsigned char * payload); |
152 |
|
static int firedns_send_requests(struct s_header *h, struct s_connection *s, |
153 |
|
int l); |
154 |
|
|
386 |
|
* populate payload with query: name= question, rr= record type |
387 |
|
*/ |
388 |
|
static int firedns_build_query_payload(const char * const name, |
389 |
< |
unsigned short rr, unsigned short class, unsigned char * payload) |
389 |
> |
uint16_t rr, uint16_t class, unsigned char * payload) |
390 |
|
{ |
391 |
< |
short payloadpos; |
391 |
> |
int16_t payloadpos; |
392 |
|
const char * tempchr, * tempchr2; |
393 |
< |
unsigned short l; |
393 |
> |
uint16_t l; |
394 |
|
|
395 |
|
payloadpos = 0; |
396 |
|
tempchr2 = name; |