42 #include "contiki-net.h" 45 #include "rpl-border-router.h" 53 #define LOG_MODULE "BR" 54 #define LOG_LEVEL LOG_LEVEL_INFO 58 extern long slip_sent;
59 extern long slip_received;
61 static uint8_t mac_set;
63 extern int contiki_argc;
64 extern char **contiki_argv;
65 extern const char *slip_config_ipaddr;
67 CMD_HANDLERS(border_router_cmd_handler);
69 PROCESS(border_router_process,
"Border router process");
75 write_to_slip((uint8_t *)
"?M", 2);
79 border_router_set_mac(
const uint8_t *data)
88 NETSTACK_ROUTING.
init();
95 border_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();
uip_lladdr_t uip_lladdr
Host L2 address.
#define PROCESS(name, strname)
Declare a process.
#define PROCESS_CONTEXT_END(p)
End a context switch.
Border router header file
void uip_ds6_init(void)
Initialize data structures.
#define PROCESS_BEGIN()
Define the beginning of a process.
#define PROCESS_END()
Define the end 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_PAUSE()
Yield the process for a short while.
void(* init)(void)
Initialize the routing protocol.
#define CLOCK_SECOND
A second, measured in system clock time.
Routing driver header file
int etimer_expired(struct etimer *et)
Check if an event timer has expired.
Sets up some commands for the border router
#define PROCESS_CONTEXT_BEGIN(p)
Switch context to another process.
PROCESS_THREAD(cc2538_rf_process, ev, data)
Implementation of the cc2538 RF driver process.
#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 process_start(struct process *p, process_data_t data)
Start a process.
void linkaddr_set_node_addr(linkaddr_t *t)
Set the address of the current node.