Commit adf82221 authored by James Brister's avatar James Brister
Browse files

Rename global option cachesize to cache-size and add corresponding option

to view statement.
parent 0791b485
256. [func] Rename global option cachesize to cache-size and
add corresponding option to view statement.
245. [bug] If an uncompressed name will take more than 255
characters and the buffer is sufficiently long,
dns_name_fromwire should return DNS_R_FORMERR,
......
......@@ -150,7 +150,7 @@ options {
coresize 100;
datasize 101;
files 230;
cachesize 20m;
cache-size 20m;
stacksize 231;
cleaning-interval 1000;
heartbeat-interval 1001;
......@@ -234,6 +234,7 @@ view "test-view" in {
foo.com. 4 3 2 "abdefghijklmnopqrstuvwxyz";
};
sig-validity-interval 45;
cache-size unlimited;
allow-query { 10.0.0.30;};
match-clients { 10.0.0.1 ; };
check-names master warn;
......
......@@ -15,7 +15,7 @@
* SOFTWARE.
*/
/* $Id: confctx.c,v 1.64 2000/06/08 17:26:35 gson Exp $ */
/* $Id: confctx.c,v 1.65 2000/06/09 08:48:38 brister Exp $ */
#include <config.h>
......@@ -961,7 +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_AS_SIZE_CLAUSE(cache_size, "cache-size");
PRINT_INTEGER(max_ncache_ttl, "max-ncache-ttl");
PRINT_INTEGER(max_cache_ttl, "max-cache-ttl");
......
......@@ -16,7 +16,7 @@
* SOFTWARE.
*/
/* $Id: confparser.y,v 1.93 2000/06/08 12:04:54 brister Exp $ */
/* $Id: confparser.y,v 1.94 2000/06/09 08:48:39 brister Exp $ */
#include <config.h>
......@@ -242,7 +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_CACHE_SIZE
%token L_CATEGORY
%token L_CHANNEL
%token L_CHECK_NAMES
......@@ -1919,14 +1919,14 @@ size_clause: L_DATASIZE size_spec
YYABORT;
}
}
| L_CACHESIZE size_spec
| L_CACHE_SIZE size_spec
{
tmpres = dns_c_ctx_setcachesize(currcfg, $2);
if (tmpres == ISC_R_EXISTS) {
parser_error(ISC_FALSE, "cannot redefine cachesize");
parser_error(ISC_FALSE, "cannot redefine cache-size");
YYABORT;
} else if (tmpres != ISC_R_SUCCESS) {
parser_error(ISC_FALSE, "failed to set cachesize");
parser_error(ISC_FALSE, "failed to set cache-size");
YYABORT;
}
}
......@@ -3782,6 +3782,23 @@ view_option: L_FORWARD zone_forward_opt
YYABORT;
}
}
| L_CACHE_SIZE size_spec
{
dns_c_view_t *view = dns_c_ctx_getcurrview(currcfg);
INSIST(view != NULL);
tmpres = dns_c_view_setcachesize(view, $2);
if (tmpres == ISC_R_EXISTS) {
parser_error(ISC_FALSE,
"cannot redefine view cache-size");
YYABORT;
} else if (tmpres != ISC_R_SUCCESS) {
parser_error(ISC_FALSE,
"failed to set view cache-size");
YYABORT;
}
}
| key_stmt
| zone_stmt
| server_stmt
......@@ -5001,7 +5018,7 @@ static struct token keyword_tokens [] = {
{ "auth-nxdomain", L_AUTH_NXDOMAIN },
{ "blackhole", L_BLACKHOLE },
{ "bogus", L_BOGUS },
{ "cachesize", L_CACHESIZE },
{ "cache-size", L_CACHE_SIZE },
{ "category", L_CATEGORY },
{ "class", L_CLASS },
{ "channel", L_CHANNEL },
......
......@@ -15,7 +15,7 @@
* SOFTWARE.
*/
/* $Id: confview.c,v 1.33 2000/06/05 09:17:08 brister Exp $ */
/* $Id: confview.c,v 1.34 2000/06/09 08:48:41 brister Exp $ */
#include <config.h>
......@@ -483,6 +483,7 @@ dns_c_view_new(isc_mem_t *mem, const char *name, dns_rdataclass_t viewclass,
view->max_ncache_ttl = NULL;
view->max_cache_ttl = NULL;
view->sig_valid_interval = NULL;
view->cache_size = NULL;
view->additional_data = NULL;
view->transfer_format = NULL;
......@@ -578,6 +579,19 @@ dns_c_view_print(FILE *fp, int indent, dns_c_view_t *view) {
(unsigned long)(*view->FIELD / 60)); \
}
#define PRINT_AS_SIZE_CLAUSE(FIELD, NAME) \
if (view->FIELD != NULL) { \
dns_c_printtabs(fp, indent + 1); \
fprintf(fp, "%s ",NAME); \
if (*view->FIELD == DNS_C_SIZE_SPEC_DEFAULT) { \
fprintf(fp, "default"); \
} else { \
dns_c_printinunits(fp, *view->FIELD); \
} \
fprintf(fp, ";\n"); \
}
if (view->forward != NULL) {
dns_c_printtabs(fp, indent + 1);
fprintf(fp, "forward %s;\n",
......@@ -664,6 +678,8 @@ dns_c_view_print(FILE *fp, int indent, dns_c_view_t *view) {
PRINT_INT32(max_cache_ttl, "max-cache-ttl");
PRINT_INT32(sig_valid_interval, "sig-validity-interval");
PRINT_AS_SIZE_CLAUSE(cache_size, "cache-size");
if (view->additional_data != NULL) {
dns_c_printtabs(fp, indent + 1);
fprintf(fp, "additional-data %s;\n",
......@@ -795,6 +811,7 @@ dns_c_view_delete(dns_c_view_t **viewptr) {
FREEFIELD(max_ncache_ttl);
FREEFIELD(max_cache_ttl);
FREEFIELD(sig_valid_interval);
FREEFIELD(cache_size);
FREEFIELD(additional_data);
FREEFIELD(transfer_format);
......@@ -1496,7 +1513,12 @@ SETUINT32(sigvalidityinterval, sig_valid_interval)
GETUINT32(sigvalidityinterval, sig_valid_interval)
UNSETUINT32(sigvalidityinterval, sig_valid_interval)
GETUINT32(cachesize, cache_size)
SETUINT32(cachesize, cache_size)
UNSETUINT32(cachesize, cache_size)
GETBYTYPE(dns_c_addata_t, additionaldata, additional_data)
SETBYTYPE(dns_c_addata_t, additionaldata, additional_data)
UNSETBYTYPE(dns_c_addata_t, additionaldata, additional_data)
......@@ -1505,7 +1527,6 @@ GETBYTYPE(dns_transfer_format_t, transferformat, transfer_format)
SETBYTYPE(dns_transfer_format_t, transferformat, transfer_format)
UNSETBYTYPE(dns_transfer_format_t, transferformat, transfer_format)
#if 0
/*
......
......@@ -136,6 +136,7 @@ struct dns_c_view {
isc_uint32_t *max_ncache_ttl;
isc_uint32_t *max_cache_ttl;
isc_uint32_t *sig_valid_interval;
isc_uint32_t *cache_size;
dns_c_addata_t *additional_data;
dns_transfer_format_t *transfer_format;
......@@ -439,6 +440,14 @@ isc_result_t dns_c_view_unsetsigvalidityinterval(dns_c_view_t *view);
isc_result_t dns_c_view_getcachesize(dns_c_view_t *view,
isc_uint32_t *retval);
isc_result_t dns_c_view_setcachesize(dns_c_view_t *view,
isc_uint32_t newval);
isc_result_t dns_c_view_unsetcachesize(dns_c_view_t *view);
isc_result_t dns_c_view_setadditionaldata(dns_c_view_t *view,
dns_c_addata_t newval);
isc_result_t dns_c_view_getadditionaldata(dns_c_view_t *view,
......
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