1
I like keeping Deadwood's code small and lean; this patch doesn't compile
2
in some library functions never used by Deadwood unless compiled with
5
--- deadwood-2.9.05/src/DwRecurse.c 2010-08-20 00:54:13.000000000 -0700
6
+++ deadwood-2.9.06/src/DwRecurse.c 2010-08-29 08:16:16.000000000 -0700
8
extern u_long dont_block;
13
/* Show a single character on the standard output, escaping the
14
* character if it's not printable ASCII */
20
-#endif /* XTRA_STUFF */
21
+#endif /* OTHER_STUFF */
23
/* See if two strings pointing to dname objects are the
24
* same. p1: pointer to the first string; p2: pointer to the second
25
--- deadwood-2.9.05/src/DwStr_functions.h 2010-08-20 00:54:13.000000000 -0700
26
+++ deadwood-2.9.06/src/DwStr_functions.h 2010-08-29 08:15:36.000000000 -0700
29
int dw_put_u8(dw_str *obj, uint8_t value, int32_t offset);
32
/* Read a single bit from a dw_str object. The way we choose the bit is
33
* to first choose the byte with the desired bit, then to choose the
34
* bit in that byte. 0 is the least significant (rightmost) bit; 7 is the
35
* most significant bit.
36
* We return -1 on error, 0 if the bit is 0, and 1 if the bit is 1 */
37
int dw_get_bit(dw_str *obj, int32_t byte, int8_t bit);
38
+#endif /* OTHER_STUFF */
40
/* Compare two dw_string objects to see if they are the same (different max
41
* lengths are allowed). -1 on error, 0 if not the same, and 1 if they are
42
--- deadwood-2.9.05/src/DwStr.c 2010-08-20 00:54:13.000000000 -0700
43
+++ deadwood-2.9.06/src/DwStr.c 2010-08-29 08:27:40.000000000 -0700
45
-/* Copyright (c) 2007-2009 Sam Trenholme
46
+/* Copyright (c) 2007-2010 Sam Trenholme
55
/* Add an arbitrary null-terminated string of length "len" to a DwStr object */
56
int dw_bin_append(uint8_t *add, int len, dw_str *object) {
57
if(dw_assert_sanity(object) == -1) {
62
+#endif /* OTHER_STUFF */
65
/* Add a null-terminated string to a DwStr; if the DwStr is non-0 length,
66
* first add a comma. If the null-terminated string has a comma, stop
67
* appending the string.
72
+#endif /* OTHER_STUFF */
75
/* For debug purposes: Output a dw_str object on the standard output. */
81
/* Read a single bit from a dw_str object. The way we choose the bit is
82
* to first choose the byte with the desired bit, then to choose the
83
* bit in that byte. 0 is the least significant (rightmost) bit; 7 is the
88
+#endif /* OTHER_STUFF */
90
/* Compare two dw_string objects to see if they are the same (different max
91
* lengths are allowed). -1 on error, 0 if not the same, and 1 if they are
97
/* Given a dw_str object, where the dw_str is a raw DNS packet, determine
98
* the TTL for the packet. Note that this only looks at the TTL for the
99
* first RR in a reply. Things like "www.foo.bar. +86400 CNAME www.baz.bar. ~
101
/* BUG: This will not work with packets with only CNAME answers */
102
return dw_get_a_dnsttl(in,offset,31536000,32);
104
+#endif /* OTHER_STUFF */
106
/* Given a packet in the form put in the DNS cache (with things like type,
107
* ancount, nscount, and arcount at the end of the string), tell the user how
108
--- deadwood-2.9.05/doc/compile.options 2010-08-20 00:54:13.000000000 -0700
109
+++ deadwood-2.9.06/doc/compile.options 2010-08-29 08:31:39.000000000 -0700
111
XTRA_STUFF (-DXTRA_STUFF): Add some routines that allow the printing of
112
debug information to standard output.
114
+OTHER_STUFF (-DOTHER_STUFF): Add some routines that aren't actually used
117
HASH_DEBUG (-DHASH_DEBUG): Add information used by the
118
dwood2rc_n_hash_magic_number SQA regression