2
0
mirror of https://gitlab.isc.org/isc-projects/bind9 synced 2025-08-30 22:15:20 +00:00

dns_master_load*() age_ttl -> options word

This commit is contained in:
Mark Andrews
2001-01-05 03:12:45 +00:00
parent 6cf489f9bc
commit 0deebcd15a
6 changed files with 43 additions and 43 deletions

View File

@@ -15,7 +15,7 @@
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
/* $Id: master_test.c,v 1.25 2000/11/10 05:34:12 bwelling Exp $ */
/* $Id: master_test.c,v 1.26 2001/01/05 03:12:38 marka Exp $ */
#include <config.h>
@@ -85,8 +85,8 @@ main(int argc, char *argv[]) {
dns_rdatacallbacks_init_stdio(&callbacks);
callbacks.add = print_dataset;
result = dns_master_loadfile(argv[1], &origin, &origin, 1,
ISC_FALSE,
result = dns_master_loadfile(argv[1], &origin, &origin,
dns_rdataclass_in, 0,
&callbacks, mctx);
fprintf(stdout, "dns_master_loadfile: %s\n",
dns_result_totext(result));

View File

@@ -15,7 +15,7 @@
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
/* $Id: db.c,v 1.65 2000/12/01 01:22:38 marka Exp $ */
/* $Id: db.c,v 1.66 2001/01/05 03:12:40 marka Exp $ */
/***
*** Imports
@@ -303,7 +303,7 @@ isc_result_t
dns_db_load(dns_db_t *db, const char *filename) {
isc_result_t result, eresult;
dns_rdatacallbacks_t callbacks;
isc_boolean_t age_ttl = ISC_FALSE;
unsigned int options = 0;
/*
* Load master file 'filename' into 'db'.
@@ -312,7 +312,7 @@ dns_db_load(dns_db_t *db, const char *filename) {
REQUIRE(DNS_DB_VALID(db));
if ((db->attributes & DNS_DBATTR_CACHE) != 0)
age_ttl = ISC_TRUE;
options |= DNS_MASTER_AGETTL;
dns_rdatacallbacks_init(&callbacks);
@@ -320,7 +320,7 @@ dns_db_load(dns_db_t *db, const char *filename) {
if (result != ISC_R_SUCCESS)
return (result);
result = dns_master_loadfile(filename, &db->origin, &db->origin,
db->rdclass, age_ttl,
db->rdclass, options,
&callbacks, db->mctx);
eresult = dns_db_endload(db, &callbacks.add_private);
/*

View File

@@ -15,7 +15,7 @@
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
/* $Id: master.h,v 1.26 2000/12/17 23:43:12 marka Exp $ */
/* $Id: master.h,v 1.27 2001/01/05 03:12:45 marka Exp $ */
#ifndef DNS_MASTER_H
#define DNS_MASTER_H 1
@@ -30,6 +30,8 @@
#include <dns/types.h>
#define DNS_MASTER_AGETTL 0x01 /* Age the ttl based on $DATE. */
ISC_LANG_BEGINDECLS
/***
@@ -41,7 +43,7 @@ dns_master_loadfile(const char *master_file,
dns_name_t *top,
dns_name_t *origin,
dns_rdataclass_t zclass,
isc_boolean_t age_ttl,
unsigned int options,
dns_rdatacallbacks_t *callbacks,
isc_mem_t *mctx);
@@ -50,7 +52,7 @@ dns_master_loadstream(FILE *stream,
dns_name_t *top,
dns_name_t *origin,
dns_rdataclass_t zclass,
isc_boolean_t age_ttl,
unsigned int options,
dns_rdatacallbacks_t *callbacks,
isc_mem_t *mctx);
@@ -59,7 +61,7 @@ dns_master_loadbuffer(isc_buffer_t *buffer,
dns_name_t *top,
dns_name_t *origin,
dns_rdataclass_t zclass,
isc_boolean_t age_ttl,
unsigned int options,
dns_rdatacallbacks_t *callbacks,
isc_mem_t *mctx);
@@ -68,7 +70,7 @@ dns_master_loadfileinc(const char *master_file,
dns_name_t *top,
dns_name_t *origin,
dns_rdataclass_t zclass,
isc_boolean_t age_ttl,
unsigned int options,
dns_rdatacallbacks_t *callbacks,
isc_task_t *task,
dns_loaddonefunc_t done, void *done_arg,
@@ -79,7 +81,7 @@ dns_master_loadstreaminc(FILE *stream,
dns_name_t *top,
dns_name_t *origin,
dns_rdataclass_t zclass,
isc_boolean_t age_ttl,
unsigned int options,
dns_rdatacallbacks_t *callbacks,
isc_task_t *task,
dns_loaddonefunc_t done, void *done_arg,
@@ -90,7 +92,7 @@ dns_master_loadbufferinc(isc_buffer_t *buffer,
dns_name_t *top,
dns_name_t *origin,
dns_rdataclass_t zclass,
isc_boolean_t age_ttl,
unsigned int options,
dns_rdatacallbacks_t *callbacks,
isc_task_t *task,
dns_loaddonefunc_t done, void *done_arg,
@@ -99,7 +101,7 @@ dns_master_loadbufferinc(isc_buffer_t *buffer,
isc_result_t
dns_master_loadfilequota(const char *master_file, dns_name_t *top,
dns_name_t *origin, dns_rdataclass_t zclass,
isc_boolean_t age_ttl, dns_rdatacallbacks_t *callbacks,
unsigned int options, dns_rdatacallbacks_t *callbacks,
isc_task_t *task, dns_loaddonefunc_t done,
void *done_arg, dns_loadmgr_t *lmgr,
dns_loadctx_t **ctxp, isc_mem_t *mctx);
@@ -112,7 +114,7 @@ dns_master_loadfilequota(const char *master_file, dns_name_t *top,
* completes. dns_load_master will abort if callbacks->commit returns
* any value other than ISC_R_SUCCESS.
*
* If 'age_ttl' is ISC_TRUE and the master file contains one or more
* If 'DNS_MASTER_AGETTL' is set and the master file contains one or more
* $DATE directives, the TTLs of the data will be aged accordingly.
*
* 'callbacks->commit' is assumed to call 'callbacks->error' or

View File

@@ -15,7 +15,7 @@
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
/* $Id: master.c,v 1.91 2001/01/05 01:02:47 bwelling Exp $ */
/* $Id: master.c,v 1.92 2001/01/05 03:12:41 marka Exp $ */
#include <config.h>
@@ -95,10 +95,10 @@ struct dns_loadctx {
isc_task_t *task;
dns_loaddonefunc_t done;
void *done_arg;
unsigned int options;
isc_boolean_t ttl_known;
isc_boolean_t default_ttl_known;
isc_boolean_t warn_1035;
isc_boolean_t age_ttl;
isc_boolean_t seen_include;
isc_uint32_t ttl;
isc_uint32_t default_ttl;
@@ -340,7 +340,7 @@ loadctx_destroy(dns_loadctx_t *ctx) {
}
static isc_result_t
loadctx_create(isc_mem_t *mctx, isc_boolean_t age_ttl, dns_name_t *top,
loadctx_create(isc_mem_t *mctx, unsigned int options, dns_name_t *top,
dns_rdataclass_t zclass, dns_name_t *origin,
dns_rdatacallbacks_t *callbacks, isc_task_t *task,
dns_loaddonefunc_t done, void *done_arg,
@@ -391,7 +391,7 @@ loadctx_create(isc_mem_t *mctx, isc_boolean_t age_ttl, dns_name_t *top,
ctx->default_ttl_known = ISC_FALSE;
ctx->default_ttl = 0;
ctx->warn_1035 = ISC_TRUE; /* XXX Argument? */
ctx->age_ttl = age_ttl;
ctx->options = options;
ctx->seen_include = ISC_FALSE;
ctx->zclass = zclass;
@@ -1250,7 +1250,7 @@ load(dns_loadctx_t **ctxp) {
if (type == dns_rdatatype_ns && ctx->glue == NULL)
current_has_delegation = ISC_TRUE;
if (ctx->age_ttl) {
if ((ctx->options & DNS_MASTER_AGETTL) != 0) {
/*
* Adjust the TTL for $DATE. If the RR has already
* expired, ignore it without even parsing the rdata
@@ -1431,7 +1431,7 @@ pushfile(const char *master_file, dns_name_t *origin, dns_loadctx_t **ctxp) {
ctx->seen_include = ISC_TRUE;
result = loadctx_create(ctx->mctx, ctx->age_ttl, ctx->top,
result = loadctx_create(ctx->mctx, ctx->options, ctx->top,
ctx->zclass, origin, ctx->callbacks,
ctx->task, ctx->done, ctx->done_arg,
&new);
@@ -1476,13 +1476,13 @@ pushfile(const char *master_file, dns_name_t *origin, dns_loadctx_t **ctxp) {
isc_result_t
dns_master_loadfile(const char *master_file, dns_name_t *top,
dns_name_t *origin,
dns_rdataclass_t zclass, isc_boolean_t age_ttl,
dns_rdataclass_t zclass, unsigned int options,
dns_rdatacallbacks_t *callbacks, isc_mem_t *mctx)
{
dns_loadctx_t *ctx = NULL;
isc_result_t result;
result = loadctx_create(mctx, age_ttl, top, zclass, origin,
result = loadctx_create(mctx, options, top, zclass, origin,
callbacks, NULL, NULL, NULL, &ctx);
if (result != ISC_R_SUCCESS)
return (result);
@@ -1503,7 +1503,7 @@ dns_master_loadfile(const char *master_file, dns_name_t *top,
isc_result_t
dns_master_loadfilequota(const char *master_file, dns_name_t *top,
dns_name_t *origin, dns_rdataclass_t zclass,
isc_boolean_t age_ttl,
unsigned int options,
dns_rdatacallbacks_t *callbacks,
isc_task_t *task, dns_loaddonefunc_t done,
void *done_arg, dns_loadmgr_t *lmgr,
@@ -1517,7 +1517,7 @@ dns_master_loadfilequota(const char *master_file, dns_name_t *top,
REQUIRE(DNS_LMGR_VALID(lmgr));
REQUIRE(ctxp != NULL && *ctxp == NULL);
result = loadctx_create(mctx, age_ttl, top, zclass, origin,
result = loadctx_create(mctx, options, top, zclass, origin,
callbacks, task, done, done_arg, &ctx);
if (result != ISC_R_SUCCESS)
goto cleanup;
@@ -1607,7 +1607,7 @@ loadmgr_start(isc_task_t *task, isc_event_t *event) {
isc_result_t
dns_master_loadfileinc(const char *master_file, dns_name_t *top,
dns_name_t *origin, dns_rdataclass_t zclass,
isc_boolean_t age_ttl, dns_rdatacallbacks_t *callbacks,
unsigned int options, dns_rdatacallbacks_t *callbacks,
isc_task_t *task, dns_loaddonefunc_t done,
void *done_arg, isc_mem_t *mctx)
{
@@ -1617,7 +1617,7 @@ dns_master_loadfileinc(const char *master_file, dns_name_t *top,
REQUIRE(task != NULL);
REQUIRE(done != NULL);
result = loadctx_create(mctx, age_ttl, top, zclass, origin,
result = loadctx_create(mctx, options, top, zclass, origin,
callbacks, task, done, done_arg, &ctx);
if (result != ISC_R_SUCCESS)
return (result);
@@ -1638,7 +1638,7 @@ dns_master_loadfileinc(const char *master_file, dns_name_t *top,
isc_result_t
dns_master_loadstream(FILE *stream, dns_name_t *top, dns_name_t *origin,
dns_rdataclass_t zclass, isc_boolean_t age_ttl,
dns_rdataclass_t zclass, unsigned int options,
dns_rdatacallbacks_t *callbacks, isc_mem_t *mctx)
{
isc_result_t result;
@@ -1646,7 +1646,7 @@ dns_master_loadstream(FILE *stream, dns_name_t *top, dns_name_t *origin,
REQUIRE(stream != NULL);
result = loadctx_create(mctx, age_ttl, top, zclass, origin,
result = loadctx_create(mctx, options, top, zclass, origin,
callbacks, NULL, NULL, NULL, &ctx);
if (result != ISC_R_SUCCESS)
goto cleanup;
@@ -1666,7 +1666,7 @@ dns_master_loadstream(FILE *stream, dns_name_t *top, dns_name_t *origin,
isc_result_t
dns_master_loadstreaminc(FILE *stream, dns_name_t *top, dns_name_t *origin,
dns_rdataclass_t zclass, isc_boolean_t age_ttl,
dns_rdataclass_t zclass, unsigned int options,
dns_rdatacallbacks_t *callbacks, isc_task_t *task,
dns_loaddonefunc_t done, void *done_arg,
isc_mem_t *mctx)
@@ -1678,7 +1678,7 @@ dns_master_loadstreaminc(FILE *stream, dns_name_t *top, dns_name_t *origin,
REQUIRE(task != NULL);
REQUIRE(done != NULL);
result = loadctx_create(mctx, age_ttl, top, zclass, origin,
result = loadctx_create(mctx, options, top, zclass, origin,
callbacks, task, done, done_arg, &ctx);
if (result != ISC_R_SUCCESS)
goto cleanup;
@@ -1700,7 +1700,7 @@ dns_master_loadstreaminc(FILE *stream, dns_name_t *top, dns_name_t *origin,
isc_result_t
dns_master_loadbuffer(isc_buffer_t *buffer, dns_name_t *top,
dns_name_t *origin, dns_rdataclass_t zclass,
isc_boolean_t age_ttl,
unsigned int options,
dns_rdatacallbacks_t *callbacks, isc_mem_t *mctx)
{
isc_result_t result;
@@ -1708,7 +1708,7 @@ dns_master_loadbuffer(isc_buffer_t *buffer, dns_name_t *top,
REQUIRE(buffer != NULL);
result = loadctx_create(mctx, age_ttl, top, zclass, origin,
result = loadctx_create(mctx, options, top, zclass, origin,
callbacks, NULL, NULL, NULL, &ctx);
if (result != ISC_R_SUCCESS)
return (result);
@@ -1729,7 +1729,7 @@ dns_master_loadbuffer(isc_buffer_t *buffer, dns_name_t *top,
isc_result_t
dns_master_loadbufferinc(isc_buffer_t *buffer, dns_name_t *top,
dns_name_t *origin, dns_rdataclass_t zclass,
isc_boolean_t age_ttl,
unsigned int options,
dns_rdatacallbacks_t *callbacks, isc_task_t *task,
dns_loaddonefunc_t done, void *done_arg,
isc_mem_t *mctx)
@@ -1741,7 +1741,7 @@ dns_master_loadbufferinc(isc_buffer_t *buffer, dns_name_t *top,
REQUIRE(task != NULL);
REQUIRE(done != NULL);
result = loadctx_create(mctx, age_ttl, top, zclass, origin,
result = loadctx_create(mctx, options, top, zclass, origin,
callbacks, task, done, done_arg, &ctx);
if (result != ISC_R_SUCCESS)
return (result);

View File

@@ -15,7 +15,7 @@
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
/* $Id: rootns.c,v 1.16 2000/10/17 07:22:32 marka Exp $ */
/* $Id: rootns.c,v 1.17 2001/01/05 03:12:42 marka Exp $ */
#include <config.h>
@@ -95,16 +95,14 @@ dns_rootns_create(isc_mem_t *mctx, dns_rdataclass_t rdclass,
* Load the hints from the specified filename.
*/
result = dns_master_loadfile(filename, &db->origin,
&db->origin,
db->rdclass, ISC_FALSE,
&db->origin, db->rdclass, 0,
&callbacks, db->mctx);
} else if (rdclass == dns_rdataclass_in) {
/*
* Default to using the Internet root servers.
*/
result = dns_master_loadbuffer(&source, &db->origin,
&db->origin,
db->rdclass, ISC_FALSE,
&db->origin, db->rdclass, 0,
&callbacks, db->mctx);
} else
result = ISC_R_NOTFOUND;

View File

@@ -15,7 +15,7 @@
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
/* $Id: zone.c,v 1.289 2001/01/05 00:51:04 marka Exp $ */
/* $Id: zone.c,v 1.290 2001/01/05 03:12:43 marka Exp $ */
#include <config.h>
@@ -1003,7 +1003,7 @@ zone_gotreadhandle(isc_task_t *task, isc_event_t *event) {
result = dns_master_loadfileinc(load->zone->masterfile,
dns_db_origin(load->db),
dns_db_origin(load->db),
load->zone->rdclass, ISC_FALSE,
load->zone->rdclass, 0,
&load->callbacks, task,
zone_loaddone, load, load->zone->mctx);
if (result != ISC_R_SUCCESS && result != DNS_R_CONTINUE &&