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
|
@ -28,7 +28,7 @@
|
|||
*
|
||||
* This file is part of the Contiki operating system.
|
||||
*
|
||||
* @(#)$Id: tcp_loader.c,v 1.3 2006/12/20 13:38:34 bg- Exp $
|
||||
* @(#)$Id: tcp_loader.c,v 1.4 2010/10/19 18:29:03 adamdunkels Exp $
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
|
@ -70,7 +70,7 @@ PT_THREAD(recv_tcpthread(struct pt *pt))
|
|||
goto thread_done;
|
||||
}
|
||||
|
||||
s.len = htons(((struct codeprop_tcphdr *)uip_appdata)->len);
|
||||
s.len = uip_htons(((struct codeprop_tcphdr *)uip_appdata)->len);
|
||||
s.addr = 0;
|
||||
uip_appdata += sizeof(struct codeprop_tcphdr);
|
||||
uip_len -= sizeof(struct codeprop_tcphdr);
|
||||
|
@ -118,11 +118,11 @@ PROCESS_THREAD(tcp_loader_process, ev, data)
|
|||
{
|
||||
PROCESS_BEGIN();
|
||||
|
||||
tcp_listen(HTONS(CODEPROP_DATA_PORT));
|
||||
tcp_listen(UIP_HTONS(CODEPROP_DATA_PORT));
|
||||
|
||||
while(1) {
|
||||
PROCESS_YIELD();
|
||||
if(ev == tcpip_event && uip_conn->lport == HTONS(CODEPROP_DATA_PORT)) {
|
||||
if(ev == tcpip_event && uip_conn->lport == UIP_HTONS(CODEPROP_DATA_PORT)) {
|
||||
if(uip_connected()) { /* Really uip_connecting()!!! */
|
||||
if(data == NULL) {
|
||||
PT_INIT(&s.tcpthread_pt);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue