40 #define UIP_IP_BUF ((struct uip_ip_hdr *)&uip_buf[UIP_LLH_LEN])
42 #define DEBUG DEBUG_NONE
45 static uip_ipaddr_t last_sender;
49 ip64_slip_interface_input(uint8_t *packet, uint16_t len)
59 if(uip_buf[0] ==
'!') {
60 PRINTF(
"Got configuration message of type %c\n", uip_buf[1]);
63 if(uip_buf[1] ==
'P') {
66 memset(&prefix, 0, 16);
67 memcpy(&prefix, &uip_buf[2], 8);
68 PRINTF(
"Setting prefix ");
71 set_prefix_64(&prefix);
74 }
else if(uip_buf[0] ==
'?') {
75 PRINTF(
"Got request message of type %c\n", uip_buf[1]);
76 if(uip_buf[1] ==
'M') {
77 const char *hexchar =
"0123456789abcdef";
81 for(j = 0; j < 8; j++) {
82 uip_buf[2 + j * 2] = hexchar[
uip_lladdr.addr[j] >> 4];
83 uip_buf[3 + j * 2] = hexchar[
uip_lladdr.addr[j] & 15];
99 memcpy(&uip_buf[
UIP_LLH_LEN], ip64_packet_buffer, len);
111 PRINTF(
"ip64-slip-interface: init\n");
114 slip_set_input_callback(input_callback);
122 PRINTF(
"ip64-slip-interface: output source ");
130 if(uip_ipaddr_cmp(&last_sender, &
UIP_IP_BUF->srcipaddr)) {
131 PRINTF(
"ip64-interface: output, not sending bounced message\n");
135 PRINTF(
"ip64-interface: output len %d\n", len);
137 memcpy(&uip_buf[
UIP_LLH_LEN], ip64_packet_buffer, len);
144 const struct uip_fallback_interface ip64_slip_interface = {
uip_len
The length of the packet in the uip_buf buffer.
CCIF uip_lladdr_t uip_lladdr
Host L2 address.
Header file for the uIP TCP/IP stack.
Network interface and stateless autoconfiguration (RFC 4862)
#define NULL
The null pointer.
#define UIP_IP_BUF
Pointer to IP header.
#define UIP_LLH_LEN
The link level header length.
#define uip_ipaddr_copy(dest, src)
Copy an IP address from one place to another.
void process_start(struct process *p, process_data_t data)
Start a process.
A set of debugging macros.