aboutsummaryrefslogtreecommitdiff
path: root/networking/dnsd.c
diff options
context:
space:
mode:
authorRob Landley <rob@landley.net>2006-03-10 19:22:06 +0000
committerRob Landley <rob@landley.net>2006-03-10 19:22:06 +0000
commitbc68cd14ccaebc17e7e03a08e51fddfb91007624 (patch)
treebeb32cedafc6232bf8a49fe90f0769d471ea6791 /networking/dnsd.c
parentdae6aa28598cb2353291f18ca52e768c3259165a (diff)
downloadbusybox-w32-bc68cd14ccaebc17e7e03a08e51fddfb91007624.tar.gz
busybox-w32-bc68cd14ccaebc17e7e03a08e51fddfb91007624.tar.bz2
busybox-w32-bc68cd14ccaebc17e7e03a08e51fddfb91007624.zip
Patch from Denis Vlasenko turning static const int (which gets emitted into
the busybox binary) into enums (which don't).
Diffstat (limited to 'networking/dnsd.c')
-rw-r--r--networking/dnsd.c16
1 files changed, 9 insertions, 7 deletions
diff --git a/networking/dnsd.c b/networking/dnsd.c
index 433b12443..9ca4105d3 100644
--- a/networking/dnsd.c
+++ b/networking/dnsd.c
@@ -27,11 +27,12 @@ static char *fileconf = "/etc/dnsd.conf";
27#define LOCK_FILE "/var/run/dnsd.lock" 27#define LOCK_FILE "/var/run/dnsd.lock"
28#define LOG_FILE "/var/log/dnsd.log" 28#define LOG_FILE "/var/log/dnsd.log"
29 29
30#define MAX_HOST_LEN 16 // longest host name allowed is 15 30enum {
31#define IP_STRING_LEN 18 // .xxx.xxx.xxx.xxx\0 31 MAX_HOST_LEN = 16, // longest host name allowed is 15
32 IP_STRING_LEN = 18, // .xxx.xxx.xxx.xxx\0
32 33
33//must be strlen('.in-addr.arpa') larger than IP_STRING_LEN 34//must be strlen('.in-addr.arpa') larger than IP_STRING_LEN
34static const int MAX_NAME_LEN = (IP_STRING_LEN + 13); 35 MAX_NAME_LEN = (IP_STRING_LEN + 13),
35 36
36/* Cannot get bigger packets than 512 per RFC1035 37/* Cannot get bigger packets than 512 per RFC1035
37 In practice this can be set considerably smaller: 38 In practice this can be set considerably smaller:
@@ -39,12 +40,13 @@ static const int MAX_NAME_LEN = (IP_STRING_LEN + 13);
39 ttl(4B) + rlen(2B) + r (MAX_NAME_LEN =21B) + 40 ttl(4B) + rlen(2B) + r (MAX_NAME_LEN =21B) +
40 2*querystring (2 MAX_NAME_LEN= 42B), all together 90 Byte 41 2*querystring (2 MAX_NAME_LEN= 42B), all together 90 Byte
41*/ 42*/
42static const int MAX_PACK_LEN = 512 + 1; 43 MAX_PACK_LEN = 512 + 1,
43 44
44#define DEFAULT_TTL 30; // increase this when not testing? 45 DEFAULT_TTL = 30, // increase this when not testing?
45 46
46static const int REQ_A = 1; 47 REQ_A = 1,
47static const int REQ_PTR = 12; 48 REQ_PTR = 12
49};
48 50
49struct dns_repl { // resource record, add 0 or 1 to accepted dns_msg in resp 51struct dns_repl { // resource record, add 0 or 1 to accepted dns_msg in resp
50 uint16_t rlen; 52 uint16_t rlen;