off_t node_index;
// Follow the path
- int bit = in6_addr_get_bit(address, level);
- in6_addr_set_bit(network_address, level, bit);
+ int bit = loc_address_get_bit(address, level);
+ loc_address_set_bit(network_address, level, bit);
if (bit == 0)
node_index = be32toh(node->zero);
}
// Mark the bits on the path correctly
- in6_addr_set_bit(&enumerator->network_address,
+ loc_address_set_bit(&enumerator->network_address,
(node->depth > 0) ? node->depth - 1 : 0, node->i);
DEBUG(enumerator->ctx, "Looking at node %jd\n", (intmax_t)node->offset);
return 0;
}
-static inline int in6_addr_get_bit(const struct in6_addr* address, unsigned int i) {
+static inline int loc_address_get_bit(const struct in6_addr* address, unsigned int i) {
return ((address->s6_addr[i / 8] >> (7 - (i % 8))) & 1);
}
-static inline void in6_addr_set_bit(struct in6_addr* address, unsigned int i, unsigned int val) {
+static inline void loc_address_set_bit(struct in6_addr* address, unsigned int i, unsigned int val) {
address->s6_addr[i / 8] ^= (-val ^ address->s6_addr[i / 8]) & (1 << (7 - (i % 8)));
}
for (unsigned int i = 0; i < prefix; i++) {
// Check if the ith bit is one or zero
- node = loc_network_tree_get_node(node, in6_addr_get_bit(address, i));
+ node = loc_network_tree_get_node(node, loc_address_get_bit(address, i));
}
return node;