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 "@".
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.
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.
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. :-)
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.
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.
*/
Added:
isc_buffer_base(b) (pointer)
isc_buffer_current(b) (pointer)
isc_buffer_active(b) (pointer)
isc_buffer_used(b) (pointer)
isc_buffer_length(b) (int)
isc_buffer_usedlength(b) (int)
isc_buffer_consumedlength(b) (int)
isc_buffer_remaininglength(b) (int)
isc_buffer_activelength(b) (int)
isc_buffer_availablelength(b) (int)
Removed:
ISC_BUFFER_USEDCOUNT(b)
ISC_BUFFER_AVAILABLECOUNT(b)
isc_buffer_type(b)
Changed names:
isc_buffer_used(b, r) ->
isc_buffer_usedregion(b, r)
isc_buffer_available(b, r) ->
isc_buffer_available_region(b, r)
isc_buffer_consumed(b, r) ->
isc_buffer_consumedregion(b, r)
isc_buffer_active(b, r) ->
isc_buffer_activeregion(b, r)
isc_buffer_remaining(b, r) ->
isc_buffer_remainingregion(b, r)
Buffer types were removed, so the ISC_BUFFERTYPE_*
macros are no more, and the type argument to
isc_buffer_init and isc_buffer_allocate were removed.
isc_buffer_putstr is now void (instead of isc_result_t)
and requires that the caller ensure that there
is enough available buffer space for the string.
of dns_rbt_findnode should be skipped. Nothing external uses it yet, but
when the chain option is NULL, this option is set internally as predecessor
searching is irrelevant. (It was skipped before now, but via a different
mechanism.)
Add DNS_RBTFIND_NOOPTIONS to make it clear what the options parameter of
dns_rbt_find* is when no options are passed, and use it in dns_rbt_deletename.
REQUIRE that DNS_RBTFIND_NOEXACT and DNS_RBTFIND_NOPREDECESSOR are mutually
exclusive to dns_rbt_findnode.
deletion bug fixed that could orphan a large section of the tree. the
"parent" argument to rotate_left or rotate_right was sometimes not
really the parent of the rotation vertex, because the parent's parent
was not correctly reidentified after a rotation done on the parent.
Minor:
forward static declaration of dns_rbt_printnodename, useful in debugging.
level_matches set correctly for exact match in dns_rbt_findnode (it was
one too few, but this was minor because as yet level_matches is only
used by other code when a partial match was made.
insist 'node' is a child of 'parent' in rotate_left and rotate_right
compare a pointer explicitly to NULL that was just "if (pointer)"
"would would" in a comment changed to just one "would".
not just for partial matches, for consistency.
set level_matches even when not forming foundname, since level_matches
is an aspect of the chain, not of whether the caller wanted the
name formed by dns_rbt_findnode().
comment updates.
newlength and oldlength from signed to unsigned in join_nodes().
Use dns_name_clone for minor efficiency gain in dns_rbt_addnode.
Use fixed names in dns_rbt_findnode() for minor efficiency gain.
the attributes of the joined name to correctly identify whether it
is absolute. (IE, when the first level is joined with the top level,
the node struct being used is from the first level, which is not
absolute, but the new name is absolute so the struct needs to be updated.)
level_count was decremented below zero because the found node had not
been put in the level history before the callback broke out of the search.
Added a bunch of INSISTS()s to try to catch something like that in the future.
It wasn't that chain->end was being included (it should have been) but
that the chain had already been expanded to point down a level before
the call to chain_name that needed the state of things before the
descent.
comparison is "subdomain" but the full name at the existing node is
not in common with the input name -- when the last label is a bitstring
with some common bits.