forked from shuque/danetls
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathquery-getdns.h
52 lines (38 loc) · 1010 Bytes
/
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
#ifndef __QUERY_GETDNS_H__
#define __QUERY_GETDNS_H__
#include <stdlib.h>
#include <stdint.h>
#include <stdio.h>
/*
* qinfo: structure to hold query information to be passed to
* callback functions.
*/
typedef struct qinfo {
char *qname;
uint16_t qtype;
uint16_t port;
} qinfo;
/*
* addresses: (head of) linked list of addrinfo structures
*/
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(char *hostname, char *port);
#endif /* __QUERY_GETDNS_H__ */