42#include "contiki-net.h"
45#include "rpl-border-router.h"
58#define LOG_MODULE "BR"
59#define LOG_LEVEL LOG_LEVEL_INFO
65extern long slip_received;
67static bool is_mac_set;
69extern int contiki_argc;
70extern char **contiki_argv;
72CMD_HANDLERS(border_router_cmd_handler);
74PROCESS(border_router_process,
"Border router process");
80 write_to_slip((uint8_t *)
"?M", 2);
84border_router_set_mac(
const uint8_t *data)
98 NETSTACK_ROUTING.
init();
105border_router_print_stat()
107 printf(
"bytes received over SLIP: %ld\n", slip_received);
108 printf(
"bytes sent over SLIP: %ld\n", slip_sent);
124 LOG_INFO(
"RPL-Border router started\n");
126 slip_config_handle_arguments(contiki_argc, contiki_argv);
134 LOG_ERR(
"Failed to initialize NAT64\n");
145 const char *config_ipaddr = tun6_net_get_prefix();
146 if(config_ipaddr != NULL) {
150 LOG_INFO(
"Setting prefix ");
151 LOG_INFO_6ADDR(&prefix);
153 set_prefix_64(&prefix);
155 LOG_ERR(
"Parse error: %s\n", config_ipaddr);
160 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.
bool nat64_platform_init(void)
Initialize the platform layer.
bool nat64_is_enabled(void)
Check whether the NAT64 gateway has been enabled at runtime.
#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.