version 1.4, 2012/03/29 01:31:34
|
version 1.5, 2012/07/03 08:51:05
|
Line 182 static prefix_t *New_Prefix2(int family, void *dest, i
|
Line 182 static prefix_t *New_Prefix2(int family, void *dest, i
|
if (family == AF_INET6) { |
if (family == AF_INET6) { |
default_bitlen = 128; |
default_bitlen = 128; |
if (!prefix) { |
if (!prefix) { |
prefix = calloc(1, sizeof(prefix6_t)); | prefix = io_calloc(1, sizeof(prefix6_t)); |
dynamic_allocated++; |
dynamic_allocated++; |
} |
} |
memcpy(&prefix->add.sin6, dest, 16); |
memcpy(&prefix->add.sin6, dest, 16); |
Line 190 static prefix_t *New_Prefix2(int family, void *dest, i
|
Line 190 static prefix_t *New_Prefix2(int family, void *dest, i
|
#endif /* HAVE_IPV6 */ |
#endif /* HAVE_IPV6 */ |
if (family == AF_INET) { |
if (family == AF_INET) { |
if (!prefix) { |
if (!prefix) { |
prefix = calloc(1, sizeof(prefix4_t)); | prefix = io_calloc(1, sizeof(prefix4_t)); |
dynamic_allocated++; |
dynamic_allocated++; |
} |
} |
memcpy(&prefix->add.sin, dest, 4); |
memcpy(&prefix->add.sin, dest, 4); |
Line 313 inline patricia_tree_t *New_Patricia(int maxbits)
|
Line 313 inline patricia_tree_t *New_Patricia(int maxbits)
|
{ |
{ |
patricia_tree_t *patricia; |
patricia_tree_t *patricia; |
|
|
patricia = calloc(1, sizeof *patricia); | patricia = io_calloc(1, sizeof *patricia); |
|
|
patricia->maxbits = maxbits; |
patricia->maxbits = maxbits; |
patricia->head = NULL; |
patricia->head = NULL; |
Line 567 inline patricia_node_t *patricia_lookup(patricia_tree_
|
Line 567 inline patricia_node_t *patricia_lookup(patricia_tree_
|
assert(prefix->bitlen <= patricia->maxbits); |
assert(prefix->bitlen <= patricia->maxbits); |
|
|
if (!patricia->head) { |
if (!patricia->head) { |
node = calloc(1, sizeof *node); | node = io_calloc(1, sizeof *node); |
node->bit = prefix->bitlen; |
node->bit = prefix->bitlen; |
node->prefix = Ref_Prefix(prefix); |
node->prefix = Ref_Prefix(prefix); |
node->parent = NULL; |
node->parent = NULL; |
Line 677 inline patricia_node_t *patricia_lookup(patricia_tree_
|
Line 677 inline patricia_node_t *patricia_lookup(patricia_tree_
|
return node; |
return node; |
} |
} |
|
|
new_node = calloc(1, sizeof *new_node); | new_node = io_calloc(1, sizeof *new_node); |
new_node->bit = prefix->bitlen; |
new_node->bit = prefix->bitlen; |
new_node->prefix = Ref_Prefix (prefix); |
new_node->prefix = Ref_Prefix (prefix); |
new_node->parent = NULL; |
new_node->parent = NULL; |
Line 723 inline patricia_node_t *patricia_lookup(patricia_tree_
|
Line 723 inline patricia_node_t *patricia_lookup(patricia_tree_
|
prefix_toa(prefix), prefix->bitlen); |
prefix_toa(prefix), prefix->bitlen); |
#endif /* PATRICIA_DEBUG */ |
#endif /* PATRICIA_DEBUG */ |
} else { |
} else { |
glue = calloc(1, sizeof *glue); | glue = io_calloc(1, sizeof *glue); |
glue->bit = differ_bit; |
glue->bit = differ_bit; |
glue->prefix = NULL; |
glue->prefix = NULL; |
glue->parent = node->parent; |
glue->parent = node->parent; |