0
0
mirror of https://gitlab.nic.cz/labs/bird.git synced 2024-12-22 09:41:54 +00:00

code cleanup

This commit is contained in:
Vojtech Vilimek 2023-07-11 14:32:27 +02:00
parent 6a097ebd55
commit c65d2299bd
2 changed files with 0 additions and 71 deletions

View File

@ -1004,68 +1004,6 @@ trie_walk_init(struct f_trie_walk_state *s, const struct f_trie *t, const net_ad
}
return 0;
// if (child)
//
// {
// /* Performs basically more granular net_comapre_ip{4,6}() */
// if (v4) net4 = (struct net_addr_ip4 *) net;
// else net6 = (struct net_addr_ip6 *) net;
//
// int cmp = v4 ? ip4_compare(child->v4.addr, net4->prefix)
// : ip6_compare(child->v6.addr, net6->prefix);
// if (cmp < 0)
// {
// while ()
// {
// }
// /* We continue as we've just finished walk in a child node */
// s->local_pos = before_pos(bits + 1, TRIE_STEP);
// s->stack_pos++;
// s->stack[s->stack_pos] = child;
// s->local_pos = last_pos(TRIE_STEP);
// }
// else if (cmp > 0)
// {
// /* We continue in child node */
// if (bits % 2 == 0)
// {
// s->stack_pos++;
// s->stack[s->stack_pos] = child;
// s->local_pos = 1; //last_pos(TRIE_STEP);
// }
// //s->local_pos = 0x08 + (bits >> 1);
// //s->local_pos = before_pos(bits, TRIE_STEP);
// //s->local_pos = MAX(0, after_pos(bits - 1, TRIE_STEP)); //s->local_pos = before_pos(bits >> 1, TRIE_STEP);
// else
// //s->local_pos = MIN((1u << TRIE_STEP) + bits, (1u << TRIE_STEP) + 15);
// s->local_pos = after_pos(bits, TRIE_STEP);
// }
// else
// {
// if (v4 ? child->v4.plen <= net4->pxlen : child->v6.plen < net6->pxlen)
// {
// /* We continue in child node */
// if (bits % 2 == 0)
// s->local_pos = before_pos(bits >> 1, TRIE_STEP);
// //s->local_pos = 0x08 + (bits >> 1);
// else
// //s->local_pos = MIN((1u << TRIE_STEP) + bits, (1u << TRIE_STEP) + 15);
// s->local_pos = after_pos(bits, TRIE_STEP);
// }
// else
// {
// /* We continue in current node from first position */
// s->stack_pos++;
// s->stack[s->stack_pos] = child;
// s->local_pos = 1;
// }
// }
// return 0;
// }
//
// s->local_pos = 0x10 + bits;
// return 0;
}
#define GET_ACCEPT_BIT(N,X,B) ((X) ? ip4_getbit((N)->v4.accept, (B)) : ip6_getbit((N)->v6.accept, (B)))

View File

@ -259,11 +259,6 @@ make_random_prefix_list(int num, int v6, int tight)
struct f_prefix_node *px = lp_allocz(tmp_linpool, sizeof(struct f_prefix_node));
get_random_prefix(&px->prefix, v6, tight);
add_tail(prefixes, &px->n);
//char buf[64];
//bt_format_net(buf, 64, &px->prefix.net);
//bt_debug("ADD %s{%d,%d}\n", buf, px->prefix.lo, px->prefix.hi);
//log("ADD %s{%d,%d}", buf, px->prefix.lo, px->prefix.hi);
}
return prefixes;
@ -314,10 +309,6 @@ read_prefix_list(FILE *f, int v6, int plus)
px->prefix.lo = pl;
px->prefix.hi = plus ? IP4_MAX_PREFIX_LENGTH : pl;
add_tail(pxlist, &px->n);
//char buf[64];
//bt_format_net(buf, 64, &px->prefix.net);
//bt_debug("ADD %s{%d,%d}\n", buf, px->prefix.lo, px->prefix.hi);
}
bt_syscall(errno, "fgets()");