wpcap update for uIPv6

This commit is contained in:
dak664 2009-08-08 19:51:25 +00:00
parent d5047f43c1
commit 72d5442e05
3 changed files with 69 additions and 16 deletions

View file

@ -28,7 +28,7 @@
*
* This file is part of the Contiki operating system.
*
* @(#)$Id: wpcap-drv.c,v 1.4 2008/06/23 19:53:16 adamdunkels Exp $
* @(#)$Id: wpcap-drv.c,v 1.5 2009/08/08 19:51:25 dak664 Exp $
*/
#include "contiki-net.h"
@ -43,14 +43,16 @@
PROCESS(wpcap_process, "WinPcap driver");
/*---------------------------------------------------------------------------*/
#if !UIP_CONF_IPV6
u8_t
wpcap_output(void)
{
uip_arp_out();
wpcap_send();
return 0;
uip_arp_out();
wpcap_send();
return 0;
}
#endif
/*---------------------------------------------------------------------------*/
static void
pollhandler(void)
@ -61,7 +63,7 @@ pollhandler(void)
if(uip_len > 0) {
#if UIP_CONF_IPV6
if(BUF->type == htons(UIP_ETHTYPE_IPV6)) {
uip_neighbor_add(&IPBUF->srcipaddr, &BUF->src);
// uip_neighbor_add(&IPBUF->srcipaddr, &BUF->src);
tcpip_input();
} else
#endif /* UIP_CONF_IPV6 */
@ -69,13 +71,17 @@ pollhandler(void)
uip_len -= sizeof(struct uip_eth_hdr);
tcpip_input();
} else if(BUF->type == htons(UIP_ETHTYPE_ARP)) {
uip_arp_arpin();
#if !UIP_CONF_IPV6 //math
uip_arp_arpin();
/* 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. */
if(uip_len > 0) {
wpcap_send();
}
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;
}
}
}
@ -88,7 +94,11 @@ PROCESS_THREAD(wpcap_process, ev, data)
wpcap_init();
#if !UIP_CONF_IPV6
tcpip_set_outputfunc(wpcap_output);
#else
tcpip_set_outputfunc(wpcap_send);
#endif
process_poll(&wpcap_process);