summaryrefslogtreecommitdiffstats
path: root/cpukit/libnetworking/rtems/rtems_bsdnet_internal.h
diff options
context:
space:
mode:
authorChristian Mauderer <Christian.Mauderer@embedded-brains.de>2016-06-24 08:52:48 +0200
committerSebastian Huber <sebastian.huber@embedded-brains.de>2016-06-28 13:10:01 +0200
commit4c02385d8fa3110e4208e2cb8cb2d04d630cf85e (patch)
treeb25d3f48b8f34ff627b9d156c9c10e9391a46f3c /cpukit/libnetworking/rtems/rtems_bsdnet_internal.h
parentlibnetworking: Import current <netinet/in.h> (diff)
downloadrtems-4c02385d8fa3110e4208e2cb8cb2d04d630cf85e.tar.bz2
libnetworking: Import current <arpa/inet.h>
Import the <arpa/inet.h> from current FreeBSD. Necessary due to changes in <netinet/in.h>. Remove BSD hack from <arpa/inet.h>. Clean up problems with htonl(). These functions are defined in <arpa/inet.h>. This lead to some problems because they are defined in <rtems/endian.h> too. Add NTOHL, ... to <rtems/rtems_bsdnet_internal.h>.
Diffstat (limited to 'cpukit/libnetworking/rtems/rtems_bsdnet_internal.h')
-rw-r--r--cpukit/libnetworking/rtems/rtems_bsdnet_internal.h26
1 files changed, 25 insertions, 1 deletions
diff --git a/cpukit/libnetworking/rtems/rtems_bsdnet_internal.h b/cpukit/libnetworking/rtems/rtems_bsdnet_internal.h
index 7ede2c6121..10a1f62442 100644
--- a/cpukit/libnetworking/rtems/rtems_bsdnet_internal.h
+++ b/cpukit/libnetworking/rtems/rtems_bsdnet_internal.h
@@ -31,6 +31,7 @@ typedef __uintptr_t vm_size_t;
/* make sure we get the network versions of these */
#include <machine/types.h>
#include <machine/param.h>
+#include <machine/endian.h>
#include <sys/cdefs.h>
#include <sys/time.h>
@@ -105,7 +106,30 @@ typedef int boolean_t;
#define makedev(x,y) ((dev_t)(((x) << 8) | (y))) /* create dev_t */
#endif
-#include <rtems/endian.h>
+#ifndef _BYTEORDER_PROTOTYPED
+#define _BYTEORDER_PROTOTYPED
+__BEGIN_DECLS
+__uint32_t htonl(__uint32_t);
+__uint16_t htons(__uint16_t);
+__uint32_t ntohl(__uint32_t);
+__uint16_t ntohs(__uint16_t);
+__END_DECLS
+#endif
+
+#ifndef _BYTEORDER_FUNC_DEFINED
+#define _BYTEORDER_FUNC_DEFINED
+#define htonl(x) __htonl(x)
+#define htons(x) __htons(x)
+#define ntohl(x) __ntohl(x)
+#define ntohs(x) __ntohs(x)
+#endif /* !_BYTEORDER_FUNC_DEFINED */
+
+#define NTOHS(x) (x) = ntohs(x)
+#define HTONS(x) (x) = htons(x)
+#define NTOHL(x) (x) = ntohl(x)
+#define HTONL(x) (x) = htonl(x)
+
+in_addr_t inet_addr(const char *);
typedef quad_t rlim_t; /* resource limit */
typedef u_int32_t fixpt_t; /* fixed point number */