A simple but substantial change: uIP used the htons()/HTONS() macro
functions for converting between host and network byte order. These names are the de facto standard names for this functionality because of the original BSD TCP/IP implementation. But they cause problems for uIP/Contiki: some platforms define these names themselves (Mac OS, most notably), causing compilation problems for Contiki on those platforms. This commit changes all htons to uip_htons instead. Same goes for htonl, ntohs, and ntohl. All-caps versions as well.
This commit is contained in:
parent
5a46c629de
commit
5585d72c86
115 changed files with 675 additions and 675 deletions
|
@ -30,7 +30,7 @@
|
|||
*
|
||||
* Author: Oliver Schmidt <ol.sc@web.de>
|
||||
*
|
||||
* $Id: wpcap.c,v 1.18 2009/08/13 18:41:00 dak664 Exp $
|
||||
* $Id: wpcap.c,v 1.19 2010/10/19 18:29:04 adamdunkels Exp $
|
||||
*/
|
||||
|
||||
#define WIN32_LEAN_AND_MEAN
|
||||
|
@ -55,8 +55,8 @@
|
|||
#endif
|
||||
|
||||
/* Avoid 'conflicting types' errors. */
|
||||
#define htonl
|
||||
#define htons
|
||||
#define uip_htonl
|
||||
#define uip_htons
|
||||
|
||||
#include "contiki-net.h"
|
||||
#include "sys/log.h"
|
||||
|
@ -317,7 +317,7 @@ wpcap_send(uip_lladdr_t *lladdr)
|
|||
PRINTF("Src= %02x %02x %02x %02x %02x %02x",(&BUF->src)->addr[0],(&BUF->src)->addr[1],(&BUF->src)->addr[2],(&BUF->src)->addr[3],(&BUF->src)->addr[4],(&BUF->src)->addr[5]);
|
||||
PRINTF(" Dst= %02x %02x %02x %02x %02x %02x",(&BUF->dest)->addr[0],(&BUF->dest)->addr[1],(&BUF->dest)->addr[2],(&BUF->dest)->addr[3],(&BUF->dest)->addr[4],(&BUF->dest)->addr[5]);
|
||||
PRINTF(" Type=%04x\n",BUF->type);
|
||||
BUF->type = HTONS(UIP_ETHTYPE_IPV6);
|
||||
BUF->type = UIP_HTONS(UIP_ETHTYPE_IPV6);
|
||||
uip_len += sizeof(struct uip_eth_hdr);
|
||||
if(pcap_sendpacket(pcap, uip_buf, uip_len) == -1) {
|
||||
error_exit("error on send\n");
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue