1
diff -ur deadwood-2.9.04/doc/internals/CACHE.DESIGN deadwood-2.9.05/doc/internals/CACHE.DESIGN
2
--- deadwood-2.9.04/doc/internals/CACHE.DESIGN 2010-07-03 20:28:35.000000000 -0700
3
+++ deadwood-2.9.05/doc/internals/CACHE.DESIGN 2010-08-14 23:02:30.000000000 -0700
5
+[Note: This data is terribly out of date, based on the peliminary design for
6
+ Deadwood 2 back in 2007. In 2010, in order to implement full recursion,
7
+ I added a whole bunch of types, such as CNAME referrals, NS referrals,
8
+ and a couple of types for truncated replies. I also have two different
9
+ types for "not found" packets; one for NXDOMAIN, and another for
10
+ non-NXDOMAIN "not found" replies. See DwRecurse.h and DwRecurse.c for
11
+ an overview; there are extensive comments that explain the datatypes
14
+ I should also point out the simple answers have offsets to RRs in the
15
+ answers, and are no longer stored in compressed form. The following data
16
+ types are only used in the "tiny" 2.3 branch of Deadwood]
18
Cache data: Cached data will use the hash (see HASH.DESIGN)
19
and be stored like this:
21
diff -ur deadwood-2.9.04/doc/internals/CACHE.FILE deadwood-2.9.05/doc/internals/CACHE.FILE
22
--- deadwood-2.9.04/doc/internals/CACHE.FILE 2009-11-11 10:14:04.000000000 -0800
23
+++ deadwood-2.9.05/doc/internals/CACHE.FILE 2010-08-14 23:03:39.000000000 -0700
25
-It is now possible to write the contents of Deadwood-2's cache to a
26
+It is now possible to write the contents of Deadwood-3's cache to a
27
file, and to read the contents of said file to update the cache. This
28
is useful for people with intermittent online connections, who may wish
29
to connect to sites even if their upstream DNS server is dodgy.
31
determined by the maradns_uid and maradns_gid parameters (the reason for
32
these names is for maximum MaraDNS mararc compatibility). For example,
33
in some systems, the user-id and group-id '99' indicate the "nobody"
34
-user; this would be set up as follows in the dwood2rc file:
35
+user; this would be set up as follows in the dwood3rc file:
40
permissions; the cache does list what web sites users go to, which has
41
privacy implications).
43
+Please delete the cache file if making changes to the dwood3rc file;
44
+otherwise changes in this file may not "stick".
46
diff -ur deadwood-2.9.04/doc/internals/CODING.STYLE deadwood-2.9.05/doc/internals/CODING.STYLE
47
--- deadwood-2.9.04/doc/internals/CODING.STYLE 2009-01-22 18:05:34.000000000 -0800
48
+++ deadwood-2.9.05/doc/internals/CODING.STYLE 2010-08-14 23:06:25.000000000 -0700
50
destructor for the string is, and make sure the string is destroyed.
52
I understand that goto is considered bad style in some circles. It is
53
- necessary here to make up for C's lack of error catching.
54
+ necessary here to make up for C's lack of error catching (if only C had
57
* Whenever a string is to be destroyed, make sure the string has a non-0
58
value. Once a string is destoryed, set the string to have a 0 value.
59
This stops double-free()s and freeing of null pointers.
61
* Any indexed writes, such as a[b] = c or *(a + b) = c need to have
62
- some kind of bound checking. This protects us from buffer overflows.
63
+ some kind of bounds checking. This protects us from buffer overflows.
65
* Arrays and strings should always be at least one character longer than
66
you think you will need for the array. This protects us from off-by-one
68
before the function. The size of a function does not include any comments
69
before the function describing the function.
71
+ (When finishing up the recursion, I started ignoring this particular
72
+ rule. Functions are still fairly short and should be easy to follow.)
74
* All functions should be documented with at least a brief comment. If you
75
are not a native English speaker, please let me know, and I will correct
76
any grammatical errors in your comments.
77
diff -ur deadwood-2.9.04/doc/internals/DNS.HEADER deadwood-2.9.05/doc/internals/DNS.HEADER
78
--- deadwood-2.9.04/doc/internals/DNS.HEADER 2007-12-13 21:52:51.000000000 -0800
79
+++ deadwood-2.9.05/doc/internals/DNS.HEADER 2010-08-14 23:08:25.000000000 -0700
81
QR: Must be 0 for packet to be accepted; all replies give this a 1 value
82
OPCODE: Must be 0; 0 in replies
83
AA: Value in query ignored; 0 in replies
84
-TC: Truncation. Ignore value in query; ignore replies where this is 1
85
- (for now; we may do tcp stuff later)
86
+TC: Truncation. Ignore value in query; send empty "truncated" reply when
87
+ this is 1 (they can enable TCP)
88
RD: Must be 1 in query; is 1 in reply
89
RA: Ignored in query; is 1 in reply (because of brain-dead DNS clients)
90
Z: Must be all 0 in query; set to all 0 in reply
92
ANCOUNT: As per the reply we get from the remote server (this number
93
will be stored in the cache)
94
NSCOUNT, ARCOUNT: Same as ANCOUNT
96
+Note that in the case of ARCOUNT being one in a query, we ignore the
97
+AR record (which may be an EDNS OPT query) and act as if the packet
98
+is a simple RFC1035 DNS packet without ENDS data.
100
diff -ur deadwood-2.9.04/doc/internals/Glueless.NS deadwood-2.9.05/doc/internals/Glueless.NS
101
--- deadwood-2.9.04/doc/internals/Glueless.NS 2010-07-03 09:18:20.000000000 -0700
102
+++ deadwood-2.9.05/doc/internals/Glueless.NS 2010-08-14 23:08:58.000000000 -0700
104
+Some overview of how Deadwood handles glueless NS queries
106
Functions which allocate memory for addr.glueless:
108
dwx_ns_getip_glueless(), which is called by dwx_ns_getip(), which is called
110
such as allowing the parent to try again with another NS record; however,
111
for the time being, I have this critter ignore local connections
112
which are referrals to NS glueless resolution.
114
diff -ur deadwood-2.9.04/doc/internals/HASH.DESIGN deadwood-2.9.05/doc/internals/HASH.DESIGN
115
--- deadwood-2.9.04/doc/internals/HASH.DESIGN 2009-11-11 10:20:18.000000000 -0800
116
+++ deadwood-2.9.05/doc/internals/HASH.DESIGN 2010-08-14 23:10:55.000000000 -0700
119
A hash, when stored to disk, has the following format:
121
-* The 32-bit number 0x00445732 ('\0'DW2)
122
+* The 32-bit number 0x00445733 ('\0'DW3)
124
-* A 32-bit number with the number of maximum possible elements in the
126
+* A 32-bit number set to the value of zero. This number is ignored.
128
* Each hash entry is now read; more important hash entries (entries less
129
likely to be deleted when the hash fills up) are placed after less
130
diff -ur deadwood-2.9.04/doc/internals/ROADMAP deadwood-2.9.05/doc/internals/ROADMAP
131
--- deadwood-2.9.04/doc/internals/ROADMAP 2009-11-11 10:20:38.000000000 -0800
132
+++ deadwood-2.9.05/doc/internals/ROADMAP 2010-08-14 23:11:51.000000000 -0700
134
-Deadwood-3: A full DNS recursive resolver. Target date: None
135
+Deadwood-3: A full DNS recursive resolver. Target date: Done; undergoing
138
Plan for recursive design:
141
"ns1.example.com A 192.168.78.32", we make the packet "example.com NS
142
192.168.78.32" and store it in the cache.
144
+(All of this has now been implemented)
145
diff -ur deadwood-2.9.04/doc/internals/TODO deadwood-2.9.05/doc/internals/TODO
146
--- deadwood-2.9.04/doc/internals/TODO 2009-11-11 10:11:51.000000000 -0800
147
+++ deadwood-2.9.05/doc/internals/TODO 2010-08-14 23:14:32.000000000 -0700
150
* If the server sends us "truncated", just give the user this reply
151
without caching it. (DONE; caching disabled for tuncated replies)
152
- Make sure we fully validate a truncated packet.
153
+ Make sure we fully validate a truncated packet. (No, we just tell them
154
+ it's truncated and they can use DNS-over-TCP if enabled)
156
* Bugfix: The Google problem. Google.com's DNS reply is in the form
157
"Cache for one day: Google.com is a CNAME for www.l.google.com;
159
when it really should only cache it for one hour) (DONE)
161
* RFC compliance: Records with a TTL of 0 should not be cached. (DONE
163
+ by Neeo; undone by myself because recursive Deadwood needs to put
164
+ items in the cache before giving them to the user)
166
* Safe cache writing: Write to a temporary file and rename the file to
167
- the name of the cache file when the write is done.
168
+ the name of the cache file when the write is done. (Never done)
170
* Timed cache writing: Allow Deadwood to write to the cache every N minutes;
171
this will allow Windows users to have cachefiles. (The Windows port just
172
- writes the cache when the service is stopped)
173
+ writes the cache when the service is stopped, so Never done)
175
* Windows support: (Windows is important because MaraDNS is the only
176
open source DNS server I know of, besides BIND, to run on Windows)
178
contact that server the next time we try to make a connection. Maybe even
179
have an array of the number of times we have failed to connect to a given
180
upstream server, and have the code use a heuristic to try less connections
181
- with an unreliable server.
182
+ with an unreliable server. (DONE; we round-robin rotate if we can't connect
183
+ to an upstream NS server)