49#include "net/ipv6/ip64-addr.h"
52#if NETSTACK_CONF_WITH_IPV6
57 char buf[UIPLIB_IPV6_MAX_STR_LEN];
59 SHELL_OUTPUT(output,
"%s", buf);
67 SHELL_OUTPUT(output,
"(NULL LL addr)");
71 for(i = 0; i < LINKADDR_SIZE; i++) {
72 if(i > 0 && i % 2 == 0) {
73 SHELL_OUTPUT(output,
".");
75 SHELL_OUTPUT(output,
"%02x", lladdr->u8[i]);
81output_prompt(shell_output_func output)
83 SHELL_OUTPUT(output,
"#");
85 SHELL_OUTPUT(output,
"> ");
88PT_THREAD(shell_input(
struct pt *pt, shell_output_func output,
const char *cmd))
91 static const struct shell_command_t *cmd_descr = NULL;
103 args = strchr(cmd,
' ');
109 cmd_descr = shell_command_lookup(cmd);
110 if(cmd_descr != NULL && cmd_descr->func != NULL) {
111 static struct pt cmd_pt;
112 PT_SPAWN(pt, &cmd_pt, cmd_descr->func(&cmd_pt, output, args));
114 SHELL_OUTPUT(output,
"Command not found. Type 'help' for a list of commands\n");
118 output_prompt(output);
linkaddr_t linkaddr_node_addr
The link-layer address of the node.
#define PT_BEGIN(pt)
Declare the start of a protothread inside the C function implementing the protothread.
#define PT_THREAD(name_args)
Declaration of a protothread.
#define PT_END(pt)
Declare the end of a protothread.
#define PT_SPAWN(pt, child, thread)
Spawn a child protothread and wait until it exits.
void shell_init(void)
Initializes Shell module.
void shell_output_6addr(shell_output_func output, const uip_ipaddr_t *ipaddr)
Prints an IPv6 address.
void shell_output_lladdr(shell_output_func output, const linkaddr_t *lladdr)
Prints a link-layer address.
void shell_commands_init(void)
Initializes Shell-commands module.
int uiplib_ipaddr_snprint(char *buf, size_t size, const uip_ipaddr_t *addr)
Write at most size - 1 characters of the IP address to the output string.
Main header file for the Contiki shell.
Main header file for the Contiki shell.
static uip_ipaddr_t ipaddr
Pointer to prefix information option in uip_buf.
Header file for the uIP TCP/IP stack.
Header file for the IP address manipulation library.