ipv6 fixes and formatting
This commit is contained in:
parent
c154985d7e
commit
d37115f2c0
2 changed files with 95 additions and 75 deletions
|
@ -28,7 +28,7 @@
|
|||
*
|
||||
* This file is part of the Contiki operating system.
|
||||
*
|
||||
* @(#)$Id: wpcap-drv.c,v 1.5 2009/08/08 19:51:25 dak664 Exp $
|
||||
* @(#)$Id: wpcap-drv.c,v 1.6 2009/08/11 16:06:17 dak664 Exp $
|
||||
*/
|
||||
|
||||
#include "contiki-net.h"
|
||||
|
@ -52,7 +52,7 @@ wpcap_output(void)
|
|||
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
#endif /* !UIP_CONF_IPV6 */
|
||||
/*---------------------------------------------------------------------------*/
|
||||
static void
|
||||
pollhandler(void)
|
||||
|
@ -63,25 +63,24 @@ pollhandler(void)
|
|||
if(uip_len > 0) {
|
||||
#if UIP_CONF_IPV6
|
||||
if(BUF->type == htons(UIP_ETHTYPE_IPV6)) {
|
||||
// uip_neighbor_add(&IPBUF->srcipaddr, &BUF->src);
|
||||
tcpip_input();
|
||||
} else
|
||||
#endif /* UIP_CONF_IPV6 */
|
||||
if(BUF->type == htons(UIP_ETHTYPE_IP)) {
|
||||
uip_len -= sizeof(struct uip_eth_hdr);
|
||||
tcpip_input();
|
||||
#if !UIP_CONF_IPV6
|
||||
} else if(BUF->type == htons(UIP_ETHTYPE_ARP)) {
|
||||
#if !UIP_CONF_IPV6 //math
|
||||
uip_arp_arpin();
|
||||
uip_arp_arpin(); //math
|
||||
/* If the above function invocation resulted in data that
|
||||
should be sent out on the network, the global variable
|
||||
uip_len is set to a value > 0. */
|
||||
should be sent out on the network, the global variable
|
||||
uip_len is set to a value > 0. */
|
||||
if(uip_len > 0) {
|
||||
wpcap_send();
|
||||
}
|
||||
#endif
|
||||
// } else {
|
||||
// uip_len = 0;
|
||||
#endif /* !UIP_CONF_IPV6 */
|
||||
} else {
|
||||
uip_len = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -98,7 +97,7 @@ PROCESS_THREAD(wpcap_process, ev, data)
|
|||
tcpip_set_outputfunc(wpcap_output);
|
||||
#else
|
||||
tcpip_set_outputfunc(wpcap_send);
|
||||
#endif
|
||||
#endif /* !UIP_CONF_IPV6 */
|
||||
|
||||
process_poll(&wpcap_process);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue