Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
R
RIOT
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
cm-projects
RIOT
Commits
79ac710e
Commit
79ac710e
authored
9 years ago
by
Oleg Hahm
Browse files
Options
Downloads
Plain Diff
Merge pull request #3677 from cgundogan/pr/rpl/cleanup
rpl: minor cleanup
parents
5b1fc105
5ee36c6a
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
sys/include/net/gnrc/rpl/dodag.h
+0
-10
0 additions, 10 deletions
sys/include/net/gnrc/rpl/dodag.h
sys/net/gnrc/routing/rpl/gnrc_rpl_dodag.c
+18
-10
18 additions, 10 deletions
sys/net/gnrc/routing/rpl/gnrc_rpl_dodag.c
sys/net/gnrc/routing/rpl/of0.c
+1
-1
1 addition, 1 deletion
sys/net/gnrc/routing/rpl/of0.c
with
19 additions
and
21 deletions
sys/include/net/gnrc/rpl/dodag.h
+
0
−
10
View file @
79ac710e
...
...
@@ -192,16 +192,6 @@ gnrc_rpl_parent_t *gnrc_rpl_parent_get(gnrc_rpl_dodag_t *dodag, ipv6_addr_t *add
*/
void
gnrc_rpl_parent_update
(
gnrc_rpl_dodag_t
*
dodag
,
gnrc_rpl_parent_t
*
parent
);
/**
* @brief Find the parent with the lowest rank and update the DODAG's preferred parent
*
* @param[in] dodag Pointer to the DODAG
*
* @return Pointer to the preferred parent, on success.
* @return NULL, otherwise.
*/
gnrc_rpl_parent_t
*
gnrc_rpl_find_preferred_parent
(
gnrc_rpl_dodag_t
*
dodag
);
/**
* @brief Start a local repair.
*
...
...
This diff is collapsed.
Click to expand it.
sys/net/gnrc/routing/rpl/gnrc_rpl_dodag.c
+
18
−
10
View file @
79ac710e
...
...
@@ -32,7 +32,11 @@
static
char
addr_str
[
IPV6_ADDR_MAX_STR_LEN
];
#endif
void
rpl_trickle_send_dio
(
void
*
args
)
static
gnrc_rpl_parent_t
*
_gnrc_rpl_find_preferred_parent
(
gnrc_rpl_dodag_t
*
dodag
);
static
void
_rpl_trickle_send_dio
(
void
*
args
);
static
int
_compare_parents
(
gnrc_rpl_parent_t
*
p1
,
gnrc_rpl_parent_t
*
p2
);
static
void
_rpl_trickle_send_dio
(
void
*
args
)
{
gnrc_rpl_dodag_t
*
dodag
=
(
gnrc_rpl_dodag_t
*
)
args
;
ipv6_addr_t
all_RPL_nodes
=
GNRC_RPL_ALL_NODES_ADDR
;
...
...
@@ -144,7 +148,7 @@ bool gnrc_rpl_dodag_add(gnrc_rpl_instance_t *instance, ipv6_addr_t *dodag_id, gn
(
*
dodag
)
->
addr_preferred
=
GNRC_RPL_DEFAULT_PREFIX_LIFETIME
;
(
*
dodag
)
->
addr_valid
=
GNRC_RPL_DEFAULT_PREFIX_LIFETIME
;
(
*
dodag
)
->
my_rank
=
GNRC_RPL_INFINITE_RANK
;
(
*
dodag
)
->
trickle
.
callback
.
func
=
&
rpl_trickle_send_dio
;
(
*
dodag
)
->
trickle
.
callback
.
func
=
&
_
rpl_trickle_send_dio
;
(
*
dodag
)
->
trickle
.
callback
.
args
=
*
dodag
;
(
*
dodag
)
->
dio_interval_doubl
=
GNRC_RPL_DEFAULT_DIO_INTERVAL_DOUBLINGS
;
(
*
dodag
)
->
dio_min
=
GNRC_RPL_DEFAULT_DIO_INTERVAL_MIN
;
...
...
@@ -352,7 +356,7 @@ void gnrc_rpl_parent_update(gnrc_rpl_dodag_t *dodag, gnrc_rpl_parent_t *parent)
}
}
if
(
gnrc_rpl_find_preferred_parent
(
dodag
)
==
NULL
)
{
if
(
_
gnrc_rpl_find_preferred_parent
(
dodag
)
==
NULL
)
{
gnrc_rpl_local_repair
(
dodag
);
}
...
...
@@ -361,23 +365,27 @@ void gnrc_rpl_parent_update(gnrc_rpl_dodag_t *dodag, gnrc_rpl_parent_t *parent)
}
}
int
_compare_parents
(
gnrc_rpl_parent_t
*
p1
,
gnrc_rpl_parent_t
*
p2
)
static
int
_compare_parents
(
gnrc_rpl_parent_t
*
p1
,
gnrc_rpl_parent_t
*
p2
)
{
return
p1
->
dodag
->
instance
->
of
->
which_parent
(
p1
,
p2
)
==
p1
?
-
1
:
1
;
}
gnrc_rpl_parent_t
*
gnrc_rpl_find_preferred_parent
(
gnrc_rpl_dodag_t
*
dodag
)
/**
* @brief Find the parent with the lowest rank and update the DODAG's preferred parent
*
* @param[in] dodag Pointer to the DODAG
*
* @return Pointer to the preferred parent, on success.
* @return NULL, otherwise.
*/
static
gnrc_rpl_parent_t
*
_gnrc_rpl_find_preferred_parent
(
gnrc_rpl_dodag_t
*
dodag
)
{
ipv6_addr_t
def
=
IPV6_ADDR_UNSPECIFIED
;
gnrc_rpl_parent_t
*
old_best
=
dodag
->
parents
;
LL_SORT
(
dodag
->
parents
,
_compare_parents
);
if
(
dodag
->
parents
==
NULL
)
{
return
NULL
;
}
else
if
(
dodag
->
parents
->
rank
>=
dodag
->
my_rank
)
{
gnrc_rpl_parent_remove
(
dodag
->
parents
);
if
((
dodag
->
parents
==
NULL
)
||
(
dodag
->
parents
->
rank
>=
dodag
->
my_rank
))
{
return
NULL
;
}
...
...
This diff is collapsed.
Click to expand it.
sys/net/gnrc/routing/rpl/of0.c
+
1
−
1
View file @
79ac710e
...
...
@@ -86,7 +86,7 @@ gnrc_rpl_parent_t *which_parent(gnrc_rpl_parent_t *p1, gnrc_rpl_parent_t *p2)
return
p2
;
}
/* Not used yet
, as the implementation only makes use of one dodag for now.
*/
/* Not used yet */
gnrc_rpl_dodag_t
*
which_dodag
(
gnrc_rpl_dodag_t
*
d1
,
gnrc_rpl_dodag_t
*
d2
)
{
(
void
)
d2
;
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment