Changes in RPL implementation :
- Structural modification of RPL data storage. - Support multiple gateways (multiple DODAG-ID with a unique InstanceID) - Use Lollipop counters - Add leaf-only configuration option for RPL Bugfix : - Correctly send "Grounded" flag in DIO
This commit is contained in:
parent
2ac91d53b5
commit
dc9cbe647d
15 changed files with 1497 additions and 555 deletions
|
@ -48,6 +48,7 @@
|
|||
|
||||
static void reset(rpl_dag_t *);
|
||||
static rpl_parent_t *best_parent(rpl_parent_t *, rpl_parent_t *);
|
||||
static rpl_dag_t *best_dag(rpl_dag_t *, rpl_dag_t *);
|
||||
static rpl_rank_t calculate_rank(rpl_parent_t *, rpl_rank_t);
|
||||
static void update_metric_container(rpl_dag_t *);
|
||||
|
||||
|
@ -55,6 +56,7 @@ rpl_of_t rpl_of0 = {
|
|||
reset,
|
||||
NULL,
|
||||
best_parent,
|
||||
best_dag,
|
||||
calculate_rank,
|
||||
update_metric_container,
|
||||
0
|
||||
|
@ -92,6 +94,32 @@ calculate_rank(rpl_parent_t *p, rpl_rank_t base_rank)
|
|||
|
||||
}
|
||||
|
||||
static rpl_dag_t *
|
||||
best_dag(rpl_dag_t *d1, rpl_dag_t *d2)
|
||||
{
|
||||
if(d1->grounded) {
|
||||
if (!d2->grounded) {
|
||||
return d1;
|
||||
}
|
||||
} else if(d2->grounded) {
|
||||
return d2;
|
||||
}
|
||||
|
||||
if(d1->preference < d2->preference) {
|
||||
return d2;
|
||||
} else {
|
||||
if(d1->preference > d2->preference) {
|
||||
return d1;
|
||||
}
|
||||
}
|
||||
|
||||
if(d2->rank < d1->rank) {
|
||||
return d2;
|
||||
} else {
|
||||
return d1;
|
||||
}
|
||||
}
|
||||
|
||||
static rpl_parent_t *
|
||||
best_parent(rpl_parent_t *p1, rpl_parent_t *p2)
|
||||
{
|
||||
|
@ -127,7 +155,7 @@ best_parent(rpl_parent_t *p1, rpl_parent_t *p2)
|
|||
}
|
||||
|
||||
static void
|
||||
update_metric_container(rpl_dag_t *dag)
|
||||
update_metric_container(rpl_instance_t *instance)
|
||||
{
|
||||
dag->mc.type = RPL_DAG_MC_NONE;
|
||||
instance->mc.type = RPL_DAG_MC_NONE;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue