Commit Graph
499 Commits
Author SHA1 Message Date
Michael Graff 68221c823d add msg functions 1999-04-06 02:18:08 +00:00
Bob Halley 0990426ddf fix some locking problems 1999-04-05 23:59:26 +00:00
Bob Halley fd03e61541 In zone_find(), deal with the ickiness when the desired name is a delegation
point.  Specifically, we return a delegation in this case, except if glue is
OK, or if the caller is looking for NXT or KEY records.
SIG records are going to be a special case, so do not deal with them in the
zone find routine.
1999-04-05 20:51:50 +00:00
Bob Halley e7e2e948e3 add REQUIRE statements for dns_db_find() 1999-04-05 20:47:20 +00:00
Bob Halley b4055b9666 preliminary dns_db_find() comments 1999-04-05 20:39:50 +00:00
Bob Halley 6e077ae73c add DNS_R_ZONECUT 1999-04-05 20:11:30 +00:00
Bob Halley 10e905959e When searching a cache db, we did not look for an NS record at the node, so we
sometimes did not find the deepest zone cut.  E.g. If you look for A records at
"com." then you should get a delegation for "com." and not one for ".".
In the various rdataset find routines, we sometimes attempted to bind the
rdataset even if the rdataset pointer was NULL.
Remove inline from a few functions.  Add inline to a few others.
1999-04-02 03:37:24 +00:00
David Lawrence da1eb108c6 rbtnode's callback member renamed find_callback. 1999-04-01 15:57:48 +00:00
Bob Halley 1b90a27c4d Implement zone and cache versions of dns_db_find().
Add incomplete and not-yet-working dbiterator implementation.
Improve node reference count handling.
Opening and closing the current version more than once was breaking
due to incorrect garbage collection.
Some rbtdb values had not been getting initialized.
Improvements to add procedure.
1999-04-01 04:11:33 +00:00
Bob Halley 9e2fa382e8 remove unneeded include 1999-04-01 04:03:56 +00:00
Bob Halley ced5499494 add dns_db_find 1999-04-01 04:03:22 +00:00
Bob Halley d176cbca5b checkpoint 1999-04-01 04:02:33 +00:00
Bob Halley 0180ccf72c require non-NULL methods on accessors 1999-04-01 04:01:30 +00:00
Bob Halley 5bfea18ff8 add dns_rdataslab_merge 1999-04-01 04:00:39 +00:00
Bob Halley e7b724c23e result types for database searches 1999-04-01 03:59:49 +00:00
Bob Halley 6d356e35c6 add author info 1999-04-01 03:59:27 +00:00
David Lawrence 5f50687f61 Changes from Bob, best described in his own barely-edited words:
I added support for the full search algorithm to the RBT database
  code.  The database has some special needs in searching, in particular
  certain nodes need to be examined before the DOWN pointer is followed.

  I solved this problem by adding a 'callback' bit to the node structure.
  When findnode is called, the caller can supply a callback.  Before we go
  DOWN at a node, we call the callback if the callback bit is set at the
  node.  If the callback returns DNS_R_CONTINUE, we proceed.  Otherwise, we
  will stop right there and return what the caller said to return.  I
  added an 'empty_data_ok' flag to findnode as well, so that nodes with
  empty data can be made candidates for partial match status.

  I also wanted to make dns_rbtnodechain_t public, so that a chain could
  be allocated on the stack by the caller.  I added two routines,
  dns_rbtnodechain_init() and dns_rbtnodechain_reset() to work with them.
  The latter routine frees any dynamically allocated memory associated with
  the chain.  The chain structure now contains the memory context.  I also
  moved get_ancestor_mem() and put_ancestor_mem() up in the file, so that
  inlining could be more effective.

  In the nits department, you wrote

                  *node = result == DNS_R_SUCCESS ? current : NULL;

  In the future, please write this instead (the patch has this change in it):

                  if (result == DNS_R_SUCCESS)
                          *node = current;
                  else
                          *node = NULL;
1999-04-01 03:15:54 +00:00
Bob Halley 8bdb4ab2d1 only UNLOCK and then LOCK if actually sending an event 1999-04-01 01:09:28 +00:00
Michael Graff e0834816d7 clean up comments 1999-03-30 06:22:28 +00:00
Michael Graff d4aa1c590e more fixes. 1999-03-30 06:18:45 +00:00
Michael Graff f9df3b7b03 typo 1999-03-30 03:45:46 +00:00
Michael Graff 952c9d12d0 add DNS_R_MOREDATA for msg library 1999-03-30 03:45:11 +00:00
Michael Graff b1ddf33030 add msg.h, will change as needed, but Brian needed this now 1999-03-30 03:43:00 +00:00
David Lawrence 194dda8c56 new possible return code for dns_rbt_addnode, DNS_R_NOSPACE. It means
that adding the name would create too many logical levels in the
tree of trees.
1999-03-30 01:57:12 +00:00
David Lawrence 84f8cc7e22 Initialize the node's attributes with the name's attributes. This
is currently fine, because there are only two attribute flags a name
can have, one of which the node definitely needs to have set, and the
other of which is functionally irrelevant (because it happens to be set
by the NODENAME macro, namely the read-only flag).  This might not
be the right thing to do in the future when more name attributes get
added, but we'll cross that bridge if we get to it.  (_Some_ change was
necessary because the node's attributes was not properly initialized when
created, and under certain circumstances this ended up triggering an
exception in the dns_name_* functions.

