Commit 71a43393 authored by James Brister's avatar James Brister
Browse files

Empty named.conf file and empty options statement are now parsed properly.

New cachesize option for named.conf

Fixed incorrect warning about auth-nxdomain usage.
parent f357e4e8
244. [bug] empty named.conf file and empty options statement are
now parsed properly.
243. [func] new cachesize option for named.conf
242. [cleanup] fixed incorrect warning about auth-nxdomain usage.
241. [cleanup] nscount and soacount have been removed from the
dns_master_*() arguement lists.
......
......@@ -150,6 +150,7 @@ options {
coresize 100;
datasize 101;
files 230;
cachesize 20m;
stacksize 231;
cleaning-interval 1000;
heartbeat-interval 1001;
......
......@@ -15,7 +15,7 @@
* SOFTWARE.
*/
/* $Id: confctx.c,v 1.62 2000/06/05 22:08:43 brister Exp $ */
/* $Id: confctx.c,v 1.63 2000/06/08 12:04:53 brister Exp $ */
#include <config.h>
......@@ -253,7 +253,7 @@ dns_c_checkconfig(dns_c_ctx_t *cfg)
}
if (dns_c_ctx_getauthnxdomain(cfg, &bval) == ISC_R_NOTFOUND) {
if (dns_c_ctx_getauthnxdomain(cfg, &bval) != ISC_R_NOTFOUND) {
isc_log_write(dns_lctx,DNS_LOGCATEGORY_CONFIG,
DNS_LOGMODULE_CONFIG, ISC_LOG_WARNING,
"the default for the 'auth-nxdomain' option "
......@@ -424,6 +424,14 @@ dns_c_checkconfig(dns_c_ctx_t *cfg)
}
if (dns_c_ctx_getcachesize(cfg, &uintval) != ISC_R_NOTFOUND) {
isc_log_write(dns_lctx,DNS_LOGCATEGORY_CONFIG,
DNS_LOGMODULE_CONFIG, ISC_LOG_WARNING,
"option 'cachesize' is not yet "
"implemented");
}
if (dns_c_ctx_getstacksize(cfg, &uintval) != ISC_R_NOTFOUND) {
isc_log_write(dns_lctx,DNS_LOGCATEGORY_CONFIG,
DNS_LOGMODULE_CONFIG, ISC_LOG_WARNING,
......@@ -953,6 +961,7 @@ dns_c_ctx_optionsprint(FILE *fp, int indent, dns_c_options_t *options)
PRINT_AS_SIZE_CLAUSE(stack_size, "stacksize");
PRINT_AS_SIZE_CLAUSE(core_size, "coresize");
PRINT_AS_SIZE_CLAUSE(files, "files");
PRINT_AS_SIZE_CLAUSE(cache_size, "cachesize");
PRINT_INTEGER(max_ncache_ttl, "max-ncache-ttl");
PRINT_INTEGER(max_cache_ttl, "max-cache-ttl");
......@@ -1441,6 +1450,7 @@ dns_c_ctx_optionsnew(isc_mem_t *mem, dns_c_options_t **options)
opts->stack_size = NULL;
opts->core_size = NULL;
opts->files = NULL;
opts->cache_size = NULL;
opts->max_ncache_ttl = NULL;
opts->max_cache_ttl = NULL;
......@@ -1594,6 +1604,7 @@ dns_c_ctx_optionsdelete(dns_c_options_t **opts)
FREEFIELD(stack_size);
FREEFIELD(core_size);
FREEFIELD(files);
FREEFIELD(cache_size);
FREEFIELD(max_ncache_ttl);
FREEFIELD(max_cache_ttl);
......@@ -1817,6 +1828,11 @@ SETUINT32(files, files)
UNSETUINT32(files, files)
GETUINT32(cachesize, cache_size)
SETUINT32(cachesize, cache_size)
UNSETUINT32(cachezie, cache_size)
GETUINT32(maxncachettl, max_ncache_ttl)
SETUINT32(maxncachettl, max_ncache_ttl)
UNSETUINT32(maxncachettl, max_ncache_ttl)
......
......@@ -16,7 +16,7 @@
* SOFTWARE.
*/
/* $Id: confparser.y,v 1.92 2000/06/08 05:26:38 explorer Exp $ */
/* $Id: confparser.y,v 1.93 2000/06/08 12:04:54 brister Exp $ */
#include <config.h>
......@@ -242,6 +242,7 @@ static isc_boolean_t int_too_big(isc_uint32_t base, isc_uint32_t mult);
%token L_BANG
%token L_BLACKHOLE
%token L_BOGUS
%token L_CACHESIZE
%token L_CATEGORY
%token L_CHANNEL
%token L_CHECK_NAMES
......@@ -442,7 +443,8 @@ static isc_boolean_t int_too_big(isc_uint32_t base, isc_uint32_t mult);
%%
config_file: statement_list
config_file: /* nothing */
| statement_list
;
statement_list: statement
......@@ -527,8 +529,13 @@ options_stmt: L_OPTIONS
}
;
options: option L_EOS
| options option L_EOS
options_list: option L_EOS
| options_list option L_EOS
;
options: /* nothin */
| options_list
;
......@@ -1912,6 +1919,17 @@ size_clause: L_DATASIZE size_spec
YYABORT;
}
}
| L_CACHESIZE size_spec
{
tmpres = dns_c_ctx_setcachesize(currcfg, $2);
if (tmpres == ISC_R_EXISTS) {
parser_error(ISC_FALSE, "cannot redefine cachesize");
YYABORT;
} else if (tmpres != ISC_R_SUCCESS) {
parser_error(ISC_FALSE, "failed to set cachesize");
YYABORT;
}
}
;
......@@ -4983,6 +5001,7 @@ static struct token keyword_tokens [] = {
{ "auth-nxdomain", L_AUTH_NXDOMAIN },
{ "blackhole", L_BLACKHOLE },
{ "bogus", L_BOGUS },
{ "cachesize", L_CACHESIZE },
{ "category", L_CATEGORY },
{ "class", L_CLASS },
{ "channel", L_CHANNEL },
......
......@@ -142,6 +142,7 @@ struct dns_c_options {
isc_uint32_t *stack_size;
isc_uint32_t *core_size;
isc_uint32_t *files;
isc_uint32_t *cache_size;
isc_uint32_t *max_ncache_ttl;
isc_uint32_t *max_cache_ttl;
......@@ -448,6 +449,11 @@ isc_result_t dns_c_ctx_getfiles(dns_c_ctx_t *cfg, isc_uint32_t *retval);
isc_result_t dns_c_ctx_unsetfiles(dns_c_ctx_t *cfg);
isc_result_t dns_c_ctx_setcachesize(dns_c_ctx_t *cfg, isc_uint32_t newval);
isc_result_t dns_c_ctx_getcachesize(dns_c_ctx_t *cfg, isc_uint32_t *retval);
isc_result_t dns_c_ctx_unsetcachesize(dns_c_ctx_t *cfg);
isc_result_t dns_c_ctx_setmaxncachettl(dns_c_ctx_t *cfg, isc_uint32_t newval);
isc_result_t dns_c_ctx_getmaxncachettl(dns_c_ctx_t *cfg, isc_uint32_t *retval);
isc_result_t dns_c_ctx_unsetmaxncachettl(dns_c_ctx_t *cfg);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment