Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100644 85 lines (71 sloc) 2.967 kB
3e25c70 import dnscache 1.00
D. J. Bernstein authored
1 #ifndef DNS_H
2 #define DNS_H
3
4 #include "stralloc.h"
5 #include "iopause.h"
6 #include "taia.h"
7
8 #define DNS_C_IN "\0\1"
9 #define DNS_C_ANY "\0\377"
10
11 #define DNS_T_A "\0\1"
12 #define DNS_T_NS "\0\2"
13 #define DNS_T_CNAME "\0\5"
14 #define DNS_T_SOA "\0\6"
15 #define DNS_T_PTR "\0\14"
16 #define DNS_T_HINFO "\0\15"
17 #define DNS_T_MX "\0\17"
18 #define DNS_T_TXT "\0\20"
19 #define DNS_T_RP "\0\21"
20 #define DNS_T_SIG "\0\30"
21 #define DNS_T_KEY "\0\31"
22 #define DNS_T_AAAA "\0\34"
23 #define DNS_T_AXFR "\0\374"
24 #define DNS_T_ANY "\0\377"
25
26 struct dns_transmit {
27 char *query; /* 0, or dynamically allocated */
28 unsigned int querylen;
29 char *packet; /* 0, or dynamically allocated */
30 unsigned int packetlen;
31 int s1; /* 0, or 1 + an open file descriptor */
32 int tcpstate;
33 unsigned int udploop;
34 unsigned int curserver;
35 struct taia deadline;
36 unsigned int pos;
df36440 import djbdns 1.03
D. J. Bernstein authored
37 const char *servers;
3e25c70 import dnscache 1.00
D. J. Bernstein authored
38 char localip[4];
39 char qtype[2];
40 } ;
41
df36440 import djbdns 1.03
D. J. Bernstein authored
42 extern void dns_random_init(const char *);
3e25c70 import dnscache 1.00
D. J. Bernstein authored
43 extern unsigned int dns_random(unsigned int);
44
45 extern void dns_sortip(char *,unsigned int);
46
47 extern void dns_domain_free(char **);
df36440 import djbdns 1.03
D. J. Bernstein authored
48 extern int dns_domain_copy(char **,const char *);
49 extern unsigned int dns_domain_length(const char *);
50 extern int dns_domain_equal(const char *,const char *);
51 extern int dns_domain_suffix(const char *,const char *);
52 extern unsigned int dns_domain_suffixpos(const char *,const char *);
53 extern int dns_domain_fromdot(char **,const char *,unsigned int);
54 extern int dns_domain_todot_cat(stralloc *,const char *);
3e25c70 import dnscache 1.00
D. J. Bernstein authored
55
df36440 import djbdns 1.03
D. J. Bernstein authored
56 extern unsigned int dns_packet_copy(const char *,unsigned int,unsigned int,char *,unsigned int);
57 extern unsigned int dns_packet_getname(const char *,unsigned int,unsigned int,char **);
58 extern unsigned int dns_packet_skipname(const char *,unsigned int,unsigned int);
3e25c70 import dnscache 1.00
D. J. Bernstein authored
59
df36440 import djbdns 1.03
D. J. Bernstein authored
60 extern int dns_transmit_start(struct dns_transmit *,const char *,int,const char *,const char *,const char *);
3e25c70 import dnscache 1.00
D. J. Bernstein authored
61 extern void dns_transmit_free(struct dns_transmit *);
62 extern void dns_transmit_io(struct dns_transmit *,iopause_fd *,struct taia *);
df36440 import djbdns 1.03
D. J. Bernstein authored
63 extern int dns_transmit_get(struct dns_transmit *,const iopause_fd *,const struct taia *);
3e25c70 import dnscache 1.00
D. J. Bernstein authored
64
65 extern int dns_resolvconfip(char *);
df36440 import djbdns 1.03
D. J. Bernstein authored
66 extern int dns_resolve(const char *,const char *);
3e25c70 import dnscache 1.00
D. J. Bernstein authored
67 extern struct dns_transmit dns_resolve_tx;
68
df36440 import djbdns 1.03
D. J. Bernstein authored
69 extern int dns_ip4_packet(stralloc *,const char *,unsigned int);
70 extern int dns_ip4(stralloc *,const stralloc *);
71 extern int dns_name_packet(stralloc *,const char *,unsigned int);
72 extern void dns_name4_domain(char *,const char *);
3e25c70 import dnscache 1.00
D. J. Bernstein authored
73 #define DNS_NAME4_DOMAIN 31
df36440 import djbdns 1.03
D. J. Bernstein authored
74 extern int dns_name4(stralloc *,const char *);
75 extern int dns_txt_packet(stralloc *,const char *,unsigned int);
76 extern int dns_txt(stralloc *,const stralloc *);
77 extern int dns_mx_packet(stralloc *,const char *,unsigned int);
78 extern int dns_mx(stralloc *,const stralloc *);
3e25c70 import dnscache 1.00
D. J. Bernstein authored
79
80 extern int dns_resolvconfrewrite(stralloc *);
df36440 import djbdns 1.03
D. J. Bernstein authored
81 extern int dns_ip4_qualify_rules(stralloc *,stralloc *,const stralloc *,const stralloc *);
82 extern int dns_ip4_qualify(stralloc *,stralloc *,const stralloc *);
3e25c70 import dnscache 1.00
D. J. Bernstein authored
83
84 #endif
Something went wrong with that request. Please try again.