33 #include "contiki-net.h"
35 #include "net/wpcap.h"
37 #include "net/wpcap-drv.h"
40 #define BUF ((struct uip_eth_hdr *)&uip_buf[0])
41 #define IPBUF ((struct uip_tcpip_hdr *)&uip_buf[UIP_LLH_LEN])
60 #ifdef SELECT_CALLBACK
61 #define FALLBACK_HAS_ETHERNET_HEADERS 1
64 PROCESS(wpcap_process,
"WinPcap driver");
67 #if !NETSTACK_CONF_WITH_IPV6
81 #if !FALLBACK_HAS_ETHERNET_HEADERS //native br is fallback only
86 #if NETSTACK_CONF_WITH_IPV6
87 if(BUF->type ==
uip_htons(UIP_ETHTYPE_IPV6)) {
92 if(BUF->type ==
uip_htons(UIP_ETHTYPE_IP)) {
95 #if !NETSTACK_CONF_WITH_IPV6
96 }
else if(BUF->type ==
uip_htons(UIP_ETHTYPE_ARP)) {
110 #ifdef UIP_FALLBACK_INTERFACE
116 #if FALLBACK_HAS_ETHERNET_HEADERS
117 if(BUF->type ==
uip_htons(UIP_ETHTYPE_IPV6)) {
128 #elif NETSTACK_CONF_WITH_IPV6
129 if(BUF->type ==
uip_htons(UIP_ETHTYPE_IPV6)) {
134 if(BUF->type ==
uip_htons(UIP_ETHTYPE_IP)) {
137 #if !NETSTACK_CONF_WITH_IPV6
138 }
else if(BUF->type ==
uip_htons(UIP_ETHTYPE_ARP)) {
164 #if !NETSTACK_CONF_WITH_IPV6
165 tcpip_set_outputfunc(wpcap_output);
167 #if !FALLBACK_HAS_ETHERNET_HEADERS
168 tcpip_set_outputfunc(wpcap_send);
uip_len
The length of the packet in the uip_buf buffer.
void process_poll(struct process *p)
Request a process to be polled.
#define PROCESS_END()
Define the end of a process.
#define PROCESS(name, strname)
Declare a process.
#define UIP_LLH_LEN
The link level header length.
#define PROCESS_THREAD(name, ev, data)
Define the body of a process.
#define uip_buf
Macro to access uip_aligned_buf as an array of bytes.
#define PROCESS_POLLHANDLER(handler)
Specify an action when a process is polled.
static void pollhandler(void)
USB Poll Handler.
void uip_arp_out(void)
Prepend Ethernet header to an outbound IP packet and see if we need to send out an ARP request...
#define PROCESS_WAIT_UNTIL(c)
Wait for a condition to occur.
void uip_arp_arpin(void)
ARP processing for incoming IP packets.
void tcpip_input(void)
Deliver an incoming packet to the TCP/IP stack.
Header file for database of link-local neighbors, used by IPv6 code and to be used by future ...
CCIF uint16_t uip_htons(uint16_t val)
Convert a 16-bit quantity from host byte order to network byte order.
#define PROCESS_BEGIN()
Define the beginning of a process.