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

Implement neighbour_txcost.

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