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
dbccf06c
Unverified
Commit
dbccf06c
authored
6 years ago
by
Martine Lenders
Committed by
GitHub
6 years ago
Browse files
Options
Downloads
Plain Diff
Merge pull request #8575 from miri64/shell/fix/6ctx
shell: adapt 6ctx command for NIB
parents
e876bbd0
ed0fbbb2
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
sys/shell/commands/Makefile
+1
-1
1 addition, 1 deletion
sys/shell/commands/Makefile
sys/shell/commands/sc_gnrc_6ctx.c
+9
-9
9 additions, 9 deletions
sys/shell/commands/sc_gnrc_6ctx.c
sys/shell/commands/shell_commands.c
+2
-2
2 additions, 2 deletions
sys/shell/commands/shell_commands.c
with
12 additions
and
12 deletions
sys/shell/commands/Makefile
+
1
−
1
View file @
dbccf06c
...
@@ -44,7 +44,7 @@ ifneq (,$(filter gnrc_rpl,$(USEMODULE)))
...
@@ -44,7 +44,7 @@ ifneq (,$(filter gnrc_rpl,$(USEMODULE)))
SRC
+=
sc_gnrc_rpl.c
SRC
+=
sc_gnrc_rpl.c
endif
endif
ifneq
(,$(filter gnrc_sixlowpan_ctx,$(USEMODULE)))
ifneq
(,$(filter gnrc_sixlowpan_ctx,$(USEMODULE)))
ifneq
(,$(filter gnrc_
sixlowpan_nd_border_route
r,$(USEMODULE)))
ifneq
(,$(filter gnrc_
ipv6_nib_6lb
r,$(USEMODULE)))
SRC
+=
sc_gnrc_6ctx.c
SRC
+=
sc_gnrc_6ctx.c
endif
endif
endif
endif
...
...
This diff is collapsed.
Click to expand it.
sys/shell/commands/sc_gnrc_6ctx.c
+
9
−
9
View file @
dbccf06c
...
@@ -21,7 +21,7 @@
...
@@ -21,7 +21,7 @@
#include
"net/ipv6/addr.h"
#include
"net/ipv6/addr.h"
#include
"net/gnrc/sixlowpan/ctx.h"
#include
"net/gnrc/sixlowpan/ctx.h"
#include
"net/
gnrc/
sixlowpan/nd.h"
#include
"net/sixlowpan/nd.h"
#include
"timex.h"
#include
"timex.h"
#include
"xtimer.h"
#include
"xtimer.h"
...
@@ -45,13 +45,14 @@ int _gnrc_6ctx_list(void)
...
@@ -45,13 +45,14 @@ int _gnrc_6ctx_list(void)
{
{
puts
(
"cid|prefix |C|ltime"
);
puts
(
"cid|prefix |C|ltime"
);
puts
(
"-----------------------------------------------------------"
);
puts
(
"-----------------------------------------------------------"
);
for
(
uint8_t
i
=
0
;
i
<
GNRC_SIXLOWPAN_CTX_SIZE
;
i
++
)
{
for
(
uint8_t
cid
=
0
;
cid
<
GNRC_SIXLOWPAN_CTX_SIZE
;
cid
++
)
{
gnrc_sixlowpan_ctx_t
*
ctx
=
gnrc_sixlowpan_ctx_lookup_id
(
i
);
gnrc_sixlowpan_ctx_t
*
ctx
=
gnrc_sixlowpan_ctx_lookup_id
(
cid
);
if
(
ctx
!=
NULL
)
{
if
(
ctx
!=
NULL
)
{
char
addr_str
[
IPV6_ADDR_MAX_STR_LEN
];
char
addr_str
[
IPV6_ADDR_MAX_STR_LEN
];
printf
(
" %2"
PRIu8
"|%39s/%-3"
PRIu8
"|%"
PRIx8
"|%5"
PRIu16
" min
\n
"
,
i
,
printf
(
" %2u|%39s/%-3u|%x|%5umin
\n
"
,
cid
,
ipv6_addr_to_str
(
addr_str
,
&
ctx
->
prefix
,
sizeof
(
addr_str
)),
ctx
->
prefix_len
,
ipv6_addr_to_str
(
addr_str
,
&
ctx
->
prefix
,
sizeof
(
addr_str
)),
(
uint8_t
)
((
ctx
->
flags_id
&
0xf0
)
>>
4
),
ctx
->
ltime
);
ctx
->
prefix_len
,
(
uint8_t
)
((
ctx
->
flags_id
&
0xf0
)
>>
4
),
ctx
->
ltime
);
}
}
}
}
return
0
;
return
0
;
...
@@ -112,15 +113,14 @@ int _gnrc_6ctx_del(char *cmd_str, char *ctx_str)
...
@@ -112,15 +113,14 @@ int _gnrc_6ctx_del(char *cmd_str, char *ctx_str)
ctx
->
ltime
=
0
;
ctx
->
ltime
=
0
;
del_timer
[
cid
].
callback
=
_del_cb
;
del_timer
[
cid
].
callback
=
_del_cb
;
del_timer
[
cid
].
arg
=
ctx
;
del_timer
[
cid
].
arg
=
ctx
;
xtimer_set
(
&
del_timer
[
cid
],
GNRC_SIXLOWPAN_ND_RTR_MIN_CTX_DELAY
*
US_PER_SEC
);
xtimer_set
(
&
del_timer
[
cid
],
SIXLOWPAN_ND_MIN_CTX_CHANGE_SEC_DELAY
*
US_PER_SEC
);
}
}
}
}
else
{
else
{
printf
(
"Context %u already marked for removal
\n
"
,
cid
);
printf
(
"Context %u already marked for removal
\n
"
,
cid
);
return
1
;
return
1
;
}
}
/* advertise updated context */
_adv_ctx
();
return
0
;
return
0
;
}
}
...
...
This diff is collapsed.
Click to expand it.
sys/shell/commands/shell_commands.c
+
2
−
2
View file @
dbccf06c
...
@@ -113,7 +113,7 @@ extern int _gnrc_rpl(int argc, char **argv);
...
@@ -113,7 +113,7 @@ extern int _gnrc_rpl(int argc, char **argv);
#endif
#endif
#ifdef MODULE_GNRC_SIXLOWPAN_CTX
#ifdef MODULE_GNRC_SIXLOWPAN_CTX
#ifdef MODULE_GNRC_
SIXLOWPAN_ND_BORDER_ROUTE
R
#ifdef MODULE_GNRC_
IPV6_NIB_6LB
R
extern
int
_gnrc_6ctx
(
int
argc
,
char
**
argv
);
extern
int
_gnrc_6ctx
(
int
argc
,
char
**
argv
);
#endif
#endif
#endif
#endif
...
@@ -203,7 +203,7 @@ const shell_command_t _shell_command_list[] = {
...
@@ -203,7 +203,7 @@ const shell_command_t _shell_command_list[] = {
{
"rpl"
,
"rpl configuration tool ('rpl help' for more information)"
,
_gnrc_rpl
},
{
"rpl"
,
"rpl configuration tool ('rpl help' for more information)"
,
_gnrc_rpl
},
#endif
#endif
#ifdef MODULE_GNRC_SIXLOWPAN_CTX
#ifdef MODULE_GNRC_SIXLOWPAN_CTX
#ifdef MODULE_GNRC_
SIXLOWPAN_ND_BORDER_ROUTE
R
#ifdef MODULE_GNRC_
IPV6_NIB_6LB
R
{
"6ctx"
,
"6LoWPAN context configuration tool"
,
_gnrc_6ctx
},
{
"6ctx"
,
"6LoWPAN context configuration tool"
,
_gnrc_6ctx
},
#endif
#endif
#endif
#endif
...
...
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