Commit 51101a7c authored by Juliusz Chroboczek's avatar Juliusz Chroboczek

Rename neighbour_cost to rxcost and symmetric_cost to cost.

parent 1cb3f767
......@@ -437,11 +437,11 @@ main(int argc, char **argv)
if(neighs[i].id[0] == 0)
continue;
printf("Neighbour %s ", format_address(neighs[i].id));
printf("at %s dev %s reach %04x cost %d txcost %d.\n",
printf("at %s dev %s reach %04x rxcost %d txcost %d.\n",
format_address(neighs[i].address),
neighs[i].network->ifname,
neighs[i].reach,
neighbour_cost(&neighs[i]),
neighbour_rxcost(&neighs[i]),
neighs[i].txcost);
}
for(i = 0; i < numroutes; i++) {
......
......@@ -546,8 +546,6 @@ send_txcost(struct neighbour *neigh, struct network *net)
}
net->txcost_time = now.tv_sec;
} else {
int cost;
if(net && neigh->network != net)
return;
......@@ -558,12 +556,10 @@ send_txcost(struct neighbour *neigh, struct network *net)
format_address(neigh->id),
format_address(neigh->address));
cost = neighbour_cost(neigh);
start_message(net, 20);
accumulate_byte(net, 3);
accumulate_byte(net, 0);
accumulate_short(net, neighbour_cost(neigh));
accumulate_short(net, neighbour_rxcost(neigh));
accumulate_data(net, neigh->id, 16);
schedule_flush(net);
}
......
......@@ -190,7 +190,7 @@ check_neighbour(struct neighbour *neigh)
}
int
neighbour_cost(struct neighbour *neigh)
neighbour_rxcost(struct neighbour *neigh)
{
update_neighbour(neigh, -1, 0);
if(neigh->reach == 0)
......@@ -215,7 +215,7 @@ neighbour_cost(struct neighbour *neigh)
}
int
neighbour_symmetric_cost(struct neighbour *neigh)
neighbour_cost(struct neighbour *neigh)
{
int c;
/* (1/(alpha * beta) + 1/beta) / 2, which is half the expected
......@@ -226,7 +226,7 @@ neighbour_symmetric_cost(struct neighbour *neigh)
if(neigh->txcost >= INFINITY)
return INFINITY;
c = neighbour_cost(neigh);
c = neighbour_rxcost(neigh);
if(c >= INFINITY)
return INFINITY;
......
......@@ -43,5 +43,5 @@ add_neighbour(const unsigned char *id, const unsigned char *address,
struct network *net);
void update_neighbour(struct neighbour *neigh, int hello, int hello_interval);
void check_neighbour(struct neighbour *neigh);
int neighbour_rxcost(struct neighbour *neigh);
int neighbour_cost(struct neighbour *neigh);
int neighbour_symmetric_cost(struct neighbour *neigh);
......@@ -284,7 +284,7 @@ void
update_route_metric(struct route *route)
{
int metric, oldmetric, install = 0;
metric = MIN(route->refmetric + neighbour_symmetric_cost(route->nexthop),
metric = MIN(route->refmetric + neighbour_cost(route->nexthop),
INFINITY);
if(route->installed &&
(metric >= INFINITY ||
......@@ -328,7 +328,7 @@ update_route(const unsigned char *d, int seqno, int refmetric,
if(dest == NULL)
return NULL;
metric = MIN(refmetric + neighbour_symmetric_cost(nexthop), INFINITY);
metric = MIN(refmetric + neighbour_cost(nexthop), INFINITY);
route = find_route(d, nexthop);
......
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