Blame
Date:
Mon Jan 11 09:00:47 2021 UTC
Message:
a usleep makes it unnecessary slow, I guess it forces a context switch...
001
2016-07-06
pjp
/*
002
2020-06-28
pjp
* Copyright (c) 2002-2020 Peter J. Philipp
003
2016-07-06
pjp
* All rights reserved.
004
2016-07-06
pjp
*
005
2016-07-06
pjp
* Redistribution and use in source and binary forms, with or without
006
2016-07-06
pjp
* modification, are permitted provided that the following conditions
007
2016-07-06
pjp
* are met:
008
2016-07-06
pjp
* 1. Redistributions of source code must retain the above copyright
009
2016-07-06
pjp
* notice, this list of conditions and the following disclaimer.
010
2016-07-06
pjp
* 2. Redistributions in binary form must reproduce the above copyright
011
2016-07-06
pjp
* notice, this list of conditions and the following disclaimer in the
012
2016-07-06
pjp
* documentation and/or other materials provided with the distribution.
013
2016-07-06
pjp
* 3. The name of the author may not be used to endorse or promote products
014
2016-07-06
pjp
* derived from this software without specific prior written permission
015
2016-07-06
pjp
*
016
2016-07-06
pjp
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
017
2016-07-06
pjp
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
018
2016-07-06
pjp
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
019
2016-07-06
pjp
* IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
020
2016-07-06
pjp
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
021
2016-07-06
pjp
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
022
2016-07-06
pjp
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
023
2016-07-06
pjp
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
024
2016-07-06
pjp
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
025
2016-07-06
pjp
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
026
2016-07-06
pjp
*
027
2016-07-06
pjp
*/
028
2017-10-26
pjp
029
2016-07-06
pjp
#ifndef _DNS_H
030
2016-07-06
pjp
#define _DNS_H
031
2016-07-06
pjp
032
2016-07-06
pjp
033
2016-07-06
pjp
/* RFC 1035 - page 26 */
034
2016-07-06
pjp
035
2016-07-06
pjp
struct dns_header {
036
2016-07-06
pjp
u_int16_t id; /* ID of header */
037
2016-07-06
pjp
u_int16_t query;
038
2016-07-06
pjp
u_int16_t question; /* # of question entries */
039
2016-07-06
pjp
u_int16_t answer; /* # of answer RR's */
040
2016-07-06
pjp
u_int16_t nsrr; /* # of NS RR's */
041
2016-07-06
pjp
u_int16_t additional; /* # additional RR's */
042
2016-07-06
pjp
};
043
2016-07-06
pjp
044
2016-07-06
pjp
struct dns_hints {
045
2016-07-06
pjp
int proto;
046
2016-07-06
pjp
u_int16_t id;
047
2016-07-06
pjp
u_int16_t query;
048
2016-07-06
pjp
u_int16_t question;
049
2016-07-06
pjp
u_int16_t answer;
050
2016-07-06
pjp
u_int16_t nsrr;
051
2016-07-06
pjp
u_int16_t additional;
052
2016-07-06
pjp
};
053
2016-07-06
pjp
054
2016-07-06
pjp
/*
055
2016-07-06
pjp
* resource record structure
056
2016-07-06
pjp
* RFC 1035 - page 9
057
2016-07-06
pjp
*/
058
2016-07-06
pjp
059
2016-07-06
pjp
struct dns_rr {
060
2016-07-06
pjp
char *name; /* name of zone */
061
2016-07-06
pjp
char *question; /* pointer to question */
062
2016-07-06
pjp
u_int16_t type; /* type of RR */
063
2016-07-06
pjp
u_int16_t class; /* class of reply */
064
2016-07-06
pjp
u_int32_t ttl; /* ttl of record */
065
2016-07-06
pjp
u_int16_t rdlen; /* length of record */
066
2016-07-06
pjp
char *rdata; /* data of record */
067
2016-07-06
pjp
};
068
2016-07-06
pjp
069
2016-07-06
pjp
/*
070
2016-07-06
pjp
* EDNS0 OPT RR, based on dns_rr
071
2016-07-06
pjp
* RFC 6891 - page 7
072
2016-07-06
pjp
*/
073
2016-07-06
pjp
074
2016-07-06
pjp
struct dns_optrr {
075
2016-07-06
pjp
char name[1]; /* always 0 */
076
2016-07-06
pjp
u_int16_t type; /* must be 41 */
077
2016-07-06
pjp
u_int16_t class; /* UDP payload size (4096) */
078
2016-07-06
pjp
u_int32_t ttl; /* extended RCODE */
079
2016-07-06
pjp
u_int16_t rdlen; /* length of all RDATA */
080
2016-07-06
pjp
char rdata[0]; /* attribute, value pairs */
081
2016-07-06
pjp
}__attribute__((packed));
082
2016-07-06
pjp
083
2019-02-24
pjp
/*
084
2019-02-24
pjp
* TSIG RR, based on dns_rr
085
2019-02-24
pjp
* RFC 2845 and RFC 4635 (for SHA-256)
086
2019-02-24
pjp
*/
087
2019-02-24
pjp
088
2019-02-24
pjp
struct dns_tsigrr {
089
2019-02-24
pjp
u_int64_t timefudge; /* time (48 bits) and fudge */
090
2019-02-24
pjp
u_int16_t macsize; /* MAC size == 32 */
091
2019-02-24
pjp
char mac[32]; /* SHA-256 MAC */
092
2019-02-24
pjp
/* empty unless error == badtime */
093
2019-02-24
pjp
} __attribute__((packed));
094
2019-02-24
pjp
095
2016-07-06
pjp
/* RFC 1035 - page 28 */
096
2016-07-06
pjp
struct dns_question_hdr {
097
2016-07-06
pjp
char *name;
098
2020-07-16
pjp
char *original_name;
099
2016-07-06
pjp
u_int namelen;
100
2016-07-06
pjp
u_int16_t qtype;
101
2016-07-06
pjp
u_int16_t qclass;
102
2016-07-06
pjp
};
103
2016-07-06
pjp
104
2016-07-06
pjp
/*
105
2016-07-06
pjp
* flags RFC 1035, page 26
106
2016-07-06
pjp
*/
107
2016-07-06
pjp
108
2016-07-06
pjp
#define DNS_REPLY 0x8000 /* if set response if not set query */
109
2020-06-28
pjp
#define DNS_UPDATE 0x2800 /* a DNS Update RFC 2136 */
110
2016-07-06
pjp
#define DNS_NOTIFY 0x2000 /* a NOTIFY query RFC 1996 */
111
2016-07-06
pjp
#define DNS_SREQ 0x1000 /* if set a server status request (STATUS) */
112
2016-07-06
pjp
#define DNS_INV 0x800 /* if set an inverse query */
113
2016-07-06
pjp
#define DNS_AUTH 0x400 /* Authoritative Answer (AA) in replies */
114
2016-07-06
pjp
#define DNS_TRUNC 0x200 /* Truncated (TC) */
115
2016-07-06
pjp
#define DNS_RECURSE 0x100 /* if set Recursion Desired (RD) */
116
2016-07-06
pjp
#define DNS_RECAVAIL 0x80 /* if set Recursion Available (RA) */
117
2020-07-18
pjp
#define DNS_AD 0x20 /* if set, Authentic Data (AD), RFC 2535 */
118
2020-07-18
pjp
#define DNS_CD 0x10 /* if set, Checking Disabled (CD), RFC 2535 */
119
2020-08-01
pjp
/* lower 4 bits of RCODE's 0x00 through 0x0F, below */
120
2020-06-27
pjp
#define DNS_NOTZONE 0xA /* RCODE - Not within zone section RFC 2136 */
121
2019-02-24
pjp
#define DNS_NOTAUTH 0x9 /* RCODE - Not Authenticated RFC 2845 */
122
2020-06-27
pjp
#define DNS_NXRRSET 0x8 /* RCODE - RRSET should exist, but doesn't */
123
2020-06-27
pjp
#define DNS_YXRRSET 0x7 /* RCODE - RRSET should not exist, but does */
124
2020-06-27
pjp
#define DNS_YXDOMAIN 0x6 /* RCODE - Should not exist but does RFC 2136 */
125
2016-07-06
pjp
#define DNS_REFUSED 0x5 /* RCODE - Refused */
126
2016-07-06
pjp
#define DNS_NOTIMPL 0x4 /* RCODE - Not Implemented */
127
2016-07-06
pjp
#define DNS_NAMEERR 0x3 /* RCODE - Name Error, NXDOMAIN */
128
2016-07-06
pjp
#define DNS_SERVFAIL 0x2 /* RCODE - Server Failure */
129
2016-07-06
pjp
#define DNS_FORMATERR 0x1 /* RCODE - Format Error */
130
2016-07-06
pjp
#define DNS_NOERR 0x0 /* RCODE - No error */
131
2016-07-06
pjp
132
2020-08-01
pjp
/* Extended RCODE's (part of EDNS0 RFC 2671) */
133
2020-08-01
pjp
134
2020-08-01
pjp
#define DNS_BADALG 0x15 /* RCODE (21) BADALG RFC 2930 sect. 2.6 */
135
2020-08-01
pjp
#define DNS_BADNAME 0x14 /* RCODE (20) BADNAME RFC 2930 sect. 2.6 */
136
2020-08-01
pjp
#define DNS_BADMODE 0x13 /* RCODE (19) BADMODE RFC 2930 sect. 2.6 */
137
2020-08-01
pjp
138
2020-08-01
pjp
/* When DNS_NOTAUTH, add a TSIG header with the following error codes */
139
2020-08-01
pjp
140
2019-02-24
pjp
#define DNS_BADTIME 0x12 /* RCODE (18) BADTIME RFC 2845 p. 3 */
141
2019-02-24
pjp
#define DNS_BADKEY 0x11 /* RCODE (17) BADKEY RFC 2845 p. 3 */
142
2019-02-24
pjp
#define DNS_BADSIG 0x10 /* RCODE (16) BADSIG RFC 2845 p. 3 */
143
2020-08-01
pjp
#define DNS_BADVERS 0x10 /* RCODE (16) BADVERS RFC 2671 p. 6 */
144
2020-08-01
pjp
145
2020-08-01
pjp
/* END of Extended RCODE's */
146
2020-08-01
pjp
147
2016-07-06
pjp
/*
148
2016-07-06
pjp
* macros to set flags (must be converted to network byte order after)
149
2016-07-06
pjp
*/
150
2016-07-06
pjp
151
2016-07-06
pjp
#define SET_DNS_REPLY(x) ((x)->query |= (DNS_REPLY))
152
2016-07-06
pjp
#define SET_DNS_QUERY(x) ((x)->query &= ~(DNS_REPLY))
153
2016-07-06
pjp
#define SET_DNS_NOTIFY(x) ((x)->query |= (DNS_NOTIFY))
154
2016-07-06
pjp
#define SET_DNS_STATUS_REQ(x) ((x)->query |= (DNS_SREQ))
155
2016-07-06
pjp
#define SET_DNS_INVERSE_QUERY(x) ((x)->query |= (DNS_INV))
156
2016-07-06
pjp
#define SET_DNS_AUTHORITATIVE(x) ((x)->query |= (DNS_AUTH))
157
2016-07-06
pjp
#define SET_DNS_TRUNCATION(x) ((x)->query |= (DNS_TRUNC))
158
2016-07-06
pjp
#define SET_DNS_RECURSION(x) ((x)->query |= (DNS_RECURSE))
159
2016-07-06
pjp
#define SET_DNS_RECURSION_AVAIL(x) ((x)->query |= (DNS_RECAVAIL))
160
2020-07-18
pjp
#define SET_DNS_AUTHENTIC_DATA(x) ((x)->query |= (DNS_AD))
161
2020-07-18
pjp
#define SET_DNS_CHECKING_DISABLED(x) ((x)->query |= (DNS_CD))
162
2016-07-06
pjp
#define SET_DNS_RCODE_REFUSED(x) ((x)->query |= (DNS_REFUSED))
163
2016-07-06
pjp
#define SET_DNS_RCODE_NOTIMPL(x) ((x)->query |= (DNS_NOTIMPL))
164
2016-07-06
pjp
#define SET_DNS_RCODE_NAMEERR(x) ((x)->query |= (DNS_NAMEERR))
165
2016-07-06
pjp
#define SET_DNS_RCODE_SERVFAIL(x) ((x)->query |= (DNS_SERVFAIL))
166
2016-07-06
pjp
#define SET_DNS_RCODE_FORMATERR(x) ((x)->query |= (DNS_FORMATERR))
167
2016-07-06
pjp
#define SET_DNS_RCODE_NOERR(x) ((x)->query |= (DNS_NOERR))
168
2019-02-24
pjp
#define SET_DNS_RCODE_NOTAUTH(x) ((x)->query |= (DNS_NOTAUTH))
169
2016-07-06
pjp
170
2016-07-06
pjp
#define UNSET_DNS_NOTIFY(x) ((x)->query &= ~(DNS_NOTIFY))
171
2016-07-06
pjp
#define UNSET_DNS_STATUS_REQ(x) ((x)->query &= ~(DNS_SREQ))
172
2016-07-06
pjp
#define UNSET_DNS_INVERSE_QUERY(x) ((x)->query &= ~(DNS_INV))
173
2016-07-06
pjp
#define UNSET_DNS_AUTHORITATIVE(x) ((x)->query &= ~(DNS_AUTH))
174
2016-07-06
pjp
#define UNSET_DNS_TRUNCATION(x) ((x)->query &= ~(DNS_TRUNC))
175
2016-07-06
pjp
#define UNSET_DNS_RECURSION(x) ((x)->query &= ~(DNS_RECURSE))
176
2016-07-06
pjp
#define UNSET_DNS_RECURSION_AVAIL(x) ((x)->query &= ~(DNS_RECAVAIL))
177
2020-07-18
pjp
#define UNSET_DNS_AUTHENTIC_DATA(x) ((x)->query &= ~(DNS_AD))
178
2020-07-18
pjp
#define UNSET_DNS_CHECKING_DISABLED(x) ((x)->query &= ~(DNS_CD))
179
2016-07-06
pjp
#define UNSET_DNS_RCODE_REFUSED(x) ((x)->query &= ~(DNS_REFUSED))
180
2016-07-06
pjp
#define UNSET_DNS_RCODE_NOTIMPL(x) ((x)->query &= ~(DNS_NOTIMPL))
181
2016-07-06
pjp
#define UNSET_DNS_RCODE_NAMEERR(x) ((x)->query &= ~(DNS_NAMEERR))
182
2016-07-06
pjp
#define UNSET_DNS_RCODE_SERVFAIL(x) ((x)->query &= ~(DNS_SERVFAIL))
183
2016-07-06
pjp
#define UNSET_DNS_RCODE_FORMATERR(x) ((x)->query &= ~(DNS_FORMATERR))
184
2016-07-06
pjp
#define UNSET_DNS_RCODE_NOERR(x) ((x)->query &= ~(DNS_NOERR))
185
2019-02-24
pjp
#define UNSET_DNS_RCODE_NOTAUTH(x) ((x)->query &= ~(DNS_NOTAUTH))
186
2016-07-06
pjp
187
2016-07-06
pjp
/* DNSSEC/EDNS0 options RFC 3225 */
188
2016-07-06
pjp
189
2016-07-06
pjp
#define DNSSEC_OK 0x8000
190
2016-07-06
pjp
191
2016-07-06
pjp
#define SET_DNS_ERCODE_DNSSECOK(x) ((x)->ttl |= (DNSSEC_OK))
192
2016-07-06
pjp
#define UNSET_DNS_ERCODE_DNSSECOK(x) ((x)->ttl &= ~(DNSSEC_OK))
193
2016-07-06
pjp
194
2016-07-06
pjp
/* DNS types - RFC 1035 page 12 */
195
2016-07-06
pjp
196
2020-07-20
pjp
#define DNS_TYPE_A 1 /* start of RFC 1035 */
197
2016-07-06
pjp
#define DNS_TYPE_NS 2
198
2016-07-06
pjp
#define DNS_TYPE_CNAME 5
199
2016-07-06
pjp
#define DNS_TYPE_SOA 6
200
2016-07-06
pjp
#define DNS_TYPE_PTR 12
201
2020-07-20
pjp
#define DNS_TYPE_HINFO 13
202
2016-07-06
pjp
#define DNS_TYPE_MX 15
203
2020-07-20
pjp
#define DNS_TYPE_TXT 16 /* end of RFC 1035 */
204
2020-07-20
pjp
#define DNS_TYPE_RP 17 /* RFC 1183 */
205
2016-07-06
pjp
206
2016-10-20
pjp
#define DNS_TYPE_AAAA 28 /* quad A - RFC 3596 */
207
2016-10-20
pjp
208
2016-07-06
pjp
#define DNS_TYPE_SRV 33 /* RFC 2782, page 8 */
209
2016-07-06
pjp
#define DNS_TYPE_NAPTR 35 /* RFC 2915, page 3 */
210
2016-07-06
pjp
#define DNS_TYPE_OPT 41 /* RFC 6891, page 7 */
211
2016-07-06
pjp
#define DNS_TYPE_DS 43 /* RFC 4034, section 5 */
212
2016-07-06
pjp
#define DNS_TYPE_SSHFP 44 /* RFC 4255 */
213
2016-07-06
pjp
#define DNS_TYPE_RRSIG 46 /* RFC 4034, section 3 */
214
2016-07-06
pjp
#define DNS_TYPE_NSEC 47 /* RFC 4034, section 4 */
215
2016-07-06
pjp
#define DNS_TYPE_DNSKEY 48 /* RFC 4034, section 2 */
216
2016-07-06
pjp
217
2016-07-06
pjp
#define DNS_TYPE_NSEC3 50 /* RFC 5155, section 3 */
218
2016-07-06
pjp
#define DNS_TYPE_NSEC3PARAM 51 /* RFC 5155, section 4 */
219
2016-07-06
pjp
#define DNS_TYPE_TLSA 52 /* RFC 6698, section 7.1 */
220
2016-07-06
pjp
221
2020-08-01
pjp
#define DNS_TYPE_TKEY 249 /* RFC 2930 */
222
2016-07-06
pjp
#define DNS_TYPE_TSIG 250 /* RFC 2845, page 3 */
223
2016-07-06
pjp
#define DNS_TYPE_IXFR 251 /* RFC 1995, page 2 */
224
2016-07-06
pjp
#define DNS_TYPE_AXFR 252 /* RFC 5936, page 10 */
225
2016-07-06
pjp
#define DNS_TYPE_ANY 255
226
2020-07-20
pjp
#define DNS_TYPE_CAA 257 /* RFC 8659 */
227
2016-07-06
pjp
228
2016-07-06
pjp
/* DNS types 0xff00 -> 0xfffe (private use) RFC 5395, page 8 */
229
2016-07-06
pjp
230
2016-07-06
pjp
#define DNS_TYPE_BALANCE 0xfffe /* split horizon dns */
231
2016-07-06
pjp
#define DNS_TYPE_DELEGATE 0xfffd /* ns delegations */
232
2016-07-06
pjp
#define DNS_TYPE_HINT 0xfffc /* root hint */
233
2016-07-06
pjp
234
2016-07-06
pjp
235
2016-07-06
pjp
236
2016-07-06
pjp
/* DNS CLASSES - RFC 1035 page 13 */
237
2016-07-06
pjp
238
2016-07-06
pjp
#define DNS_CLASS_IN 1 /* internet */
239
2016-07-06
pjp
#define DNS_CLASS_CH 3 /* chaos */
240
2016-07-06
pjp
#define DNS_CLASS_HS 4 /* hesiod */
241
2016-07-06
pjp
242
2020-06-28
pjp
#define DNS_CLASS_NONE 254 /* none class RFC 2136 */
243
2016-07-06
pjp
#define DNS_CLASS_ANY 255 /* any class */
244
2016-07-06
pjp
245
2016-07-06
pjp
/* limits */
246
2016-07-06
pjp
247
2016-07-06
pjp
#define DNS_MAXLABEL 63
248
2016-07-06
pjp
#define DNS_MAXNAME 255
249
2016-07-06
pjp
#define DNS_MAXUDP 512
250
2016-07-06
pjp
251
2016-07-06
pjp
/* SSHFP fingerprint sizes */
252
2016-07-06
pjp
253
2016-07-06
pjp
#define DNS_SSHFP_SIZE_SHA1 20 /* RFC 4255 */
254
2016-07-06
pjp
#define DNS_SSHFP_SIZE_SHA256 32 /* RFC 6594 */
255
2016-07-06
pjp
256
2016-07-06
pjp
/* TLSA fingerprint sizes */
257
2016-07-06
pjp
258
2016-07-06
pjp
#define DNS_TLSA_SIZE_SHA256 32 /* RFC 6698 */
259
2016-07-06
pjp
#define DNS_TLSA_SIZE_SHA512 64 /* RFC 6698 */
260
2016-07-06
pjp
261
2019-02-24
pjp
struct tsig {
262
2020-07-14
pjp
int have_tsig; /* 4 */
263
2020-07-14
pjp
int tsigverified; /* 8 */
264
2020-07-14
pjp
int tsigerrorcode; /* 12 */
265
2020-07-14
pjp
char tsigalg[DNS_MAXNAME]; /* 267 */
266
2020-07-14
pjp
int tsigalglen; /* 271 */
267
2020-07-14
pjp
char tsigkey[DNS_MAXNAME]; /* 526 */
268
2020-07-14
pjp
int tsigkeylen; /* 530 */
269
2020-07-14
pjp
char tsigmac[32]; /* 562 */
270
2020-07-14
pjp
int tsigmaclen; /* 566 */
271
2020-07-14
pjp
u_int64_t tsig_timefudge; /* 574 */
272
2020-07-14
pjp
u_int16_t tsigorigid; /* 576 */
273
2020-07-14
pjp
int tsigoffset; /* 580 */
274
2019-02-24
pjp
};
275
2019-02-24
pjp
276
2019-12-11
pjp
#define DEFAULT_TSIG_FUDGE 300
277
2019-12-11
pjp
278
2016-07-06
pjp
struct question {
279
2016-07-06
pjp
struct dns_question_hdr *hdr;
280
2016-07-06
pjp
char *converted_name;
281
2016-07-06
pjp
u_int16_t edns0len;
282
2016-07-06
pjp
u_int8_t ednsversion;
283
2020-07-21
pjp
int rawsocket;
284
2020-07-06
pjp
int aa;
285
2017-09-05
pjp
int rd;
286
2016-07-06
pjp
int dnssecok;
287
2016-07-06
pjp
int badvers;
288
2019-10-25
pjp
int notify;
289
2019-02-24
pjp
struct tsig tsig;
290
2016-07-06
pjp
};
291
2017-11-28
pjp
292
2017-11-28
pjp
struct parsequestion {
293
2017-11-28
pjp
char name[DNS_MAXNAME];
294
2020-07-16
pjp
char original_name[DNS_MAXNAME];
295
2017-11-28
pjp
u_int namelen;
296
2017-11-28
pjp
u_int16_t qtype;
297
2017-11-28
pjp
u_int16_t qclass;
298
2017-11-28
pjp
char converted_name[DNS_MAXNAME + 1];
299
2017-11-28
pjp
u_int16_t edns0len;
300
2017-11-28
pjp
u_int8_t ednsversion;
301
2017-11-28
pjp
int rd;
302
2017-11-28
pjp
int dnssecok;
303
2019-10-25
pjp
int notify;
304
2017-11-28
pjp
int badvers;
305
2019-02-24
pjp
struct tsig tsig;
306
2017-11-28
pjp
int rc; /* return code */
307
2017-11-28
pjp
#define PARSE_RETURN_ACK 0
308
2017-11-28
pjp
#define PARSE_RETURN_NAK 1
309
2017-11-28
pjp
#define PARSE_RETURN_MALFORMED 2
310
2017-11-28
pjp
#define PARSE_RETURN_NOQUESTION 3
311
2017-11-28
pjp
#define PARSE_RETURN_NOTAQUESTION 4
312
2019-02-24
pjp
#define PARSE_RETURN_NOTAUTH 5
313
2020-07-03
pjp
#define PARSE_RETURN_NOTAREPLY 6 /* fwdpq */
314
2020-06-25
pjp
pid_t pid; /* originating pid */
315
2017-11-28
pjp
};
316
2017-11-28
pjp
317
2020-07-03
pjp
struct sforward {
318
2020-07-12
pjp
int family; /* 4 */
319
2020-07-12
pjp
time_t gotit; /* 12 */
320
2020-07-03
pjp
321
2020-07-12
pjp
struct sockaddr_in from4; /* 28 */
322
2020-07-12
pjp
struct sockaddr_in6 from6; /* 56 */
323
2020-07-03
pjp
324
2020-07-12
pjp
int oldsel; /* 60 */
325
2020-07-12
pjp
uint16_t rport; /* 62 */
326
2020-07-12
pjp
char buf[512]; /* 574 */
327
2020-07-12
pjp
int buflen; /* 578 */
328
2020-07-12
pjp
struct dns_header header; /* 592 */
329
2020-07-12
pjp
uint16_t type; /* 594 */
330
2020-07-12
pjp
uint16_t class; /* 596 */
331
2020-07-12
pjp
uint16_t edns0len; /* 598 */
332
2020-07-12
pjp
int dnssecok; /* 602 */
333
2020-07-03
pjp
334
2020-07-12
pjp
int havemac; /* 606 */
335
2020-07-12
pjp
char tsigname[256]; /* 862 */
336
2020-07-12
pjp
int tsignamelen; /* 866 */
337
2020-07-12
pjp
uint64_t tsigtimefudge; /* 874 */
338
2020-07-03
pjp
339
2020-07-12
pjp
char mac[32]; /* 906 */
340
2020-07-03
pjp
};
341
2020-07-03
pjp
342
2017-11-28
pjp
343
2016-07-06
pjp
344
2016-07-06
pjp
#endif /* DNS_H */
repomaster@centroid.eu