Watch for level overflow during dns_rbt_addnode().  Returns DNS_R_NOSPACE,
which is probably not the right thing.

Comment cleanups.
1999-03-30 01:56:01 +00:00
Michael Graff cc60c973f4 comment for bob :) 1999-03-29 23:56:48 +00:00
Michael Graff b73eb944cd Changes talked about at IETF -- code cleanup, result code cleanup, etc 1999-03-29 23:56:06 +00:00
Michael Graff 1b1bc2a9d5 mention that UDPs are always "partial read" 1999-03-29 20:02:41 +00:00
Bob Halley f4f2ef7d80 fix minor textual nits 1999-03-24 00:29:54 +00:00
Mark Andrews 0d46301a6e NBUF was one to small.
GETTOKEN is now a simple macro that calls gettoken (static inline).
1999-03-23 00:04:01 +00:00
Mark Andrews dd082cc554 Added BIND 8.x ttl processing.
Allow ttl / class to be specified in any order.
	Suppress duplicate rdata.
	Additional commentry.
1999-03-22 06:21:29 +00:00
Mark Andrews 5f78628b28 Add DNS_R_BADTTL. 1999-03-22 06:18:34 +00:00
David Lawrence d737609b91 Allow space for 255 levels in rbtnodechain because of bitlabels. 1999-03-18 21:32:51 +00:00
David Lawrence d09197467b Principle Authors: DCL 1999-03-18 21:21:31 +00:00
David Lawrence 7ab725ec13 Converted @@@ to XXX per ISC convention for unresolved issues. 1999-03-18 20:32:32 +00:00
David Lawrence 9f1a1007e0 Converted @@@ to XXX in comments about unresolved issues. 1999-03-18 20:30:28 +00:00
David Lawrence c77dc869b3 Added comments about locking in dns_dbtable struct. 1999-03-18 20:06:26 +00:00
David Lawrence a685d9c3b6 Preliminary implementation of db mounting. 1999-03-18 19:37:30 +00:00
David Lawrence f39a760ab0 formatting fixups (a few lines were over 79 char). 1999-03-16 22:57:32 +00:00
David Lawrence eca5913a47 Made calls to dns_rbt_find{name,node} compatible with the just-committed
changes to rbt.c by passing a NULL pointer for the dns_name_t that
receives the full name of the node that is found.  There is probably something
better to do, but this just keeps things compiling.
1999-03-16 16:15:44 +00:00
David Lawrence 194f54f4da New parameter to dns_rbt_find{name,node} will return the full dns_name_t
of the node that is found.

Avoids doing any memory allocation when building ancestor chain in 99%
of the cases.
1999-03-16 16:10:36 +00:00
David Lawrence cdd824cc88 documentation updates.
removed some print support function declarations; made static to rbt.c.
1999-03-12 05:01:42 +00:00
David Lawrence bd1190c84b no more need for mem_failure in rbt_nodechain_t, since findnode now
returns a dns_result_t.

dns_rbt_created requires deleter_arg NULL if deleter is NULL.

dns_rbt_addnode always returns DNS_R_EXISTS if the node is found, regardless
of if it has data.

dns_rbt_addname will add the data and return SUCCESS if addnode says
EXISTS but there is no data at the node.

make sure memory is freed even when get_ancestor_mem to reallocate fails.

partialmatch returned by findnode must have data associated with it.

fixed up deletename; prematurely exited without freeing chain memory if
the node was not found.  made deletename responsible for identifying whether
a node could be removed rather than zapnode.

turned a few of the print support functions static.
1999-03-12 05:00:32 +00:00
David Lawrence 62f178f499 Preserve the storage location of the down node of a pair of joined nodes
when deleting, where possible.
1999-03-11 22:04:24 +00:00
David Lawrence 7f9a18ab45 Move the data pointer further down in the struct, near the second set of
bitfields that are used by RBT DB.
1999-03-11 21:15:12 +00:00
David Lawrence 6a0cb547d4 When splitting a node, increment PADBYTES by the amount that is truncated,
instead of just setting PADBYTES to that amount (this affects when a node
is split twice.)
1999-03-11 20:07:49 +00:00
Bob Halley 0cc67b5a2a add DNS_R_UNCHANGED 1999-03-11 20:06:56 +00:00
David Lawrence f036af2c71 rbtnode struct adapted with more bitfields to represent color,
name attributes, name length, offset length, and number of bytes
of "padding" that are left over when a node is split.

adjusted node splitting algorithm to preserve the original location
of the lower portion of the split node (eg, when a node has "a.b" as
its name and is split into "a" and "b", "a" retains the same address
space as "a.b".)
1999-03-11 18:54:31 +00:00
Bob Halley b7ff8128f0 implement rdataset iteration 1999-03-11 06:02:28 +00:00
Bob Halley bc5c129744 fix typo 1999-03-11 06:02:00 +00:00