diff --git a/sys/shell/commands/sc_netif.c b/sys/shell/commands/sc_netif.c index 3b3a4f832b..cd83dd0f39 100644 --- a/sys/shell/commands/sc_netif.c +++ b/sys/shell/commands/sc_netif.c @@ -33,6 +33,7 @@ #include "net/ng_pkt.h" #include "net/ng_pktbuf.h" #include "net/ng_netif/hdr.h" +#include "net/ng_sixlowpan/netif.h" /** * @brief The maximal expected link layer address length in byte @@ -90,7 +91,7 @@ static void _set_usage(char *cmd_name) static void _flag_usage(char *cmd_name) { - printf("usage: %s [-]{promisc|autoack|preload}\n", cmd_name); + printf("usage: %s [-]{promisc|autoack|preload|6lo|iphc}\n", cmd_name); } static void _add_usage(char *cmd_name) @@ -264,6 +265,15 @@ static void _netif_list(kernel_pid_t dev) } #endif +#if defined(MODULE_NG_SIXLOWPAN_NETIF) && defined(MODULE_NG_SIXLOWPAN_IPHC) + ng_sixlowpan_netif_t *sixlo_entry = ng_sixlowpan_netif_get(dev); + + if ((sixlo_entry != NULL) && (sixlo_entry->iphc_enabled)) { + printf("IPHC "); + linebreak = true; + } +#endif + if (linebreak) { printf("\n "); } @@ -536,6 +546,29 @@ static int _netif_flag(char *cmd, kernel_pid_t dev, char *flag) return 1; #endif } + else if (strcmp(flag, "iphc") == 0) { +#if defined(MODULE_NG_SIXLOWPAN_NETIF) && defined(MODULE_NG_SIXLOWPAN_IPHC) + ng_sixlowpan_netif_t *entry = ng_sixlowpan_netif_get(dev); + + if (entry == NULL) { + puts("error: unable to (un)set IPHC"); + return 1; + } + + if (set) { + entry->iphc_enabled = true; + printf("success: enable IPHC on interface %" PRIkernel_pid "\n", dev); + } + else { + entry->iphc_enabled = false; + printf("success: disable IPHC on interface %" PRIkernel_pid "\n", dev); + } + return 0; +#else + puts("error: unable to (un)set IPHC."); + return 1; +#endif + } _flag_usage(cmd); return 1;