forked from shuque/chainserver
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathquery-getdns.h
67 lines (49 loc) · 1.26 KB
/
query-getdns.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
#ifndef __QUERY_GETDNS_H__
#define __QUERY_GETDNS_H__
#include <stdlib.h>
#include <stdint.h>
#include <stdio.h>
/*
* Flags: dns bogus or indeterminate; authenticate responses
*/
int dns_bogus_or_indeterminate;
int address_authenticated;
int v4_authenticated;
int v6_authenticated;
int mx_authenticated;
int srv_authenticated;
int tlsa_authenticated;
/*
* qinfo: structure to hold query information to be passed to
* callback functions.
*/
typedef struct qinfo {
const char *qname;
uint16_t qtype;
uint16_t port;
} qinfo;
/*
* addresses: (head of) linked list of addrinfo structures
*/
size_t address_count;
struct addrinfo *addresses;
struct addrinfo *
insert_addrinfo(struct addrinfo *current, struct addrinfo *new);
/*
* tlsa_rdata: structure to hold TLSA record rdata.
* tlsa_rdata_list: linked list of tlsa_rdata structures.
*/
size_t tlsa_count;
typedef struct tlsa_rdata {
uint8_t usage;
uint8_t selector;
uint8_t mtype;
unsigned long data_len;
uint8_t *data;
struct tlsa_rdata *next;
} tlsa_rdata;
tlsa_rdata *tlsa_rdata_list;
tlsa_rdata *insert_tlsa_rdata(tlsa_rdata *current, tlsa_rdata *new);
void free_tlsa(tlsa_rdata *head);
int do_dns_queries(const char *hostname, uint16_t port);
#endif /* __QUERY_GETDNS_H__ */