Commit 54d64c79 authored by Brian Wellington's avatar Brian Wellington

782. [feature] Implement the serial-query-rate option.

parent 4c03e69a
782. [feature] Implement the serial-query-rate option.
781. [func] Avoid error packet loops by dropping duplicate FORMERR
responses. [RT #1006]
......
......@@ -15,7 +15,7 @@
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
/* $Id: config.c,v 1.5 2001/03/14 21:53:20 halley Exp $ */
/* $Id: config.c,v 1.6 2001/03/19 22:34:05 bwelling Exp $ */
#include <config.h>
......@@ -71,6 +71,7 @@ options {\n\
recursive-clients 1000;\n\
rrset-order {order cyclic;};\n\
serial-queries 20;\n\
serial-query-rate 20;\n\
stacksize default;\n\
statistics-file \"named.stats\";\n\
statistics-interval 3600;\n\
......
......@@ -15,7 +15,7 @@
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
/* $Id: server.c,v 1.306 2001/03/16 22:59:31 bwelling Exp $ */
/* $Id: server.c,v 1.307 2001/03/19 22:34:06 bwelling Exp $ */
#include <config.h>
......@@ -1648,6 +1648,11 @@ load_configuration(const char *filename, ns_server_t *server,
INSIST(result == ISC_R_SUCCESS);
dns_zonemgr_settransfersperns(server->zonemgr, cfg_obj_asuint32(obj));
obj = NULL;
result = ns_config_get(maps, "serial-query-rate", &obj);
INSIST(result == ISC_R_SUCCESS);
dns_zonemgr_setserialqueryrate(server->zonemgr, cfg_obj_asuint32(obj));
/*
* Determine which port to use for listening for incoming connections.
*/
......
Copyright (C) 2000, 2001 Internet Software Consortium.
See COPYRIGHT in the source root or http://isc.org/copyright.html for terms.
$Id: options,v 1.64 2001/03/16 18:18:57 bwelling Exp $
$Id: options,v 1.65 2001/03/19 22:34:08 bwelling Exp $
This is a summary of the implementation status of the various named.conf
options in BIND 9.
......@@ -85,6 +85,7 @@ options {
[ max-cache-size size_spec; ] No*
[ min-roots number; ] Obsolete
[ serial-queries number; ] Obsolete
[ serial-query-rate number; ] Yes*
[ transfer-format ( one-answer | many-answers ); ] Yes%
[ transfers-in number; ] Yes
[ transfers-out number; ] Yes
......
......@@ -15,7 +15,7 @@
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
/* $Id: zone.h,v 1.100 2001/02/26 01:45:57 marka Exp $ */
/* $Id: zone.h,v 1.101 2001/03/19 22:34:11 bwelling Exp $ */
#ifndef DNS_ZONE_H
#define DNS_ZONE_H 1
......@@ -1232,6 +1232,24 @@ dns_zonemgr_getiolimit(dns_zonemgr_t *zmgr);
* 'zmgr' to be a valid zone manager.
*/
void
dns_zonemgr_setserialqueryrate(dns_zonemgr_t *zmgr, unsigned int value);
/*
* Set the number of SOA queries sent per second.
*
* Requires:
* 'zmgr' to be a valid zone manager
*/
unsigned int
dns_zonemgr_getserialqueryrate(dns_zonemgr_t *zmgr);
/*
* Return the number of SOA queries sent per second.
*
* Requires:
* 'zmgr' to be a valid zone manager.
*/
void
dns_zone_forcereload(dns_zone_t *zone);
/*
......
......@@ -15,7 +15,7 @@
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
/* $Id: zone.c,v 1.311 2001/03/01 17:46:59 bwelling Exp $ */
/* $Id: zone.c,v 1.312 2001/03/19 22:34:09 bwelling Exp $ */
#include <config.h>
......@@ -275,6 +275,7 @@ struct dns_zonemgr {
/* Configuration data. */
int transfersin;
int transfersperns;
unsigned int serialqueryrate;
/* Locked by iolock */
isc_uint32_t iolimit;
......@@ -5209,7 +5210,7 @@ dns_zonemgr_create(isc_mem_t *mctx, isc_taskmgr_t *taskmgr,
&zmgr->rl);
if (result != ISC_R_SUCCESS)
goto free_task;
/* 20 refresh queries / notifies per second. */
/* default to 20 refresh queries / notifies per second. */
isc_interval_set(&interval, 0, 1000000000/2);
result = isc_ratelimiter_setinterval(zmgr->rl, &interval);
RUNTIME_CHECK(result == ISC_R_SUCCESS);
......@@ -5752,6 +5753,41 @@ dns_zonemgr_dbdestroyed(isc_task_t *task, isc_event_t *event) {
}
#endif
void
dns_zonemgr_setserialqueryrate(dns_zonemgr_t *zmgr, unsigned int value) {
isc_interval_t interval;
isc_uint32_t ns;
isc_uint32_t pertic;
isc_result_t result;
REQUIRE(DNS_ZONEMGR_VALID(zmgr));
if (value == 0)
value = 1;
if (value < 10) {
ns = 1000000000 / value;
pertic = 1;
} else {
ns = (1000000000 / value) * 10;
pertic = 10;
}
isc_interval_set(&interval, 0, ns);
result = isc_ratelimiter_setinterval(zmgr->rl, &interval);
RUNTIME_CHECK(result == ISC_R_SUCCESS);
isc_ratelimiter_setpertic(zmgr->rl, pertic);
zmgr->serialqueryrate = value;
}
unsigned int
dns_zonemgr_getserialqueryrate(dns_zonemgr_t *zmgr) {
REQUIRE(DNS_ZONEMGR_VALID(zmgr));
return (zmgr->serialqueryrate);
}
void
dns_zone_forcereload(dns_zone_t *zone) {
REQUIRE(DNS_ZONE_VALID(zone));
......
......@@ -15,7 +15,7 @@
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
/* $Id: parser.c,v 1.47 2001/03/14 21:53:29 halley Exp $ */
/* $Id: parser.c,v 1.48 2001/03/19 22:34:12 bwelling Exp $ */
#include <config.h>
......@@ -815,6 +815,7 @@ options_clauses[] = {
{ "recursive-clients", &cfg_type_uint32, 0 },
{ "rrset-order", &cfg_type_rrsetorder, 0 },
{ "serial-queries", &cfg_type_uint32, CFG_CLAUSEFLAG_OBSOLETE },
{ "serial-query-rate", &cfg_type_uint32, 0 },
{ "stacksize", &cfg_type_size, 0 },
{ "statistics-file", &cfg_type_qstring, 0 },
{ "statistics-interval", &cfg_type_uint32, CFG_CLAUSEFLAG_NYI },
......
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