fixed RPL statistics bug and added parent switch stats

This commit is contained in:
Joakim Eriksson 2011-03-15 14:14:41 +01:00
parent 7033bc859e
commit 5f4d4550fc
3 changed files with 3 additions and 1 deletions

View File

@ -358,6 +358,7 @@ rpl_select_parent(rpl_dag_t *dag)
rpl_reset_dio_timer(dag, 1);
PRINTF("RPL: New preferred parent, rank changed from %u to %u\n",
(unsigned)dag->rank, dag->of->calculate_rank(best, 0));
RPL_STAT(rpl_stats.parent_switch++);
}
/* Update the DAG rank, since link-layer information may have changed

View File

@ -571,7 +571,7 @@ dao_input(void)
rep = rpl_add_route(dag, &prefix, prefixlen, &dao_sender_addr);
if(rep == NULL) {
RPL_STAT(rpl_stats.memory_overflows++);
RPL_STAT(rpl_stats.mem_overflows++);
PRINTF("RPL: Could not add a route after receiving a DAO\n");
return;
} else {

View File

@ -218,6 +218,7 @@ struct rpl_stats {
uint16_t global_repairs;
uint16_t malformed_msgs;
uint16_t resets;
uint16_t parent_switch;
};
typedef struct rpl_stats rpl_stats_t;