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");
81 #if !FALLBACK_HAS_ETHERNET_HEADERS //native br is fallback only
87 if(BUF->type ==
uip_htons(UIP_ETHTYPE_IPV6)) {
92 if(BUF->type ==
uip_htons(UIP_ETHTYPE_IP)) {
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)) {
129 if(BUF->type ==
uip_htons(UIP_ETHTYPE_IPV6)) {
134 if(BUF->type ==
uip_htons(UIP_ETHTYPE_IP)) {
138 }
else if(BUF->type ==
uip_htons(UIP_ETHTYPE_ARP)) {
165 tcpip_set_outputfunc(wpcap_output);
167 #if !FALLBACK_HAS_ETHERNET_HEADERS
168 tcpip_set_outputfunc(wpcap_send);
void uip_arp_out(void)
Prepend Ethernet header to an outbound IP packet and see if we need to send out an ARP request...
uip_len
The length of the packet in the uip_buf buffer.
#define PROCESS_WAIT_UNTIL(c)
Wait for a condition to occur.
void process_poll(struct process *p)
Request a process to be polled.
void tcpip_input(void)
Deliver an incoming packet to the TCP/IP stack.
#define PROCESS_BEGIN()
Define the beginning of a process.
Header file for database of link-local neighbors, used by IPv6 code and to be used by future ...
#define PROCESS_THREAD(name, ev, data)
Define the body of a process.
#define PROCESS_END()
Define the end of a process.
#define UIP_LLH_LEN
The link level header length.
CCIF uint16_t uip_htons(uint16_t val)
Convert a 16-bit quantity from host byte order to network byte order.
#define PROCESS_POLLHANDLER(handler)
Specify an action when a process is polled.
#define PROCESS(name, strname)
Declare a process.
void uip_arp_arpin(void)
ARP processing for incoming IP packets.