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]);
81 output_prompt(shell_output_func
output)
83 SHELL_OUTPUT(output,
"#");
85 SHELL_OUTPUT(output,
"> ");
88 PT_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) {
111 static struct pt cmd_pt;
114 SHELL_OUTPUT(
output,
"Command not found. Type 'help' for a list of commands\n");
static uip_ipaddr_t ipaddr
Pointer to prefix information option in uip_buf.
Main header file for the Contiki shell
void shell_commands_init(void)
Initializes Shell-commands module.
void shell_output_lladdr(shell_output_func output, const linkaddr_t *lladdr)
Prints a link-layer address.
Main header file for the Contiki shell
#define PT_BEGIN(pt)
Declare the start of a protothread inside the C function implementing the protothread.
#define PT_SPAWN(pt, child, thread)
Spawn a child protothread and wait until it exits.
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.
linkaddr_t linkaddr_node_addr
The link-layer address of the node.
Header file for the IP address manipulation library.
#define PT_END(pt)
Declare the end of a protothread.
#define PT_THREAD(name_args)
Declaration of a protothread.
void shell_init(void)
Initializes Shell module.
Header file for the uIP TCP/IP stack.
void shell_output_6addr(shell_output_func output, const uip_ipaddr_t *ipaddr)
Prints an IPv6 address.
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.