mirror of
https://gitlab.isc.org/isc-projects/bind9
synced 2025-09-02 07:35:26 +00:00
Used a unsigned int rather than a boolean to indicate subtrations making
the API more consistant between dns_db_{add,subtract}rdataset(), dns_rdataslab_{merge,subtract}(). Adjust previous CHANGES to reflect above as this is not yet end user visible. Add missing CHANGES entry for add/merge.
This commit is contained in:
11
CHANGES
11
CHANGES
@@ -1,3 +1,6 @@
|
|||||||
|
585. [func] dns_db_addrdataset() and and dns_rdataslab_merge()
|
||||||
|
now support 'exact' additions in a similar manner to
|
||||||
|
dns_db_subtractrdataset() and dns_rdataslab_subtract().
|
||||||
|
|
||||||
584. [func] You can now say 'notify explicit'; to suppress
|
584. [func] You can now say 'notify explicit'; to suppress
|
||||||
notification of the servers listed in NS records
|
notification of the servers listed in NS records
|
||||||
@@ -170,10 +173,10 @@
|
|||||||
526. [bug] nsupdate incorrectly refused to add RRs with a TTL
|
526. [bug] nsupdate incorrectly refused to add RRs with a TTL
|
||||||
of 0.
|
of 0.
|
||||||
|
|
||||||
525. [func] New argument 'exact' for dns_db_subtractrdataset(),
|
525. [func] New arguments 'options' for dns_db_subtractrdataset(),
|
||||||
and dns_rdataslab_subtract() requesting that the RR's
|
and 'flags' for dns_rdataslab_subtract() allowing you
|
||||||
must exist prior to deletion. DNS_R_NOTEXACT is
|
to request that the RR's must exist prior to deletion.
|
||||||
returned if the condition is not met.
|
DNS_R_NOTEXACT is returned if the condition is not met.
|
||||||
|
|
||||||
524. [func] The 'forward' and 'forwarders' statement in
|
524. [func] The 'forward' and 'forwarders' statement in
|
||||||
non-forward zones should work now.
|
non-forward zones should work now.
|
||||||
|
@@ -15,7 +15,7 @@
|
|||||||
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/* $Id: db.c,v 1.64 2000/11/30 13:19:04 marka Exp $ */
|
/* $Id: db.c,v 1.65 2000/12/01 01:22:38 marka Exp $ */
|
||||||
|
|
||||||
/***
|
/***
|
||||||
*** Imports
|
*** Imports
|
||||||
@@ -631,7 +631,7 @@ dns_db_addrdataset(dns_db_t *db, dns_dbnode_t *node, dns_dbversion_t *version,
|
|||||||
isc_result_t
|
isc_result_t
|
||||||
dns_db_subtractrdataset(dns_db_t *db, dns_dbnode_t *node,
|
dns_db_subtractrdataset(dns_db_t *db, dns_dbnode_t *node,
|
||||||
dns_dbversion_t *version, dns_rdataset_t *rdataset,
|
dns_dbversion_t *version, dns_rdataset_t *rdataset,
|
||||||
isc_boolean_t exact, dns_rdataset_t *newrdataset)
|
unsigned int options, dns_rdataset_t *newrdataset)
|
||||||
{
|
{
|
||||||
/*
|
/*
|
||||||
* Remove any rdata in 'rdataset' from 'node' in version 'version' of
|
* Remove any rdata in 'rdataset' from 'node' in version 'version' of
|
||||||
@@ -649,7 +649,7 @@ dns_db_subtractrdataset(dns_db_t *db, dns_dbnode_t *node,
|
|||||||
! dns_rdataset_isassociated(newrdataset)));
|
! dns_rdataset_isassociated(newrdataset)));
|
||||||
|
|
||||||
return ((db->methods->subtractrdataset)(db, node, version, rdataset,
|
return ((db->methods->subtractrdataset)(db, node, version, rdataset,
|
||||||
exact, newrdataset));
|
options, newrdataset));
|
||||||
}
|
}
|
||||||
|
|
||||||
isc_result_t
|
isc_result_t
|
||||||
|
@@ -15,7 +15,7 @@
|
|||||||
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/* $Id: db.h,v 1.61 2000/11/30 13:19:08 marka Exp $ */
|
/* $Id: db.h,v 1.62 2000/12/01 01:22:44 marka Exp $ */
|
||||||
|
|
||||||
#ifndef DNS_DB_H
|
#ifndef DNS_DB_H
|
||||||
#define DNS_DB_H 1
|
#define DNS_DB_H 1
|
||||||
@@ -134,7 +134,7 @@ typedef struct dns_dbmethods {
|
|||||||
isc_result_t (*subtractrdataset)(dns_db_t *db, dns_dbnode_t *node,
|
isc_result_t (*subtractrdataset)(dns_db_t *db, dns_dbnode_t *node,
|
||||||
dns_dbversion_t *version,
|
dns_dbversion_t *version,
|
||||||
dns_rdataset_t *rdataset,
|
dns_rdataset_t *rdataset,
|
||||||
isc_boolean_t exact,
|
unsigned int options,
|
||||||
dns_rdataset_t *newrdataset);
|
dns_rdataset_t *newrdataset);
|
||||||
isc_result_t (*deleterdataset)(dns_db_t *db, dns_dbnode_t *node,
|
isc_result_t (*deleterdataset)(dns_db_t *db, dns_dbnode_t *node,
|
||||||
dns_dbversion_t *version,
|
dns_dbversion_t *version,
|
||||||
@@ -194,6 +194,11 @@ struct dns_db {
|
|||||||
#define DNS_DBADD_FORCE 0x02
|
#define DNS_DBADD_FORCE 0x02
|
||||||
#define DNS_DBADD_EXACT 0x04
|
#define DNS_DBADD_EXACT 0x04
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Options that can be specified for dns_db_subtractrdataset().
|
||||||
|
*/
|
||||||
|
#define DNS_DBSUB_EXACT 0x01
|
||||||
|
|
||||||
/*****
|
/*****
|
||||||
***** Methods
|
***** Methods
|
||||||
*****/
|
*****/
|
||||||
@@ -1049,6 +1054,7 @@ dns_db_addrdataset(dns_db_t *db, dns_dbnode_t *node, dns_dbversion_t *version,
|
|||||||
* ISC_R_SUCCESS
|
* ISC_R_SUCCESS
|
||||||
* DNS_R_UNCHANGED The operation did not change anything.
|
* DNS_R_UNCHANGED The operation did not change anything.
|
||||||
* ISC_R_NOMEMORY
|
* ISC_R_NOMEMORY
|
||||||
|
* DNS_R_NOTEXACT
|
||||||
*
|
*
|
||||||
* Other results are possible, depending upon the database
|
* Other results are possible, depending upon the database
|
||||||
* implementation used.
|
* implementation used.
|
||||||
@@ -1057,7 +1063,7 @@ dns_db_addrdataset(dns_db_t *db, dns_dbnode_t *node, dns_dbversion_t *version,
|
|||||||
isc_result_t
|
isc_result_t
|
||||||
dns_db_subtractrdataset(dns_db_t *db, dns_dbnode_t *node,
|
dns_db_subtractrdataset(dns_db_t *db, dns_dbnode_t *node,
|
||||||
dns_dbversion_t *version, dns_rdataset_t *rdataset,
|
dns_dbversion_t *version, dns_rdataset_t *rdataset,
|
||||||
isc_boolean_t exact, dns_rdataset_t *newrdataset);
|
unsigned int options, dns_rdataset_t *newrdataset);
|
||||||
/*
|
/*
|
||||||
* Remove any rdata in 'rdataset' from 'node' in version 'version' of
|
* Remove any rdata in 'rdataset' from 'node' in version 'version' of
|
||||||
* 'db'.
|
* 'db'.
|
||||||
@@ -1066,7 +1072,8 @@ dns_db_subtractrdataset(dns_db_t *db, dns_dbnode_t *node,
|
|||||||
*
|
*
|
||||||
* If 'newrdataset' is not NULL, then it will be attached to the
|
* If 'newrdataset' is not NULL, then it will be attached to the
|
||||||
* resulting new rdataset in the database, unless the rdataset has
|
* resulting new rdataset in the database, unless the rdataset has
|
||||||
* become nonexistent.
|
* become nonexistent. If DNS_DBSUB_EXACT is set then all elements
|
||||||
|
* of 'rdataset' must exist at 'node'.
|
||||||
*
|
*
|
||||||
* Requires:
|
* Requires:
|
||||||
*
|
*
|
||||||
@@ -1077,9 +1084,6 @@ dns_db_subtractrdataset(dns_db_t *db, dns_dbnode_t *node,
|
|||||||
* 'rdataset' is a valid, associated rdataset with the same class
|
* 'rdataset' is a valid, associated rdataset with the same class
|
||||||
* as 'db'.
|
* as 'db'.
|
||||||
*
|
*
|
||||||
* 'exact' if ISC_TRUE then all rdata in 'rdataset' must exist
|
|
||||||
* at 'node'.
|
|
||||||
*
|
|
||||||
* 'newrdataset' is NULL, or a valid, unassociated rdataset.
|
* 'newrdataset' is NULL, or a valid, unassociated rdataset.
|
||||||
*
|
*
|
||||||
* The database has zone semantics and 'version' is a valid
|
* The database has zone semantics and 'version' is a valid
|
||||||
@@ -1092,7 +1096,7 @@ dns_db_subtractrdataset(dns_db_t *db, dns_dbnode_t *node,
|
|||||||
* DNS_R_NXRRSET All rdata of the same type as those
|
* DNS_R_NXRRSET All rdata of the same type as those
|
||||||
* in 'rdataset' have been deleted.
|
* in 'rdataset' have been deleted.
|
||||||
* DNS_R_NOTEXACT Some part of 'rdataset' did not
|
* DNS_R_NOTEXACT Some part of 'rdataset' did not
|
||||||
* exist and 'exact' was ISC_TRUE.
|
* exist and DNS_DBSUB_EXACT was set.
|
||||||
*
|
*
|
||||||
* Other results are possible, depending upon the database
|
* Other results are possible, depending upon the database
|
||||||
* implementation used.
|
* implementation used.
|
||||||
|
@@ -15,7 +15,7 @@
|
|||||||
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/* $Id: rdataslab.h,v 1.17 2000/11/30 13:19:09 marka Exp $ */
|
/* $Id: rdataslab.h,v 1.18 2000/12/01 01:22:45 marka Exp $ */
|
||||||
|
|
||||||
#ifndef DNS_RDATASLAB_H
|
#ifndef DNS_RDATASLAB_H
|
||||||
#define DNS_RDATASLAB_H 1
|
#define DNS_RDATASLAB_H 1
|
||||||
@@ -103,7 +103,6 @@ dns_rdataslab_merge(unsigned char *oslab, unsigned char *nslab,
|
|||||||
/*
|
/*
|
||||||
* Merge 'oslab' and 'nslab'.
|
* Merge 'oslab' and 'nslab'.
|
||||||
*
|
*
|
||||||
* XXX
|
|
||||||
* DNS_RDATASLAB_FORCE and DNS_RDATASLAB_EXACT are mutually exclusive.
|
* DNS_RDATASLAB_FORCE and DNS_RDATASLAB_EXACT are mutually exclusive.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@@ -111,12 +110,13 @@ isc_result_t
|
|||||||
dns_rdataslab_subtract(unsigned char *mslab, unsigned char *sslab,
|
dns_rdataslab_subtract(unsigned char *mslab, unsigned char *sslab,
|
||||||
unsigned int reservelen, isc_mem_t *mctx,
|
unsigned int reservelen, isc_mem_t *mctx,
|
||||||
dns_rdataclass_t rdclass, dns_rdatatype_t type,
|
dns_rdataclass_t rdclass, dns_rdatatype_t type,
|
||||||
isc_boolean_t exact, unsigned char **tslabp);
|
unsigned int flags, unsigned char **tslabp);
|
||||||
/*
|
/*
|
||||||
* Subtract 'sslab' from 'mslab'. If 'exact' is true then all elements
|
* Subtract 'sslab' from 'mslab'. If 'exact' is true then all elements
|
||||||
* of 'sslab' must exist in 'mslab'.
|
* of 'sslab' must exist in 'mslab'.
|
||||||
*
|
*
|
||||||
* XXX
|
* XXX
|
||||||
|
* valid flags are DNS_RDATASLAB_EXACT
|
||||||
*/
|
*/
|
||||||
|
|
||||||
isc_boolean_t
|
isc_boolean_t
|
||||||
|
@@ -15,7 +15,7 @@
|
|||||||
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/* $Id: journal.c,v 1.64 2000/11/30 13:19:05 marka Exp $ */
|
/* $Id: journal.c,v 1.65 2000/12/01 01:22:39 marka Exp $ */
|
||||||
|
|
||||||
#include <config.h>
|
#include <config.h>
|
||||||
|
|
||||||
@@ -403,7 +403,7 @@ dns_diff_apply(dns_diff_t *diff, dns_db_t *db, dns_dbversion_t *ver)
|
|||||||
} else if (op == DNS_DIFFOP_DEL) {
|
} else if (op == DNS_DIFFOP_DEL) {
|
||||||
result = dns_db_subtractrdataset(db, node, ver,
|
result = dns_db_subtractrdataset(db, node, ver,
|
||||||
&rds,
|
&rds,
|
||||||
ISC_TRUE,
|
DNS_DBSUB_EXACT,
|
||||||
NULL);
|
NULL);
|
||||||
} else {
|
} else {
|
||||||
INSIST(0);
|
INSIST(0);
|
||||||
|
@@ -15,7 +15,7 @@
|
|||||||
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/* $Id: rbtdb.c,v 1.135 2000/11/30 13:19:06 marka Exp $ */
|
/* $Id: rbtdb.c,v 1.136 2000/12/01 01:22:41 marka Exp $ */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Principal Author: Bob Halley
|
* Principal Author: Bob Halley
|
||||||
@@ -3472,7 +3472,7 @@ addrdataset(dns_db_t *db, dns_dbnode_t *node, dns_dbversion_t *version,
|
|||||||
|
|
||||||
static isc_result_t
|
static isc_result_t
|
||||||
subtractrdataset(dns_db_t *db, dns_dbnode_t *node, dns_dbversion_t *version,
|
subtractrdataset(dns_db_t *db, dns_dbnode_t *node, dns_dbversion_t *version,
|
||||||
dns_rdataset_t *rdataset, isc_boolean_t exact,
|
dns_rdataset_t *rdataset, unsigned int options,
|
||||||
dns_rdataset_t *newrdataset)
|
dns_rdataset_t *newrdataset)
|
||||||
{
|
{
|
||||||
dns_rbtdb_t *rbtdb = (dns_rbtdb_t *)db;
|
dns_rbtdb_t *rbtdb = (dns_rbtdb_t *)db;
|
||||||
@@ -3524,7 +3524,10 @@ subtractrdataset(dns_db_t *db, dns_dbnode_t *node, dns_dbversion_t *version,
|
|||||||
while (header != NULL && IGNORE(header))
|
while (header != NULL && IGNORE(header))
|
||||||
header = header->down;
|
header = header->down;
|
||||||
if (header != NULL && EXISTS(header)) {
|
if (header != NULL && EXISTS(header)) {
|
||||||
|
unsigned int flags = 0;
|
||||||
subresult = NULL;
|
subresult = NULL;
|
||||||
|
if ((options & DNS_DBSUB_EXACT) != 0)
|
||||||
|
flags |= DNS_RDATASLAB_EXACT;
|
||||||
result = dns_rdataslab_subtract(
|
result = dns_rdataslab_subtract(
|
||||||
(unsigned char *)header,
|
(unsigned char *)header,
|
||||||
(unsigned char *)newheader,
|
(unsigned char *)newheader,
|
||||||
@@ -3532,7 +3535,7 @@ subtractrdataset(dns_db_t *db, dns_dbnode_t *node, dns_dbversion_t *version,
|
|||||||
rbtdb->common.mctx,
|
rbtdb->common.mctx,
|
||||||
rbtdb->common.rdclass,
|
rbtdb->common.rdclass,
|
||||||
(dns_rdatatype_t)header->type,
|
(dns_rdatatype_t)header->type,
|
||||||
exact, &subresult);
|
flags, &subresult);
|
||||||
if (result == ISC_R_SUCCESS) {
|
if (result == ISC_R_SUCCESS) {
|
||||||
free_rdataset(rbtdb->common.mctx, newheader);
|
free_rdataset(rbtdb->common.mctx, newheader);
|
||||||
newheader = (rdatasetheader_t *)subresult;
|
newheader = (rdatasetheader_t *)subresult;
|
||||||
|
@@ -15,7 +15,7 @@
|
|||||||
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/* $Id: rdataslab.c,v 1.26 2000/11/30 23:59:08 marka Exp $ */
|
/* $Id: rdataslab.c,v 1.27 2000/12/01 01:22:42 marka Exp $ */
|
||||||
|
|
||||||
#include <config.h>
|
#include <config.h>
|
||||||
|
|
||||||
@@ -302,8 +302,8 @@ dns_rdataslab_merge(unsigned char *oslab, unsigned char *nslab,
|
|||||||
} while (ncount > 0);
|
} while (ncount > 0);
|
||||||
ncount = nncount;
|
ncount = nncount;
|
||||||
|
|
||||||
if ((flags & DNS_RDATASLAB_EXACT) != 0 &&
|
if (((flags & DNS_RDATASLAB_EXACT) != 0) &&
|
||||||
tcount != ncount + ocount)
|
(tcount != ncount + ocount))
|
||||||
return (DNS_R_NOTEXACT);
|
return (DNS_R_NOTEXACT);
|
||||||
|
|
||||||
if (!added_something && (flags & DNS_RDATASLAB_FORCE) == 0)
|
if (!added_something && (flags & DNS_RDATASLAB_FORCE) == 0)
|
||||||
@@ -401,7 +401,7 @@ isc_result_t
|
|||||||
dns_rdataslab_subtract(unsigned char *mslab, unsigned char *sslab,
|
dns_rdataslab_subtract(unsigned char *mslab, unsigned char *sslab,
|
||||||
unsigned int reservelen, isc_mem_t *mctx,
|
unsigned int reservelen, isc_mem_t *mctx,
|
||||||
dns_rdataclass_t rdclass, dns_rdatatype_t type,
|
dns_rdataclass_t rdclass, dns_rdatatype_t type,
|
||||||
isc_boolean_t exact, unsigned char **tslabp)
|
unsigned int flags, unsigned char **tslabp)
|
||||||
{
|
{
|
||||||
unsigned char *mcurrent, *sstart, *scurrent, *tstart, *tcurrent;
|
unsigned char *mcurrent, *sstart, *scurrent, *tstart, *tcurrent;
|
||||||
unsigned int mcount, scount, rcount ,count, tlength, tcount;
|
unsigned int mcount, scount, rcount ,count, tlength, tcount;
|
||||||
@@ -462,7 +462,7 @@ dns_rdataslab_subtract(unsigned char *mslab, unsigned char *sslab,
|
|||||||
* Check that all the records originally existed. The numeric
|
* Check that all the records originally existed. The numeric
|
||||||
* check only works as rdataslabs do not contain duplicates.
|
* check only works as rdataslabs do not contain duplicates.
|
||||||
*/
|
*/
|
||||||
if (exact && (rcount != scount))
|
if (((flags & DNS_RDATASLAB_EXACT) != 0) && (rcount != scount))
|
||||||
return (DNS_R_NOTEXACT);
|
return (DNS_R_NOTEXACT);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@@ -15,7 +15,7 @@
|
|||||||
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/* $Id: sdb.c,v 1.19 2000/12/01 01:00:47 gson Exp $ */
|
/* $Id: sdb.c,v 1.20 2000/12/01 01:22:43 marka Exp $ */
|
||||||
|
|
||||||
#include <config.h>
|
#include <config.h>
|
||||||
|
|
||||||
@@ -1033,14 +1033,14 @@ addrdataset(dns_db_t *db, dns_dbnode_t *node, dns_dbversion_t *version,
|
|||||||
|
|
||||||
static isc_result_t
|
static isc_result_t
|
||||||
subtractrdataset(dns_db_t *db, dns_dbnode_t *node, dns_dbversion_t *version,
|
subtractrdataset(dns_db_t *db, dns_dbnode_t *node, dns_dbversion_t *version,
|
||||||
dns_rdataset_t *rdataset, isc_boolean_t exact,
|
dns_rdataset_t *rdataset, unsigned int options,
|
||||||
dns_rdataset_t *newrdataset)
|
dns_rdataset_t *newrdataset)
|
||||||
{
|
{
|
||||||
UNUSED(db);
|
UNUSED(db);
|
||||||
UNUSED(node);
|
UNUSED(node);
|
||||||
UNUSED(version);
|
UNUSED(version);
|
||||||
UNUSED(rdataset);
|
UNUSED(rdataset);
|
||||||
UNUSED(exact);
|
UNUSED(options);
|
||||||
UNUSED(newrdataset);
|
UNUSED(newrdataset);
|
||||||
|
|
||||||
return (ISC_R_NOTIMPLEMENTED);
|
return (ISC_R_NOTIMPLEMENTED);
|
||||||
|
Reference in New Issue
Block a user