51#define LOG_MODULE "BR"
52#define LOG_LEVEL LOG_LEVEL_NONE
54extern uint16_t slip_config_basedelay;
56#if CLOCK_SECOND != 1000
57#error The system clock must be ticking in milliseconds
59static struct timer delay_timer;
66static int no_tun_mode;
67#define NO_TUN_PRIO (CONTIKI_VERBOSE_PRIO + 41)
68CONTIKI_OPTION(NO_TUN_PRIO, {
"no-tun", no_argument, &no_tun_mode, 1 }, NULL,
69 "Skip TUN device setup; pair with --nat64 for unprivileged\n"
70 "\t\toperation when only NAT64 traffic needs to be forwarded.\n");
73tun_input_callback(
void)
81 if(slip_config_basedelay) {
82 timer_set(&delay_timer, slip_config_basedelay);
95 LOG_INFO(
"--no-tun: skipping TUN device, non-NAT64 IPv6 packets "
100 if(!tun6_net_init(tun_input_callback)) {
101 err(EXIT_FAILURE,
"failed to open tun device %s", tun6_net_get_tun_name());
121 LOG_DBG(
"--no-tun: dropping %u-byte non-NAT64 packet\n",
uip_len);
129const struct uip_fallback_interface rpl_interface = {
Border router header file.
#define CONTIKI_OPTION(prio,...)
Add a command line option when the compilation unit is present.
bool nat64_is_ip64_addr(const uip_ip6addr_t *addr)
Check whether an IPv6 address embeds an IPv4 address via the NAT64 prefix.
int nat64_output(const uint8_t *pkt, uint16_t len)
Process an outgoing IPv6 packet destined for an IPv4 host.
void tcpip_input(void)
Deliver an incoming packet to the TCP/IP stack.
void timer_set(struct timer *t, clock_time_t interval)
Set a timer.
bool timer_expired(struct timer *t)
Check if a timer has expired.
#define UIP_IP_BUF
Direct access to IPv6 header.
#define uip_buf
Macro to access uip_aligned_buf as an array of bytes.
uint16_t uip_len
The length of the packet in the uip_buf buffer.
Header file for the logging system.