use htonl/ntohl/ntohs/htons from lwip

on bigger systems, you don't simply write endian.h
This commit is contained in:
chrysn committed 2013-11-17 16:30:10 +01:00
1 parent 6498b01552
commit 6d28c3154e
6 files changed
+2 -25

No files matched your search

+1
View File
@@ -26,6 +26,7 @@
#endif
#include <string.h>
#include <stdint.h>
#ifdef HAVE_NETINET_IN_H
#include <netinet/in.h>
+1 -3
View File
@@ -3,6 +3,7 @@
#include <lwip/opt.h>
#include <lwip/debug.h>
#include <lwip/def.h> /* provide ntohs, htons */
#define WITH_LWIP 1
@@ -13,9 +14,6 @@
* building in */
#define HAVE_STRNLEN 1
/* provide what usually resides in arpa/inet.h: ntohs and htons. maybe it'd be a better way to just have an arpa/inet.h compatibility file in lwip? */
#define HAVE_ENDIAN_H 1
/* FIXME just a quick hack */
#define COAP_TICKS_PER_SECOND 10
-3
View File
@@ -20,9 +20,6 @@
#ifdef HAVE_ARPA_INET_H
#include <arpa/inet.h>
#endif
#ifdef HAVE_ENDIAN_H
#include "endian.h"
#endif
#ifdef HAVE_TIME_H
#include <time.h>
-13
View File
@@ -1,13 +0,0 @@
/* endianness helpers for lwip port */
/* FIXME: i'm sure there is something in lwip we can use */
#include <stdint.h>
/* we're on little endian, ntohs & co swap */
static inline uint16_t ntohs(uint16_t x)
{
return (x << 8) | (x >> 8);
}
#define htons ntohs
-3
View File
@@ -25,9 +25,6 @@
#ifdef HAVE_ARPA_INET_H
#include <arpa/inet.h>
#endif
#ifdef HAVE_ENDIAN_H
#include "endian.h"
#endif
#ifdef WITH_LWIP
#include <lwip/pbuf.h>
-3
View File
@@ -18,9 +18,6 @@
#ifdef HAVE_ARPA_INET_H
#include <arpa/inet.h>
#endif
#ifdef HAVE_ENDIAN_H
#include "endian.h"
#endif
#include "debug.h"
#include "pdu.h"