/*@{*/
/*!
* The following bitfields add up to a total bitwidth of 32.
- * The range of values necessary for each item is indicated,
- * but in the case of "attributes" the field is wider to accommodate
- * possible future expansion.
+ * The range of values necessary for each item is indicated.
*
* In each case below the "range" indicated is what's _necessary_ for
* the bitfield to hold, not what it actually _can_ hold.
unsigned int is_root : 1; /*%< range is 0..1 */
unsigned int color : 1; /*%< range is 0..1 */
unsigned int find_callback : 1; /*%< range is 0..1 */
- unsigned int attributes : 3; /*%< range is 0..2 */
+ bool absolute : 1; /*%< node with absolute DNS name */
unsigned int nsec : 2; /*%< range is 0..3 */
unsigned int namelen : 8; /*%< range is 1..255 */
unsigned int offsetlen : 8; /*%< range is 1..128 */
name->labels = node->offsetlen;
name->ndata = NAME(node);
name->offsets = OFFSETS(node);
- name->attributes = node->attributes;
+ name->attributes = node->absolute ? DNS_NAMEATTR_ABSOLUTE : 0;
name->attributes |= DNS_NAMEATTR_READONLY;
}
current->right = NULL;
current->color = BLACK;
- current->attributes &= ~DNS_NAMEATTR_ABSOLUTE;
+ current->absolute = false;
rbt->nodecount++;
dns_name_getlabelsequence(name,
*/
node->oldnamelen = node->namelen = region.length;
OLDOFFSETLEN(node) = node->offsetlen = labels;
- node->attributes = name->attributes;
+ node->absolute = (name->attributes & DNS_NAMEATTR_ABSOLUTE) != 0;
memmove(NAME(node), region.base, region.length);
memmove(OFFSETS(node), name->offsets, labels);