42#include "contiki-net.h"
45#include "rpl-border-router.h"
53#define LOG_MODULE "BR"
54#define LOG_LEVEL LOG_LEVEL_INFO
59extern long slip_received;
61static uint8_t mac_set;
63extern int contiki_argc;
64extern char **contiki_argv;
65extern const char *slip_config_ipaddr;
67CMD_HANDLERS(border_router_cmd_handler);
69PROCESS(border_router_process,
"Border router process");
75 write_to_slip((uint8_t *)
"?M", 2);
79border_router_set_mac(
const uint8_t *data)
88 NETSTACK_ROUTING.
init();
95border_router_print_stat()
97 printf(
"bytes received over SLIP: %ld\n", slip_received);
98 printf(
"bytes sent over SLIP: %ld\n", slip_sent);
112 LOG_INFO(
"RPL-Border router started\n");
114 slip_config_handle_arguments(contiki_argc, contiki_argv);
125 if(slip_config_ipaddr != NULL) {
129 LOG_INFO(
"Setting prefix ");
130 LOG_INFO_6ADDR(&prefix);
132 set_prefix_64(&prefix);
134 LOG_ERR(
"Parse error: %s\n", slip_config_ipaddr);
139 print_local_addresses();
Sets up some commands for the border router.
Border router header file.
#define CLOCK_SECOND
A second, measured in system clock time.
static bool etimer_expired(struct etimer *et)
Check if an event timer has expired.
void etimer_set(struct etimer *et, clock_time_t interval)
Set an event timer.
static void linkaddr_set_node_addr(linkaddr_t *addr)
Set the address of the current node.
#define PROCESS(name, strname)
Declare a process.
#define PROCESS_PAUSE()
Yield the process for a short while.
#define PROCESS_BEGIN()
Define the beginning of a process.
#define PROCESS_WAIT_EVENT_UNTIL(c)
Wait for an event to be posted to the process, with an extra condition.
#define PROCESS_END()
Define the end of a process.
void process_start(struct process *p, process_data_t data)
Start a process.
#define PROCESS_CONTEXT_BEGIN(p)
Switch context to another process.
#define PROCESS_THREAD(name, ev, data)
Define the body of a process.
#define PROCESS_CONTEXT_END(p)
End a context switch.
#define uiplib_ipaddrconv
Convert a textual representation of an IP address to a numerical representation.
uip_lladdr_t uip_lladdr
Host L2 address.
void uip_ds6_init(void)
Initialize data structures.
Header file for the logging system.
Routing driver header file.
void(* init)(void)
Initialize the routing protocol.