2
0
mirror of https://gitlab.isc.org/isc-projects/bind9 synced 2025-08-29 13:38:26 +00:00

126 Commits

Author SHA1 Message Date
Mark Andrews
7554feaef6 1571. [bug] rbt:hash_node() could fail leaving the hash table
in an inconsistant state.  [RT #10208]
2004-03-03 22:40:56 +00:00
Tatuya JINMEI 神明達哉
e407562a75 1528. [cleanup] Simplify some dns_name_ functions based on the
deprecation of bitstring labels.
2003-10-25 00:31:12 +00:00
Mark Andrews
fc87397df6 1470. [bug] incorrect length passed to snprintf. [RT #5966] 2003-05-08 04:03:25 +00:00
Mark Andrews
b6309ed962 developer: jinmei
reviewer: marka
1368.   [func]          remove support for bitstring labels.
2002-08-27 04:53:43 +00:00
Brian Wellington
41e50ece38 add dns_name_hashbylabel() and make the rbt use it. 2001-12-04 01:32:44 +00:00
Andreas Gustafsson
5d727330e4 brace style 2001-12-03 19:44:08 +00:00
Andreas Gustafsson
1f1d36a87b Check return values or cast them to (void), as required by the coding
standards; add exceptions to the coding standards for cases where this is
not desirable
2001-11-30 01:59:49 +00:00
Andreas Gustafsson
f1b6872550 Do not put a space before ';' when terminating a statement or in a 'for' statement. 2001-11-27 00:56:32 +00:00
Mark Andrews
0316cd0c04 NODE_VALID -> DNS_RBTNODE_VALID 2001-11-13 06:19:55 +00:00
Andreas Gustafsson
c0bf2b179a When DNS_RBT_USEMAGIC is defined as true, do magic number
checking of RBT nodes
2001-11-10 01:37:44 +00:00
Andreas Gustafsson
a571ebca8b style 2001-11-09 01:53:20 +00:00
David Lawrence
92ef1a9b9d use ISC_MAGIC for all magic numbers, for our friends in EBCDIC land 2001-06-04 19:33:39 +00:00
David Lawrence
7fe56f41ec slight optimization for dns_rbt_findnode() when bitstrings are involved:
skip the hashing attempts entirely when not at the root of a level
2001-05-31 22:32:46 +00:00
David Lawrence
68f4a1696f In dns_rbt_findnode() when using hashing, check for a bitstring after
each failure to find the hash_name, not just when the name has multiple labels.
2001-05-31 21:52:22 +00:00
David Lawrence
b79e66b06d While searching in dns_rbt_findnode(), cope with the possibility that
a bitstring label might be founding things from any label of a
multilabel search_name.
2001-05-31 11:03:33 +00:00
David Lawrence
ceda09e07a removed stale #define DEBUG that my own comment said I was supposed to remove. 2001-04-12 21:18:14 +00:00
David Lawrence
cace8ff3bd use ISC_MAGIC to define the magic number 2001-04-12 00:37:55 +00:00
Andreas Gustafsson
dd57718608 #include <isc/print.h> 2001-03-09 23:38:00 +00:00
David Lawrence
a09c545af1 join_nodes is removed; node joining is no longer done at any time, because
it corrupts active chains and can change the data at a node which
someone might be using.  (In the latter case, though the full name from
the root was still intact, and the ->data member was not altered, other
values like the partial name ndata and offsets could change.)

New functions dns_rbt_fullnamefromnode() and dns_rbt_formatnodename(),
for getting a dns_name_t and filling a char buffer, respectively, with
the complete name of a node from the root.

rbtnode.is_root was being treated as isc_boolean_t even though it was bitfield
of width 1.  This worked fine, but wasn't consistent with ISC style, and
would have puked if someone decided to change isc_true from 1 (unlikely
as that is).  Yeah, anal, I know.
2001-03-08 01:08:39 +00:00
Brian Wellington
d752e5c19e removed pointless code (an if statement checking something that had been
INSISTed on the previous line).
2001-02-28 20:20:18 +00:00
Brian Wellington
9a41936e3d current_root was uninitialized at the start of dns_rbt_findnode(). This
has no real effect, but it's still good to fix it.
2001-02-21 23:21:28 +00:00
Brian Wellington
c5945fe694 Fix a potential bitstring bug. 2001-02-21 02:27:56 +00:00
Brian Wellington
4e8eba14a0 reinstate an INSIST() referenced in [RT #421] 2001-02-21 02:01:15 +00:00
Brian Wellington
7222f9f321 The optimization to avoid compares after hashtable matches didn't work when
the matched node contained multiple labels.
2001-02-10 22:46:24 +00:00
Brian Wellington
1c1f5e1911 The root node was added to the hashtable twice, which could lead to an
infinite loop. [RT #840]
2001-02-09 18:48:57 +00:00
Brian Wellington
65bc8f2af8 When assigning a bucket lock to an rbt node, use the hash of the full name,
rather than the hash of the partial name stored in the node.  This more
evenly distributes nodes across locks.

This change only takes effect when DNS_RBT_USEHASH is defined, and also changes
the rbt so that the hashtable is created when the first node is created in the
tree, not after 64 nodes are added.
2001-02-09 01:26:51 +00:00
Brian Wellington
15bc0af6a1 chain_name() built the fully qualified name in a very inefficient way.
Reversing the order of the concatenations makes it significantly faster.
2001-02-05 20:07:20 +00:00
Brian Wellington
70b4889c85 A minor optimation to the rbt hash code that should reduce the number
of calls to dns_name_fullcompare().
2001-01-22 20:41:43 +00:00
Brian Wellington
499b34cea0 copyright update 2001-01-09 22:01:04 +00:00
Brian Wellington
6d5032f9a2 Micro-optimizations:
- use the DNS_NAME_INIT macro in name.c
	- create dns_name_copy() and use it instead of dns_name_concatenate()
	  when doing a copy.
2001-01-03 00:05:15 +00:00
Brian Wellington
78838d3e0c 8 space -> tab conversion 2000-12-11 19:24:30 +00:00
Brian Wellington
08e57545c2 Allow the hashing code in the rbt to be disabled (to save memory). This
should eventually be configurable at runtime, or at least with a
configure option, but now it's just a #define in rbt.h.
2000-11-18 00:55:25 +00:00
David Lawrence
e94e2fe29d cope with the possibility that the prefix of a name
split within a bitstring label might have been compacted to have fewer
labels than what was expected
2000-11-14 23:51:24 +00:00
David Lawrence
b65f2ab14a 534. [func] Ancestors have been removed from RBT chains. Ancestor
information can be discerned via node parent pointers.

 533.	[func]		Incorporated name hashing into the RBT database to
			improve search speed.

There is still evidence of a bug with regard to bitstring labels.  It shows
up in bin/test/rbt/t_rbt -x -t 4 when the assertion at lib/dns/rbt.c:1631
is uncommented -- essentially a bitstring node's location in the hashtable
is not getting properly updated at some point.  This shouldn't affect
searching, because a bitstring label as the parent of a new level will
generally cause the standard old binary search to be done.  I will be looking
at this more closely in the very near future.
2000-10-25 07:21:31 +00:00
Brian Wellington
48d861c067 The node counting stuff didn't work. 2000-08-03 21:34:27 +00:00
Brian Wellington
83e6eb0dfe Add routines to count the number of nodes in a database and an rbt. 2000-08-03 19:46:37 +00:00
David Lawrence
40f53fa8d9 Trailing whitespace trimmed. Perhaps running "perl util/spacewhack.pl in your
own CVS tree will help minimize CVS conflicts.  Maybe not.
Blame Graff for getting me to trim all trailing whitespace.
2000-08-01 01:33:37 +00:00
David Lawrence
c5944292e9 361. [func] When the RBT find or chain functions set the name and
origin for a node that stores the root label
			the name is now set to an empty name, instead of ".",
			to simplify later use of the name and origin by
			dns_name_concatenate(), dns_name_totext() or
			dns_name_format().

 360.	[func]		dns_name_totext() and dns_name_format() now allow
			an empty name to be passed, which is formatted as "@".
2000-07-31 23:27:25 +00:00
David Lawrence
9658892dbc revert the changes to dns_name_format() back to dns_name_totext() because
dns_name_format() does not print absolute names
2000-07-31 22:34:01 +00:00
David Lawrence
15a4474541 word wrap copyright notice at column 70 2000-07-27 09:55:03 +00:00
Andreas Gustafsson
5aa7bca733 dns_rbt_printnode() formatted the node name
into a buffer of 255 char pointers, not 255 chars; changed it
to use dns_name_format()
2000-07-21 22:08:42 +00:00
David Lawrence
891a1bead8 Use new function dns_name_reset() to make a name have no data, instead
of dns_name_concatenate(NULL, NULL, name, NULL).

Define DNS_NAME_USELINE to get macroized name functions.  Removed
older FAST_COUNTLABELS and FAST_ISABSOLUTE to use standard name
interface, which are covered by DNS_NAME_USEINLINE.
2000-07-14 19:17:39 +00:00
David Lawrence
9fb4b3f08a Do not return an exact match from dns_rbt_findnode() when the exact
match does not have associated data and DNS_RBTFIND_EMPTYDATA is not set.
Return DNS_R_PARTIALMATCH instead if there is a superdomain with
data, or ISC_R_NOTFOUND if no superdomain has data.

Make dns_rbt_findname() honor DNS_RBTFIND_EMPTYDATA, per the rbt.h
documentation that has been saying it will.  It didn't.
2000-07-06 23:54:45 +00:00
David Lawrence
03052a178c dns_rbt_deletefromlevel() did not need its dns_rbt_t argument 2000-06-19 22:55:42 +00:00
David Lawrence
92ab6defb6 don't redefine DNS_RBT_ANCESTORBLOCK to a tiny size when ISC_MEM_DEBUG is
defined, as it is by default now.  huge performance hit that we would
likely have been slow to notice if not for the t_rbt chain tests
having a bug. :-)
2000-06-06 23:25:29 +00:00
David Lawrence
fccb3e6c67 When joining nodes, set parent pointers of the left and right children of
the upper node (if they exist) to point to the new node.
2000-05-19 05:58:48 +00:00
David Lawrence
092b4e5359 The deletion assertion failure reported in RT #112 has been fixed; a pointer
should have been set to NULL when the top of a level was being rotated but
instead it was set to the node which pointed down to the level of the deleted
node.

rotate_left and rotate_right no longer take a parent parameter, since they
don't need it with the existence of parent pointers.

dns_rbt_deletefromlevel now takes a pointer to the pointer of the root of
the level as a parameter so that it doesn't have to rediscover the root that
its caller (dns_rbt_deletenode) already discovered.

dns_rbt_deletefromlevel did some (minor) pointless work with the sibling of the
deleted node before the color fixup loop was entered; it does so no more.

forward function declarations changed to ISC style.
2000-05-19 04:42:08 +00:00
David Lawrence
6028d1ce03 Needs string.h for function prototypes. For some reason gcc and other
compilers do not warn about the missing str*/mem* prototypes.
2000-05-08 19:23:32 +00:00
David Lawrence
1a69a1a78c Megacommit of dozens of files.
Cleanup of redundant/useless header file inclusion.

ISC style lint, primarily for function declarations and standalone
comments -- ie, those that appear on a line without any code, which
should be written as follows:
   /*
    * This is a comment.
    */
2000-05-08 14:38:29 +00:00
Bob Halley
82a1986c04 include isc/util.h; LOCK to LOCKNUM 2000-04-28 01:08:52 +00:00