Commit 5eef5ad1 authored by Juliusz Chroboczek's avatar Juliusz Chroboczek

Implement neighbour_txcost.

parent be630fae
......@@ -256,6 +256,13 @@ reset_txcost(struct neighbour *neigh)
return 0;
}
int
neighbour_txcost(struct neighbour *neigh)
{
reset_txcost(neigh);
return neigh->txcost;
}
int
check_neighbours()
{
......@@ -340,8 +347,7 @@ neighbour_cost(struct neighbour *neigh)
if(!neigh->network->up)
return INFINITY;
reset_txcost(neigh);
a = neigh->txcost;
a = neighbour_txcost(neigh);
if(a >= INFINITY)
return INFINITY;
......
......@@ -51,5 +51,6 @@ struct neighbour *add_neighbour(const unsigned char *id,
struct network *net);
int update_neighbour(struct neighbour *neigh, int hello, int hello_interval);
int check_neighbours(void);
int neighbour_txcost(struct neighbour *neigh);
int neighbour_rxcost(struct neighbour *neigh);
int neighbour_cost(struct neighbour *neigh);
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