36 #include "ip64/ip64.h" 37 #include "ip64/ip64-arp.h" 38 #include "ip64/ip64-eth-interface.h" 42 #define UIP_IP_BUF ((struct uip_ip_hdr *)&uip_buf[UIP_LLH_LEN]) 44 #define DEBUG DEBUG_NONE 49 ip64_eth_interface_input(uint8_t *packet, uint16_t len)
54 if(ethhdr->type ==
UIP_HTONS(IP64_ETH_TYPE_ARP)) {
55 len = ip64_arp_arp_input(packet, len);
58 IP64_ETH_DRIVER.output(packet, len);
60 }
else if(ethhdr->type ==
UIP_HTONS(IP64_ETH_TYPE_IP) &&
62 printf(
"-------------->\n");
67 printf(
"ip64_interface_process: converted %d bytes\n",
uip_len);
69 printf(
"ip64-interface: input source ");
71 PRINTF(
" destination ");
84 printf(
"ip64-eth-interface: init\n");
92 printf(
"ip64-interface: output source ");
94 PRINTF(
" destination ");
98 printf(
"<--------------\n");
102 printf(
"ip64-interface: output len %d\n", len);
104 if(ip64_arp_check_cache(&ip64_packet_buffer[
sizeof(
struct ip64_eth_hdr)])) {
105 printf(
"Create header\n");
106 ret = ip64_arp_create_ethhdr(ip64_packet_buffer,
110 IP64_ETH_DRIVER.output(ip64_packet_buffer, len);
113 printf(
"Create request\n");
114 len = ip64_arp_create_arp_request(ip64_packet_buffer,
116 return IP64_ETH_DRIVER.output(ip64_packet_buffer, len);
123 const struct uip_fallback_interface ip64_eth_interface = {
#define UIP_IP_BUF
Pointer to IP header.
uint16_t uip_len
The length of the packet in the uip_buf buffer.
A set of debugging macros for the IP stack
static uint8_t output(const linkaddr_t *localdest)
Take an IP packet and format it to be sent on an 802.15.4 network using 6lowpan.
Header file for IPv6-related data structures.
#define UIP_LLH_LEN
The link level header length.
#define uip_buf
Macro to access uip_aligned_buf as an array of bytes.
#define UIP_HTONS(n)
Convert 16-bit quantity from host byte order to network byte order.
Header file for the uIP TCP/IP stack.
void tcpip_input(void)
Deliver an incoming packet to the TCP/IP stack.