diff --git a/CHANGELOG b/CHANGELOG index edd76510..14ef1c8b 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -19,6 +19,10 @@ HISTORY ++ New features: + 2007-12-12 Frédéric Bernon + * dns.h, dns.c, opt.h: move DNS options to the "right" place. Most visibles + are the one which have ram usage. + 2007-12-05 Frédéric Bernon * netdb.c: add a LWIP_DNS_API_HOSTENT_STORAGE option to decide to use a static set of variables (=0) or a local one (=1). In this last case, your port should diff --git a/src/core/dns.c b/src/core/dns.c index 43a37107..03bbe658 100644 --- a/src/core/dns.c +++ b/src/core/dns.c @@ -92,31 +92,18 @@ #define DNS_SERVER_PORT 53 #endif -/* DNS maximum number of entries to maintain locally. */ -#ifndef DNS_TABLE_SIZE -#define DNS_TABLE_SIZE 4 -#endif - -/** DNS maximum host name length supported in the name table. */ -#ifndef DNS_MAX_NAME_LENGTH -#define DNS_MAX_NAME_LENGTH 256 -#endif - /** DNS maximum number of retries when asking for a name, before "timeout". */ #ifndef DNS_MAX_RETRIES #define DNS_MAX_RETRIES 4 #endif -/** DNS do a name checking between the query and the response. */ -#ifndef DNS_DOES_NAME_CHECK -#define DNS_DOES_NAME_CHECK 1 +/** DNS resource record max. TTL (one week as default) */ +#ifndef DNS_MAX_TTL +#define DNS_MAX_TTL 604800 #endif -/** DNS use a local buffer if DNS_USES_STATIC_BUF=0, a static one if - DNS_USES_STATIC_BUF=1, or a dynamic one if DNS_USES_STATIC_BUF=2. */ -#ifndef DNS_USES_STATIC_BUF -#define DNS_USES_STATIC_BUF 1 -#endif +/** DNS message max. size */ +#define DNS_MSG_SIZE 512 /* DNS protocol flags */ #define DNS_FLAG1_RESPONSE 0x80 diff --git a/src/include/lwip/dns.h b/src/include/lwip/dns.h index 2d05a775..744c510d 100644 --- a/src/include/lwip/dns.h +++ b/src/include/lwip/dns.h @@ -38,22 +38,9 @@ #if LWIP_DNS /* don't build if not configured for use in lwipopts.h */ -/** The maximum of DNS servers */ -#ifndef DNS_MAX_SERVERS -#define DNS_MAX_SERVERS 2 -#endif - -/** DNS resource record max. TTL (one week as default) */ -#ifndef DNS_MAX_TTL -#define DNS_MAX_TTL 604800 -#endif - /** DNS timer period */ #define DNS_TMR_INTERVAL 1000 -/** DNS message max. size */ -#define DNS_MSG_SIZE 512 - /** DNS field TYPE used for "Resource Records" */ #define DNS_RRTYPE_A 1 /* a host address */ #define DNS_RRTYPE_NS 2 /* an authoritative name server */ diff --git a/src/include/lwip/opt.h b/src/include/lwip/opt.h index 32827dc0..3f49b3b0 100644 --- a/src/include/lwip/opt.h +++ b/src/include/lwip/opt.h @@ -559,6 +559,32 @@ #define LWIP_DNS 0 #endif +/** DNS maximum number of entries to maintain locally. */ +#ifndef DNS_TABLE_SIZE +#define DNS_TABLE_SIZE 4 +#endif + +/** DNS maximum host name length supported in the name table. */ +#ifndef DNS_MAX_NAME_LENGTH +#define DNS_MAX_NAME_LENGTH 256 +#endif + +/** The maximum of DNS servers */ +#ifndef DNS_MAX_SERVERS +#define DNS_MAX_SERVERS 2 +#endif + +/** DNS do a name checking between the query and the response. */ +#ifndef DNS_DOES_NAME_CHECK +#define DNS_DOES_NAME_CHECK 1 +#endif + +/** DNS use a local buffer if DNS_USES_STATIC_BUF=0, a static one if + DNS_USES_STATIC_BUF=1, or a dynamic one if DNS_USES_STATIC_BUF=2. */ +#ifndef DNS_USES_STATIC_BUF +#define DNS_USES_STATIC_BUF 1 +#endif + /* --------------------------------- ---------- UDP options ----------