• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /macosx-10.10.1/bind9-45.101/bind9/lib/dns/

Lines Matching +defs:child +defs:name

34  * This define is so dns/name.h (included by dns/fixedname.h) uses more
108 * <name_data> contains the name of the node when it was created.
110 * <offsets> contains the offets into name for each label when the node was
140 * The following macros directly access normally private name variables.
145 #define NODENAME(node, name) \
147 (name)->length = NAMELEN(node); \
148 (name)->labels = OFFSETLEN(node); \
149 (name)->ndata = NAME(node); \
150 (name)->offsets = OFFSETS(node); \
151 (name)->attributes = ATTRS(node); \
152 (name)->attributes |= DNS_NAMEATTR_READONLY; \
168 dns_name_t name;
170 dns_name_init(&name, NULL);
172 NODENAME(node, &name);
174 return (name);
199 create_node(isc_mem_t *mctx, dns_name_t *name, dns_rbtnode_t **nodep);
203 hash_node(dns_rbt_t *rbt, dns_rbtnode_t *node, dns_name_t *name);
207 #define hash_node(rbt, node, name) (ISC_R_SUCCESS)
314 chain_name(dns_rbtnodechain_t *chain, dns_name_t *name,
325 result = dns_name_copy(&nodename, name, NULL);
329 dns_name_reset(name);
333 result = dns_name_concatenate(name, &nodename, name, NULL);
364 * Add 'name' to tree, initializing its data pointer with 'data'.
368 dns_rbt_addnode(dns_rbt_t *rbt, dns_name_t *name, dns_rbtnode_t **nodep) {
372 dns_rbtnode_t **root, *parent, *child, *current, *new_current;
384 REQUIRE(dns_name_isabsolute(name));
388 * Create a copy of the name so the original name structure is
393 dns_name_clone(name, add_name);
402 hash_node(rbt, new_current, name);
418 child = *root;
422 nlabels = dns_name_countlabels(name);
426 current = child;
443 child = LEFT(current);
447 child = RIGHT(current);
453 * This name has some suffix in common with the
454 * name at the current node. If the name at
456 * new name should be in a subtree. If the
457 * name at the current node is longer, that means
467 * so the new name is in a subtree.
485 child = DOWN(current);
522 * Split the name into two parts, a prefix
589 dns_name_getlabelsequence(name,
597 * The name has been added by pushing
615 * name will be inserted into the new
630 } while (child != NULL);
639 hash_node(rbt, new_current, name);
646 * Add a name to the tree of trees, associating it with some data.
649 dns_rbt_addname(dns_rbt_t *rbt, dns_name_t *name, void *data) {
654 REQUIRE(dns_name_isabsolute(name));
658 result = dns_rbt_addnode(rbt, name, &node);
663 * dns_rbt_*name functions all behave depending on whether
676 * Find the node for "name" in the tree of trees.
679 dns_rbt_findnode(dns_rbt_t *rbt, dns_name_t *name, dns_name_t *foundname,
695 REQUIRE(dns_name_isabsolute(name));
728 * search_name is the name segment being sought in each tree level.
731 * By using dns_name_clone, no name data should be copied thanks to
736 dns_name_clone(name, search_name);
791 dns_name_getlabelsequence(name,
824 * checking if the full name was hashed. Then
844 * labels, the name isn't in the table.
864 * the current node's name length, then follow the
871 * for the name to search in the next level.
877 * This might be the closest enclosing name.
936 * entire name at this node is not common
937 * with the search name so the search
938 * name does not exist in the tree.
981 * and then to derive the name.
1039 * the search name.
1044 * NULL, which means the searched for name was
1045 * a subdomain of a terminal name in the tree.
1047 * order against, the terminal name is the
1106 * positively indicates the name is not
1108 * less than the desired name (order > 0) or
1109 * greater than the desired name (order < 0).
1123 * that the search name is less than anything
1126 * to know that the search name has
1179 * Get the data pointer associated with 'name'.
1182 dns_rbt_findname(dns_rbt_t *rbt, dns_name_t *name, unsigned int options,
1189 result = dns_rbt_findnode(rbt, name, foundname, &node, NULL,
1202 * Delete a name from the tree of trees.
1205 dns_rbt_deletename(dns_rbt_t *rbt, dns_name_t *name, isc_boolean_t recurse) {
1210 REQUIRE(dns_name_isabsolute(name));
1215 * When searching, the name might not have an exact match:
1221 * that the name to be deleted have data? For now, it is.
1226 result = dns_rbt_findnode(rbt, name, NULL, &node, NULL,
1362 dns_rbt_namefromnode(dns_rbtnode_t *node, dns_name_t *name) {
1365 REQUIRE(name != NULL);
1366 REQUIRE(name->offsets == NULL);
1368 NODENAME(node, name);
1372 dns_rbt_fullnamefromnode(dns_rbtnode_t *node, dns_name_t *name) {
1377 REQUIRE(name != NULL);
1378 REQUIRE(name->buffer != NULL);
1381 dns_name_reset(name);
1388 result = dns_name_concatenate(name, &current, name, NULL);
1393 } while (! dns_name_isabsolute(name));
1402 dns_name_t *name;
1409 name = dns_fixedname_name(&fixedname);
1410 result = dns_rbt_fullnamefromnode(node, name);
1412 dns_name_format(name, printname, size);
1414 snprintf(printname, size, "<error building name: %s>",
1421 create_node(isc_mem_t *mctx, dns_name_t *name, dns_rbtnode_t **nodep) {
1426 REQUIRE(name->offsets != NULL);
1428 dns_name_toregion(name, &region);
1429 labels = dns_name_countlabels(name);
1433 * Allocate space for the node structure, the name, and the offsets.
1464 * The following is stored to make reconstructing a name from the
1465 * stored value in the node easy: the length of the name, the number
1466 * of labels, whether the name is absolute or not, the name itself,
1467 * and the name's offsets table.
1472 * lib/dns/name.c.
1479 ATTRS(node) = name->attributes;
1482 memcpy(OFFSETS(node), name->offsets, labels);
1494 hash_add_node(dns_rbt_t *rbt, dns_rbtnode_t *node, dns_name_t *name) {
1497 HASHVAL(node) = dns_name_fullhash(name, ISC_FALSE);
1558 hash_node(dns_rbt_t *rbt, dns_rbtnode_t *node, dns_name_t *name) {
1565 hash_add_node(rbt, node, name);
1594 dns_rbtnode_t *child;
1599 child = RIGHT(node);
1600 INSIST(child != NULL);
1602 RIGHT(node) = LEFT(child);
1603 if (LEFT(child) != NULL)
1604 PARENT(LEFT(child)) = node;
1605 LEFT(child) = node;
1607 if (child != NULL)
1608 PARENT(child) = PARENT(node);
1611 *rootp = child;
1612 child->is_root = 1;
1617 LEFT(PARENT(node)) = child;
1619 RIGHT(PARENT(node)) = child;
1622 PARENT(node) = child;
1627 dns_rbtnode_t *child;
1632 child = LEFT(node);
1633 INSIST(child != NULL);
1635 LEFT(node) = RIGHT(child);
1636 if (RIGHT(child) != NULL)
1637 PARENT(RIGHT(child)) = node;
1638 RIGHT(child) = node;
1640 if (child != NULL)
1641 PARENT(child) = PARENT(node);
1644 *rootp = child;
1645 child->is_root = 1;
1650 LEFT(PARENT(node)) = child;
1652 RIGHT(PARENT(node)) = child;
1655 PARENT(node) = child;
1666 dns_rbtnode_t *child, *root, *parent, *grandparent;
1687 child = root;
1688 POST(child);
1720 child = RIGHT(grandparent);
1721 if (child != NULL && IS_RED(child)) {
1723 MAKE_BLACK(child);
1738 child = LEFT(grandparent);
1739 if (child != NULL && IS_RED(child)) {
1741 MAKE_BLACK(child);
1771 dns_rbtnode_t *child, *sibling, *parent;
1784 child = NULL;
1797 * This node has one child, on the right.
1799 child = RIGHT(delete);
1803 * This node has one child, on the left.
1805 child = LEFT(delete);
1820 * The successor cannot possibly have a left child;
1821 * if there is any child, it is on the right.
1824 child = RIGHT(successor);
1896 LEFT(PARENT(delete)) = child;
1898 RIGHT(PARENT(delete)) = child;
1900 if (child != NULL)
1901 PARENT(child) = PARENT(delete);
1906 * it is known to have just one child.
1908 *rootp = child;
1909 child->is_root = 1;
1910 PARENT(child) = PARENT(delete);
1919 while (child != *rootp && IS_BLACK(child)) {
1920 INSIST(child == NULL || ! IS_ROOT(child));
1922 if (LEFT(parent) == child) {
1937 child = parent;
1952 child = *rootp;
1957 * Child is parent's right child.
1975 child = parent;
1989 child = *rootp;
1993 parent = PARENT(child);
1996 if (IS_RED(child))
1997 MAKE_BLACK(child);
2125 dns_name_t name;
2132 dns_name_init(&name, offsets);
2133 dns_name_fromregion(&name, &r);
2135 dns_name_format(&name, buffer, sizeof(buffer));
2222 dns_rbtnodechain_current(dns_rbtnodechain_t *chain, dns_name_t *name,
2235 if (name != NULL) {
2236 NODENAME(chain->end, name);
2241 * Always make 'name' relative.
2243 INSIST(dns_name_isabsolute(name));
2248 name->labels--;
2249 name->length--;
2250 name->attributes &= ~DNS_NAMEATTR_ABSOLUTE;
2265 dns_rbtnodechain_prev(dns_rbtnodechain_t *chain, dns_name_t *name,
2293 * the way there the link from parent to child is a right
2366 result = dns_rbtnodechain_current(chain, name, origin,
2372 result = dns_rbtnodechain_current(chain, name, NULL,
2382 dns_rbtnodechain_down(dns_rbtnodechain_t *chain, dns_name_t *name,
2421 * root level will never be more than one name, and everything
2426 if (name != NULL)
2427 NODENAME(chain->end, name);
2446 dns_rbtnodechain_nextflat(dns_rbtnodechain_t *chain, dns_name_t *name) {
2478 if (name != NULL)
2479 NODENAME(chain->end, name);
2489 dns_rbtnodechain_next(dns_rbtnodechain_t *chain, dns_name_t *name,
2579 * root level will never be more than one name, and everything
2584 if (name != NULL)
2585 NODENAME(chain->end, name);
2605 dns_name_t *name, dns_name_t *origin)
2617 result = dns_rbtnodechain_current(chain, name, origin, NULL);
2627 dns_name_t *name, dns_name_t *origin)
2641 result = dns_rbtnodechain_current(chain, name, origin, NULL);