50 #include "dev/watchdog.h" 55 #if MAC_CONF_WITH_TSCH 58 #if MAC_CONF_WITH_CSMA 65 #if ROUTING_CONF_RPL_LITE 66 #include "net/routing/rpl-lite/rpl.h" 67 #elif ROUTING_CONF_RPL_CLASSIC 68 #include "net/routing/rpl-classic/rpl.h" 73 #define PING_TIMEOUT (5 * CLOCK_SECOND) 75 #if NETSTACK_CONF_WITH_IPV6 76 static struct uip_icmp6_echo_reply_notification echo_reply_notification;
77 static shell_output_func *curr_ping_output_func = NULL;
78 static struct process *curr_ping_process;
79 static uint8_t curr_ping_ttl;
80 static uint16_t curr_ping_datalen;
83 static shell_command_6top_sub_cmd_t sixtop_sub_cmd = NULL;
85 static struct shell_command_set_t builtin_shell_command_set;
86 LIST(shell_command_sets);
87 #if NETSTACK_CONF_WITH_IPV6 90 ds6_nbr_state_to_str(uint8_t state)
109 echo_reply_handler(uip_ipaddr_t *source, uint8_t ttl, uint8_t *data, uint16_t datalen)
111 if(curr_ping_output_func != NULL) {
112 curr_ping_output_func = NULL;
114 curr_ping_datalen = datalen;
120 PT_THREAD(cmd_ping(
struct pt *pt, shell_output_func
output,
char *args))
122 static uip_ipaddr_t remote_addr;
123 static struct etimer timeout_timer;
128 SHELL_ARGS_INIT(args, next_args);
131 SHELL_ARGS_NEXT(args, next_args);
133 SHELL_OUTPUT(output,
"Destination IPv6 address is not specified\n");
136 SHELL_OUTPUT(output,
"Invalid IPv6 address: %s\n", args);
140 SHELL_OUTPUT(output,
"Pinging ");
142 SHELL_OUTPUT(output,
"\n");
146 curr_ping_output_func =
output;
151 if(curr_ping_output_func != NULL) {
152 SHELL_OUTPUT(output,
"Timeout\n");
153 curr_ping_output_func = NULL;
155 SHELL_OUTPUT(output,
"Received ping reply from ");
157 SHELL_OUTPUT(output,
", len %u, ttl %u, delay %lu ms\n",
165 #if ROUTING_CONF_RPL_LITE 171 case DAG_INITIALIZED:
172 return "Initialized";
185 rpl_mop_to_str(
int mop)
188 case RPL_MOP_NO_DOWNWARD_ROUTES:
189 return "No downward routes";
190 case RPL_MOP_NON_STORING:
191 return "Non-storing";
192 case RPL_MOP_STORING_NO_MULTICAST:
194 case RPL_MOP_STORING_MULTICAST:
195 return "Storing+multicast";
202 rpl_ocp_to_str(
int ocp)
215 PT_THREAD(cmd_rpl_nbr(
struct pt *pt, shell_output_func output,
char *args))
220 SHELL_OUTPUT(output,
"RPL neighbors: none\n");
223 SHELL_OUTPUT(output,
"RPL neighbors:\n");
227 SHELL_OUTPUT(output,
"%s\n", buf);
228 nbr = nbr_table_next(rpl_neighbors, nbr);
236 PT_THREAD(cmd_rpl_status(
struct pt *pt, shell_output_func output,
char *args))
240 SHELL_OUTPUT(output,
"RPL status:\n");
241 if(!curr_instance.used) {
242 SHELL_OUTPUT(output,
"-- Instance: None\n");
244 SHELL_OUTPUT(output,
"-- Instance: %u\n", curr_instance.instance_id);
246 SHELL_OUTPUT(output,
"-- DAG root\n");
248 SHELL_OUTPUT(output,
"-- DAG node\n");
250 SHELL_OUTPUT(output,
"-- DAG: ");
252 SHELL_OUTPUT(output,
", version %u\n", curr_instance.dag.version);
253 SHELL_OUTPUT(output,
"-- Prefix: ");
255 SHELL_OUTPUT(output,
"/%u\n", curr_instance.dag.prefix_info.length);
256 SHELL_OUTPUT(output,
"-- MOP: %s\n", rpl_mop_to_str(curr_instance.mop));
257 SHELL_OUTPUT(output,
"-- OF: %s\n", rpl_ocp_to_str(curr_instance.of->ocp));
258 SHELL_OUTPUT(output,
"-- Hop rank increment: %u\n", curr_instance.min_hoprankinc);
259 SHELL_OUTPUT(output,
"-- Default lifetime: %lu seconds\n",
RPL_LIFETIME(curr_instance.default_lifetime));
261 SHELL_OUTPUT(output,
"-- State: %s\n", rpl_state_to_str(curr_instance.dag.state));
262 SHELL_OUTPUT(output,
"-- Preferred parent: ");
263 if(curr_instance.dag.preferred_parent) {
265 SHELL_OUTPUT(output,
" (last DTSN: %u)\n", curr_instance.dag.preferred_parent->dtsn);
267 SHELL_OUTPUT(output,
"None\n");
269 SHELL_OUTPUT(output,
"-- Rank: %u\n", curr_instance.dag.rank);
270 SHELL_OUTPUT(output,
"-- Lowest rank: %u (%u)\n", curr_instance.dag.lowest_rank, curr_instance.max_rankinc);
271 SHELL_OUTPUT(output,
"-- DTSN out: %u\n", curr_instance.dtsn_out);
272 SHELL_OUTPUT(output,
"-- DAO sequence: last sent %u, last acked %u\n",
273 curr_instance.dag.dao_last_seqno, curr_instance.dag.dao_last_acked_seqno);
274 SHELL_OUTPUT(output,
"-- Trickle timer: current %u, min %u, max %u, redundancy %u\n",
275 curr_instance.dag.dio_intcurrent, curr_instance.dio_intmin,
276 curr_instance.dio_intmin + curr_instance.dio_intdoubl, curr_instance.dio_redundancy);
284 PT_THREAD(cmd_rpl_refresh_routes(
struct pt *pt, shell_output_func output,
char *args))
288 SHELL_OUTPUT(output,
"Triggering routes refresh\n");
296 shell_output_log_levels(shell_output_func output)
299 SHELL_OUTPUT(output,
"Log levels:\n");
300 while(all_modules[i].name != NULL) {
301 SHELL_OUTPUT(output,
"-- %-10s: %u (%s)\n",
303 *all_modules[i].curr_log_level,
310 PT_THREAD(cmd_log(
struct pt *pt, shell_output_func output,
char *args))
312 static int prev_level;
320 SHELL_ARGS_INIT(args, next_args);
323 SHELL_ARGS_NEXT(args, next_args);
326 if(module == NULL || (strcmp(
"all", module) && prev_level == -1)) {
327 SHELL_OUTPUT(output,
"Invalid first argument: %s\n", module)
328 shell_output_log_levels(output);
333 SHELL_ARGS_NEXT(args, next_args);
337 level = (int)strtol(args, &ptr, 10);
339 if((level == 0 && args == ptr)
340 || level < LOG_LEVEL_NONE || level > LOG_LEVEL_DBG) {
341 SHELL_OUTPUT(output,
"Invalid second argument: %s\n", args);
346 if(level != prev_level) {
348 #if MAC_CONF_WITH_TSCH && TSCH_LOG_PER_SLOT 349 if(!strcmp(module,
"mac") || !strcmp(module,
"all")) {
350 if(level >= LOG_LEVEL_DBG) {
352 SHELL_OUTPUT(output,
"TSCH logging started\n");
355 SHELL_OUTPUT(output,
"TSCH logging stopped\n");
361 shell_output_log_levels(output);
367 PT_THREAD(cmd_help(
struct pt *pt, shell_output_func output,
char *args))
369 struct shell_command_set_t *
set;
370 const struct shell_command_t *cmd;
373 SHELL_OUTPUT(output,
"Available commands:\n");
376 for(cmd = set->commands; cmd->name != NULL; ++cmd) {
377 SHELL_OUTPUT(output,
"%s\n", cmd->help);
383 #if UIP_CONF_IPV6_RPL 386 PT_THREAD(cmd_rpl_set_root(
struct pt *pt, shell_output_func output,
char *args))
389 static uip_ipaddr_t prefix;
394 SHELL_ARGS_INIT(args, next_args);
397 SHELL_ARGS_NEXT(args, next_args);
399 if(!strcmp(args,
"1")) {
401 }
else if(!strcmp(args,
"0")) {
404 SHELL_OUTPUT(output,
"Invalid argument: %s\n", args);
409 SHELL_ARGS_NEXT(args, next_args);
412 SHELL_OUTPUT(output,
"Invalid Prefix: %s\n", args);
417 uip_ip6addr_copy(&prefix, default_prefix);
422 SHELL_OUTPUT(output,
"Setting as DAG root with prefix ");
424 SHELL_OUTPUT(output,
"/64\n");
428 SHELL_OUTPUT(output,
"Node is already a DAG root\n");
432 SHELL_OUTPUT(output,
"Setting as non-root node: leaving DAG\n");
435 SHELL_OUTPUT(output,
"Node is not a DAG root\n");
443 PT_THREAD(cmd_rpl_global_repair(
struct pt *pt, shell_output_func output,
char *args))
447 SHELL_OUTPUT(output,
"Triggering routing global repair\n");
454 PT_THREAD(cmd_rpl_local_repair(
struct pt *pt, shell_output_func output,
char *args))
458 SHELL_OUTPUT(output,
"Triggering routing local repair\n");
466 PT_THREAD(cmd_macaddr(
struct pt *pt, shell_output_func output,
char *args))
470 SHELL_OUTPUT(output,
"Node MAC address: ");
472 SHELL_OUTPUT(output,
"\n");
476 #if NETSTACK_CONF_WITH_IPV6 479 PT_THREAD(cmd_ipaddr(
struct pt *pt, shell_output_func output,
char *args))
486 SHELL_OUTPUT(output,
"Node IPv6 addresses:\n");
487 for(i = 0; i < UIP_DS6_ADDR_NB; i++) {
491 SHELL_OUTPUT(output,
"-- ");
493 SHELL_OUTPUT(output,
"\n");
501 PT_THREAD(cmd_ip_neighbors(
struct pt *pt, shell_output_func output,
char *args))
509 SHELL_OUTPUT(output,
"Node IPv6 neighbors: none\n");
513 SHELL_OUTPUT(output,
"Node IPv6 neighbors:\n");
515 SHELL_OUTPUT(output,
"-- ");
517 SHELL_OUTPUT(output,
" <-> ");
519 SHELL_OUTPUT(output,
", router %u, state %s ",
520 nbr->isrouter, ds6_nbr_state_to_str(nbr->state));
521 SHELL_OUTPUT(output,
"\n");
529 #if MAC_CONF_WITH_TSCH 532 PT_THREAD(cmd_tsch_set_coordinator(
struct pt *pt, shell_output_func output,
char *args))
535 static int is_secured;
540 SHELL_ARGS_INIT(args, next_args);
543 SHELL_ARGS_NEXT(args, next_args);
545 if(!strcmp(args,
"1")) {
547 }
else if(!strcmp(args,
"0")) {
550 SHELL_OUTPUT(output,
"Invalid first argument: %s\n", args);
555 SHELL_ARGS_NEXT(args, next_args);
557 if(!strcmp(args,
"1")) {
558 #if LLSEC802154_ENABLED 561 SHELL_OUTPUT(output,
"Security is not compiled in.\n");
564 }
else if(!strcmp(args,
"0")) {
567 SHELL_OUTPUT(output,
"Invalid second argument: %s\n", args);
574 SHELL_OUTPUT(output,
"Setting as TSCH %s (%s)\n",
575 is_on ?
"coordinator" :
"non-coordinator", is_secured ?
"secured" :
"non-secured");
584 PT_THREAD(cmd_tsch_status(
struct pt *pt, shell_output_func output,
char *args))
588 SHELL_OUTPUT(output,
"TSCH status:\n");
590 SHELL_OUTPUT(output,
"-- Is coordinator: %u\n", tsch_is_coordinator);
591 SHELL_OUTPUT(output,
"-- Is associated: %u\n", tsch_is_associated);
592 if(tsch_is_associated) {
594 SHELL_OUTPUT(output,
"-- PAN ID: 0x%x\n", frame802154_get_pan_id());
595 SHELL_OUTPUT(output,
"-- Is PAN secured: %u\n", tsch_is_pan_secured);
596 SHELL_OUTPUT(output,
"-- Join priority: %u\n", tsch_join_priority);
597 SHELL_OUTPUT(output,
"-- Time source: ");
600 SHELL_OUTPUT(output,
"\n");
602 SHELL_OUTPUT(output,
"none\n");
604 SHELL_OUTPUT(output,
"-- Last synchronized: %lu seconds ago\n",
606 SHELL_OUTPUT(output,
"-- Drift w.r.t. coordinator: %ld ppm\n",
608 SHELL_OUTPUT(output,
"-- Network uptime: %lu seconds\n",
615 #if NETSTACK_CONF_WITH_IPV6 618 PT_THREAD(cmd_routes(
struct pt *pt, shell_output_func output,
char *args))
625 SHELL_OUTPUT(output,
"Default route:\n");
626 default_route = uip_ds6_defrt_lookup(uip_ds6_defrt_choose());
627 if(default_route != NULL) {
628 SHELL_OUTPUT(output,
"-- ");
630 if(default_route->lifetime.interval != 0) {
631 SHELL_OUTPUT(output,
" (lifetime: %lu seconds)\n", (
unsigned long)default_route->lifetime.interval);
633 SHELL_OUTPUT(output,
" (lifetime: infinite)\n");
636 SHELL_OUTPUT(output,
"-- None\n");
639 #if UIP_CONF_IPV6_RPL 645 while(link != NULL) {
648 SHELL_OUTPUT(output,
"-- %s\n", buf);
652 SHELL_OUTPUT(output,
"No routing links\n");
656 #if (UIP_MAX_ROUTES != 0) 657 if(uip_ds6_route_num_routes() > 0) {
660 SHELL_OUTPUT(output,
"Routing entries (%u in total):\n", uip_ds6_route_num_routes());
661 route = uip_ds6_route_head();
662 while(route != NULL) {
663 SHELL_OUTPUT(output,
"-- ");
665 SHELL_OUTPUT(output,
" via ");
667 if((
unsigned long)route->state.lifetime != 0xFFFFFFFF) {
668 SHELL_OUTPUT(output,
" (lifetime: %lu seconds)\n", (
unsigned long)route->state.lifetime);
670 SHELL_OUTPUT(output,
" (lifetime: infinite)\n");
672 route = uip_ds6_route_next(route);
675 SHELL_OUTPUT(output,
"No routing entries\n");
684 PT_THREAD(cmd_reboot(
struct pt *pt, shell_output_func output,
char *args))
687 SHELL_OUTPUT(output,
"rebooting\n");
691 #if MAC_CONF_WITH_TSCH 694 PT_THREAD(cmd_tsch_schedule(
struct pt *pt, shell_output_func output,
char *args))
707 SHELL_OUTPUT(output,
"TSCH schedule: no slotframe\n");
709 SHELL_OUTPUT(output,
"TSCH schedule:\n");
713 SHELL_OUTPUT(output,
"-- Slotframe: handle %u, size %u, links:\n", sf->handle, sf->size.val);
716 SHELL_OUTPUT(output,
"---- Options %02x, type %u, timeslot %u, channel offset %u, address ",
717 l->link_options, l->link_type, l->timeslot, l->channel_offset);
719 SHELL_OUTPUT(output,
"\n");
732 shell_commands_set_6top_sub_cmd(shell_command_6top_sub_cmd_t sub_cmd)
734 sixtop_sub_cmd = sub_cmd;
738 PT_THREAD(cmd_6top(
struct pt *pt, shell_output_func output,
char *args))
744 SHELL_ARGS_INIT(args, next_args);
746 if(sixtop_sub_cmd == NULL) {
747 SHELL_OUTPUT(output,
"6top command is unavailable:\n");
749 SHELL_OUTPUT(output,
"6top: ");
750 sixtop_sub_cmd(output, args);
752 SHELL_ARGS_NEXT(args, next_args);
758 #if LLSEC802154_ENABLED 760 PT_THREAD(cmd_llsec_setlv(
struct pt *pt, shell_output_func output,
char *args))
766 SHELL_OUTPUT(output,
"Default LLSEC level is %d\n",
767 uipbuf_get_attr(UIPBUF_ATTR_LLSEC_LEVEL));
771 if(lv < 0 || lv > 7) {
772 SHELL_OUTPUT(output,
"Illegal LLSEC Level %d\n", lv);
775 uipbuf_set_default_attr(UIPBUF_ATTR_LLSEC_LEVEL, lv);
777 SHELL_OUTPUT(output,
"LLSEC default level set %d\n", lv);
785 PT_THREAD(cmd_llsec_setkey(
struct pt *pt, shell_output_func output,
char *args))
791 SHELL_ARGS_INIT(args, next_args);
794 SHELL_OUTPUT(output,
"Provide an index and a 16-char string for the key\n");
798 SHELL_ARGS_NEXT(args, next_args);
801 SHELL_OUTPUT(output,
"Illegal LLSEC Key index %d\n", key);
804 #if MAC_CONF_WITH_CSMA 806 SHELL_ARGS_NEXT(args, next_args);
808 SHELL_OUTPUT(output,
"Provide both an index and a key\n");
809 }
else if(strlen(args) == 16) {
810 csma_security_set_key(key, (
const uint8_t *) args);
811 SHELL_OUTPUT(output,
"Set key for index %d\n", key);
813 SHELL_OUTPUT(output,
"Wrong length of key: '%s' (%d)\n", args, strlen(args));
816 SHELL_OUTPUT(output,
"Set key not supported.\n");
829 list_add(shell_command_sets, &builtin_shell_command_set);
830 #if NETSTACK_CONF_WITH_IPV6 838 shell_command_set_register(
struct shell_command_set_t *
set)
844 shell_command_set_deregister(
struct shell_command_set_t *
set)
853 const struct shell_command_t *
854 shell_command_lookup(
const char *name)
856 struct shell_command_set_t *
set;
857 const struct shell_command_t *cmd;
862 for(cmd = set->commands; cmd->name != NULL; ++cmd) {
863 if(!strcmp(cmd->name, name)) {
871 const struct shell_command_t builtin_shell_commands[] = {
872 {
"help", cmd_help,
"'> help': Shows this help" },
873 {
"reboot", cmd_reboot,
"'> reboot': Reboot the board by watchdog_reboot()" },
874 {
"log", cmd_log,
"'> log module level': Sets log level (0--4) for a given module (or \"all\"). For module \"mac\", level 4 also enables per-slot logging." },
875 {
"mac-addr", cmd_macaddr,
"'> mac-addr': Shows the node's MAC address" },
876 #if NETSTACK_CONF_WITH_IPV6 877 {
"ip-addr", cmd_ipaddr,
"'> ip-addr': Shows all IPv6 addresses" },
878 {
"ip-nbr", cmd_ip_neighbors,
"'> ip-nbr': Shows all IPv6 neighbors" },
879 {
"ping", cmd_ping,
"'> ping addr': Pings the IPv6 address 'addr'" },
880 {
"routes", cmd_routes,
"'> routes': Shows the route entries" },
882 #if UIP_CONF_IPV6_RPL 883 {
"rpl-set-root", cmd_rpl_set_root,
"'> rpl-set-root 0/1 [prefix]': Sets node as root (1) or not (0). A /64 prefix can be optionally specified." },
884 {
"rpl-local-repair", cmd_rpl_local_repair,
"'> rpl-local-repair': Triggers a RPL local repair" },
885 #if ROUTING_CONF_RPL_LITE 886 {
"rpl-refresh-routes", cmd_rpl_refresh_routes,
"'> rpl-refresh-routes': Refreshes all routes through a DTSN increment" },
887 {
"rpl-status", cmd_rpl_status,
"'> rpl-status': Shows a summary of the current RPL state" },
888 {
"rpl-nbr", cmd_rpl_nbr,
"'> rpl-nbr': Shows the RPL neighbor table" },
890 {
"rpl-global-repair", cmd_rpl_global_repair,
"'> rpl-global-repair': Triggers a RPL global repair" },
892 #if MAC_CONF_WITH_TSCH 893 {
"tsch-set-coordinator", cmd_tsch_set_coordinator,
"'> tsch-set-coordinator 0/1 [0/1]': Sets node as coordinator (1) or not (0). Second, optional parameter: enable (1) or disable (0) security." },
894 {
"tsch-schedule", cmd_tsch_schedule,
"'> tsch-schedule': Shows the current TSCH schedule" },
895 {
"tsch-status", cmd_tsch_status,
"'> tsch-status': Shows a summary of the current TSCH state" },
898 {
"6top", cmd_6top,
"'> 6top help': Shows 6top command usage" },
900 #if LLSEC802154_ENABLED 901 {
"llsec-set-level", cmd_llsec_setlv,
"'> llsec-set-level <lv>': Set the level of link layer security (show if no lv argument)"},
902 {
"llsec-set-key", cmd_llsec_setkey,
"'> llsec-set-key <id> <key>': Set the key of link layer security"},
904 { NULL, NULL, NULL },
907 static struct shell_command_set_t builtin_shell_command_set = {
909 .commands = builtin_shell_commands,
An entry in the default router list.
Header file for ICMPv6 message and error handing (RFC 4443)
Main header file for the Contiki shell
uip_ipaddr_t * rpl_neighbor_get_ipaddr(rpl_nbr_t *nbr)
Returns a neighbor's (link-local) IPv6 address.
void shell_commands_init(void)
Initializes Shell-commands module.
static uip_ds6_nbr_t * nbr
Pointer to llao option in uip_buf.
struct tsch_slotframe * tsch_schedule_slotframe_next(struct tsch_slotframe *sf)
Access the next item in the list of slotframes.
int uip_sr_num_nodes(void)
Tells how many nodes are currently stored in the graph.
void list_push(list_t list, void *item)
Add an item to the start of the list.
void shell_output_lladdr(shell_output_func output, const linkaddr_t *lladdr)
Prints a link-layer address.
The 802.15.4 standard CSMA protocol (nonbeacon-enabled)
uip_ds6_nbr_t * uip_ds6_nbr_head(void)
Get the first neighbor cache in nbr_table.
void tsch_log_init(void)
Initialize log module.
watchdog_reboot()
Keeps control until the WDT throws a reset signal.
bool list_contains(list_t list, void *item)
Check if the list contains an item.
TSCH neighbor information.
802.15.4e slotframe (contains links)
Main header file for the Contiki shell
#define PT_BEGIN(pt)
Declare the start of a protothread inside the C function implementing the protothread.
struct tsch_neighbor * tsch_queue_get_time_source(void)
Get the TSCH time source (we currently assume there is only one)
Common functionality of 802.15.4-compliant llsec_drivers.
#define PT_WAIT_UNTIL(pt, condition)
Block and wait until condition is true.
#define RPL_LIFETIME(lifetime)
Compute lifetime, accounting for the lifetime unit.
#define ICMP6_ECHO_REQUEST
Echo request.
int(* root_start)(void)
Set the node as root and start a network.
int rpl_neighbor_count(void)
Returns the number of nodes in the RPL neighbor table.
static uint8_t output(const linkaddr_t *localdest)
Take an IP packet and format it to be sent on an 802.15.4 network using 6lowpan.
void(* global_repair)(const char *str)
Triggers a global topology repair.
Header file for IPv6-related data structures.
void tsch_log_stop(void)
Stop logging module.
void(* root_set_prefix)(uip_ipaddr_t *prefix, uip_ipaddr_t *iid)
Set the prefix, for nodes that will operate as root.
linkaddr_t linkaddr_node_addr
The link-layer address of the node.
uip_sr_node_t * uip_sr_node_next(uip_sr_node_t *item)
Returns the next element of the non-storing node list.
#define PROCESS_CURRENT()
Get a pointer to the currently running process.
An entry in the routing table.
void log_set_level(const char *module, int level)
Sets a log level at run-time.
#define CLOCK_SECOND
A second, measured in system clock time.
Header file for the IP address manipulation library.
void uip_icmp6_echo_reply_callback_add(struct uip_icmp6_echo_reply_notification *n, uip_icmp6_echo_reply_callback_t c)
Add a callback function for ping replies.
const uip_ip6addr_t * uip_ds6_default_prefix()
Retrieve the Default IPv6 prefix.
#define PT_END(pt)
Declare the end of a protothread.
Linked list manipulation routines.
int(* node_is_root)(void)
Tells whether the node is a network root or not.
void process_poll(struct process *p)
Request a process to be polled.
const uip_ipaddr_t * uip_ds6_nbr_get_ipaddr(const uip_ds6_nbr_t *nbr)
Get an IPv6 address of a neighbor cache.
void * list_head(list_t list)
Get a pointer to the first element of a list.
uip_sr_node_t * uip_sr_node_head(void)
Returns the head of the non-storing node list.
rpl_dag_state
RPL DAG states.
Routing driver header file
All information related to a RPL neighbor.
Main API declarations for TSCH.
clock_time_t clock_time(void)
Get the current clock time.
int etimer_expired(struct etimer *et)
Check if an event timer has expired.
int tsch_is_locked(void)
Checks if the TSCH lock is set.
struct tsch_slotframe * tsch_schedule_slotframe_head(void)
Access the first item in the list of slotframes.
long int tsch_adaptive_timesync_get_drift_ppm(void)
Gives the estimated clock drift w.r.t.
#define PT_EXIT(pt)
Exit the protothread.
#define ADDR_TENTATIVE
Possible states for the an address (RFC 4862)
#define PT_THREAD(name_args)
Declaration of a protothread.
#define NBR_INCOMPLETE
Possible states for the nbr cache entries.
void(* leave_network)(void)
Leave the network the node is part of.
uint64_t tsch_get_network_uptime_ticks(void)
Get the time, in clock ticks, since the TSCH network was started.
void list_add(list_t list, void *item)
Add an item at the end of a list.
void list_init(list_t list)
Initialize a list.
int uip_sr_link_snprint(char *buf, int buflen, uip_sr_node_t *link)
Print a textual description of a source routing link.
Header file for the uIP TCP/IP stack.
const char * log_level_to_str(int level)
Returns a textual description of a log level.
int log_get_level(const char *module)
Returns the current log level.
#define LIST(name)
Declare a linked list.
uip_ds6_netif_t uip_ds6_if
The single interface.
void rpl_refresh_routes(const char *str)
Triggers a route fresh via DTSN increment.
uip_ds6_nbr_t * uip_ds6_nbr_next(uip_ds6_nbr_t *nbr)
Get the next neighbor cache of a specified one.
void(* local_repair)(const char *str)
Triggers a RPL local topology repair.
void tsch_set_pan_secured(int enable)
Enable/disable security.
An IEEE 802.15.4-2015 TSCH link (also called cell or slot)
const uip_lladdr_t * uip_ds6_nbr_get_ll(const uip_ds6_nbr_t *nbr)
Get the link-layer address associated with a specified nbr cache.
void uip_icmp6_send(const uip_ipaddr_t *dest, int type, int code, int payload_len)
Send an icmpv6 message.
#define uiplib_ipaddrconv
Convert a textual representation of an IP address to a numerical representation.
Header file for the logging system
void etimer_set(struct etimer *et, clock_time_t interval)
Set an event timer.
void list_remove(list_t list, void *item)
Remove a specific element from a list.
void shell_output_6addr(shell_output_func output, const uip_ipaddr_t *ipaddr)
Prints an IPv6 address.
void * list_item_next(void *item)
Get the next item following this item.
int rpl_neighbor_snprint(char *buf, int buflen, rpl_nbr_t *nbr)
Print a textual description of RPL neighbor into a string.
A node in a source routing graph, stored at the root and representing all child-parent relationship...
void tsch_set_coordinator(int enable)
Set the node as PAN coordinator.
The default nbr_table entry (when UIP_DS6_NBR_MULTI_IPV6_ADDRS is disabled), that implements nbr cach...