Skip to content

Commit

Permalink
Remove useless function.
Browse files Browse the repository at this point in the history
Was used in the first version of the disambiguation.c algorithm.
  • Loading branch information
Matthieu Boutier authored and Juliusz Chroboczek committed Apr 13, 2015
1 parent ae6a8f5 commit 0efc487
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 70 deletions.
66 changes: 0 additions & 66 deletions route.c
Original file line number Diff line number Diff line change
Expand Up @@ -390,72 +390,6 @@ route_stream_done(struct route_stream *stream)
free(stream);
}

/* Search the minimum route covering (dst, src), such that either the exact
destination or source is given. If exclusive_min is true, (dst, src) is
excluded from the search. */
struct babel_route *
find_min_iroute(const unsigned char *dst_prefix, unsigned char dst_plen,
const unsigned char *src_prefix, unsigned char src_plen,
int is_fixed_dst, int exclusive_min)
{
enum prefix_status st;
struct babel_route *result = NULL;
int i;

if(is_fixed_dst) {
for(i = 0; i < route_slots; i++) {
if(!routes[i]->installed)
continue;
st = prefix_cmp(dst_prefix, dst_plen,
routes[i]->src->prefix, routes[i]->src->plen);
if(st != PST_EQUALS)
continue;
st = prefix_cmp(src_prefix, src_plen,
routes[i]->src->src_prefix,
routes[i]->src->src_plen);
if(!(st & (exclusive_min ? PST_MORE_SPECIFIC :
PST_MORE_SPECIFIC | PST_EQUALS)))
continue;
if(result &&
(prefix_cmp(result->src->src_prefix,
result->src->src_plen,
routes[i]->src->src_prefix,
routes[i]->src->src_plen) == PST_MORE_SPECIFIC))
continue;

result = routes[i];
}

} else {
for(i = 0; i < route_slots; i++) {
if(!routes[i]->installed)
continue;
st = prefix_cmp(src_prefix, src_plen,
routes[i]->src->src_prefix,
routes[i]->src->src_plen);
if(st != PST_EQUALS)
continue;
st = prefix_cmp(dst_prefix, dst_plen,
routes[i]->src->prefix, routes[i]->src->plen);
if(!(st & (exclusive_min ? PST_MORE_SPECIFIC :
PST_MORE_SPECIFIC | PST_EQUALS)))
continue;
if(result &&
(prefix_cmp(result->src->prefix,
result->src->plen,
routes[i]->src->prefix,
routes[i]->src->plen) == PST_MORE_SPECIFIC))
continue;

result = routes[i];
}
}

if(result)
assert(v4mapped(dst_prefix) == v4mapped(result->src->prefix));
return result;
}

int
metric_to_kernel(int metric)
{
Expand Down
4 changes: 0 additions & 4 deletions route.h
Original file line number Diff line number Diff line change
Expand Up @@ -75,10 +75,6 @@ struct babel_route *find_route(const unsigned char *prefix, unsigned char plen,
struct babel_route *find_installed_route(const unsigned char *prefix,
unsigned char plen, const unsigned char *src_prefix,
unsigned char src_plen);
struct babel_route *find_min_iroute(const unsigned char *dst_prefix,
unsigned char dst_plen,
const unsigned char *src_prefix, unsigned char src_plen,
int is_fixed_dst, int exclusive_min);
int installed_routes_estimate(void);
void flush_route(struct babel_route *route);
void flush_all_routes(void);
Expand Down

0 comments on commit 0efc487

Please sign in to comment.