Commit d698ca09 authored by Michael Tremer's avatar Michael Tremer

address: Rename in6_addr_get_bit/in6_addr_set_bit to loc_address_*

Signed-off-by: default avatarMichael Tremer <michael.tremer@ipfire.org>
parent 9c1e2943
......@@ -809,8 +809,8 @@ static int __loc_database_lookup(struct loc_database* db, const struct in6_addr*
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);
......@@ -1243,7 +1243,7 @@ static int __loc_database_enumerator_next_network(
}
// 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);
......
......@@ -45,11 +45,11 @@ static inline int loc_address_cmp(const struct in6_addr* a1, const struct in6_ad
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)));
}
......
......@@ -782,7 +782,7 @@ static struct loc_network_tree_node* loc_network_tree_get_path(struct loc_networ
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;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment