Skip to content

Commit

Permalink
[SQUASH ME] reverted changes to shell commands
Browse files Browse the repository at this point in the history
  • Loading branch information
BytesGalore authored and BytesGalore committed Apr 10, 2015
1 parent d12d1e8 commit bbb5a14
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 3 deletions.
5 changes: 3 additions & 2 deletions sys/shell/commands/sc_fib.c
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ int _fib_route_handler(int argc, char **argv)
/* e.g. fibroute right now dont care about the adress/protocol family */
if (argc == 1) {
fib_print_routes();
return 0;
return;
}

/* e.g. firoute [add|del] */
Expand Down Expand Up @@ -154,6 +154,8 @@ int _fib_route_handler(int argc, char **argv)
_fib_usage(1);
return 1;
}

return 0;
}

/* e.g. fibroute add <destination> via <next hop> dev <device> lifetime <lifetime> */
Expand Down Expand Up @@ -207,5 +209,4 @@ int _fib_route_handler(int argc, char **argv)
}

puts("\nunrecognized parameters.\nPlease enter fibroute [add|del] for more information.");
return 1;
}
31 changes: 30 additions & 1 deletion sys/shell/commands/sc_rpl.c
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,40 @@

#include "rpl.h"

static char addr_str[IPV6_MAX_ADDR_STR_LEN];

int _rpl_route_handler(int argc, char **argv)
{
(void) argc;
(void) argv;

puts("DEPRECATED Please use fibroute instead.");
rpl_routing_entry_t *rtable;
rtable = rpl_get_routing_table();
if (rtable) {
unsigned c = 0;
puts("--------------------------------------------------------------------");
puts("Routing table");
printf(" %-3s %-18s %-18s %s\n", "#", "target", "next hop", "lifetime");
puts("--------------------------------------------------------------------");

for (int i = 0; i < rpl_max_routing_entries; i++) {
if (rtable[i].used) {
c++;
printf(" %03d: %-18s ", i, ipv6_addr_to_str(addr_str, IPV6_MAX_ADDR_STR_LEN,
(&rtable[i].address)));
printf("%-18s ", ipv6_addr_to_str(addr_str, IPV6_MAX_ADDR_STR_LEN,
(&rtable[i].next_hop)));
printf("%d\n", rtable[i].lifetime);

}
}
puts("--------------------------------------------------------------------");
printf(" %u routing table entries\n", c);
}
else {
puts("No routing table available");
}
puts("$");

return 0;
}

0 comments on commit bbb5a14

Please sign in to comment.