1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2025-12-26 23:11:19 +01:00

Merge pull request #12997 from miri64/shell_commands/enh/6lo-ctx-on-non-6LBR

shell_commands: make 6Lo compression contexts configurable on non-6LBR
This commit is contained in:
Leandro Lanzieri 2020-01-06 11:46:05 +01:00 committed by GitHub
commit ffbd764111
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 8 additions and 7 deletions

View File

@ -53,10 +53,8 @@ ifneq (,$(filter gnrc_rpl,$(USEMODULE)))
SRC += sc_gnrc_rpl.c
endif
ifneq (,$(filter gnrc_sixlowpan_ctx,$(USEMODULE)))
ifneq (,$(filter gnrc_ipv6_nib_6lbr,$(USEMODULE)))
SRC += sc_gnrc_6ctx.c
endif
endif
ifneq (,$(filter gnrc_sixlowpan_frag_stats,$(USEMODULE)))
SRC += sc_gnrc_6lo_frag_stats.c
endif

View File

@ -19,6 +19,7 @@
#include <stdlib.h>
#include <string.h>
#include "kernel_defines.h"
#include "net/ipv6/addr.h"
#include "net/gnrc/sixlowpan/ctx.h"
#include "net/sixlowpan/nd.h"
@ -69,6 +70,9 @@ int _gnrc_6ctx_add(char *cmd_str, char *ctx_str, char *prefix_str, char *ltime_s
_usage(cmd_str);
return 1;
}
if (!IS_USED(MODULE_GNRC_IPV6_NIB_6LBR)) {
puts("WARNING: context dissemination by non-6LBR not supported");
}
addr_str = strtok_r(prefix_str, "/", &save_ptr);
if (addr_str == NULL) {
_usage(cmd_str);
@ -106,7 +110,10 @@ int _gnrc_6ctx_del(char *cmd_str, char *ctx_str)
_usage(cmd_str);
return 1;
}
else if (del_timer[cid].callback == NULL) {
if (!IS_USED(MODULE_GNRC_IPV6_NIB_6LBR)) {
puts("WARNING: context dissemination by non-6LBR not supported");
}
if (del_timer[cid].callback == NULL) {
ctx = gnrc_sixlowpan_ctx_lookup_id(cid);
if (ctx != NULL) {
ctx->flags_id &= ~GNRC_SIXLOWPAN_CTX_FLAGS_COMP;

View File

@ -112,10 +112,8 @@ extern int _gnrc_rpl(int argc, char **argv);
#endif
#ifdef MODULE_GNRC_SIXLOWPAN_CTX
#ifdef MODULE_GNRC_IPV6_NIB_6LBR
extern int _gnrc_6ctx(int argc, char **argv);
#endif
#endif
#ifdef MODULE_GNRC_SIXLOWPAN_FRAG_STATS
#ifdef MODULE_GNRC_SIXLOWPAN_FRAG_STATS
@ -236,10 +234,8 @@ const shell_command_t _shell_command_list[] = {
{"rpl", "rpl configuration tool ('rpl help' for more information)", _gnrc_rpl },
#endif
#ifdef MODULE_GNRC_SIXLOWPAN_CTX
#ifdef MODULE_GNRC_IPV6_NIB_6LBR
{"6ctx", "6LoWPAN context configuration tool", _gnrc_6ctx },
#endif
#endif
#ifdef MODULE_GNRC_SIXLOWPAN_FRAG_STATS
{"6lo_frag", "6LoWPAN fragment statistics", _gnrc_6lo_frag_stats },
#endif