summaryrefslogtreecommitdiffstats
path: root/cpukit/libnetworking/rtems
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
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')
-rw-r--r--cpukit/libnetworking/rtems/mkrootfs.c2
-rw-r--r--cpukit/libnetworking/rtems/mkrootfs.h2
-rw-r--r--cpukit/libnetworking/rtems/rtems_bsdnet_internal.h26
-rw-r--r--cpukit/libnetworking/rtems/rtems_dhcp_failsafe.c2
-rw-r--r--cpukit/libnetworking/rtems/rtems_glue.c3
-rw-r--r--cpukit/libnetworking/rtems/rtems_showifstat.c1
-rw-r--r--cpukit/libnetworking/rtems/rtems_showroute.c2
7 files changed, 29 insertions, 9 deletions
diff --git a/cpukit/libnetworking/rtems/mkrootfs.c b/cpukit/libnetworking/rtems/mkrootfs.c
index ccdebaf452..aaf670b6b1 100644
--- a/cpukit/libnetworking/rtems/mkrootfs.c
+++ b/cpukit/libnetworking/rtems/mkrootfs.c
@@ -36,10 +36,10 @@
#include <unistd.h>
#include <sys/socket.h>
#include <netinet/in.h>
-#include <arpa/inet.h>
#include <rtems/mkrootfs.h>
#include <rtems/libio.h>
+#include <rtems/endian.h>
/*
* A table a list of names and their modes.
diff --git a/cpukit/libnetworking/rtems/mkrootfs.h b/cpukit/libnetworking/rtems/mkrootfs.h
index 648b71197b..8bd443693b 100644
--- a/cpukit/libnetworking/rtems/mkrootfs.h
+++ b/cpukit/libnetworking/rtems/mkrootfs.h
@@ -21,7 +21,7 @@
#ifndef _RTEMS_MKROOTFS_H
#define _RTEMS_MKROOTFS_H
-#include <arpa/inet.h> /* in_addr_t */
+#include <sys/types.h> /* in_addr_t */
#include <rtems.h>
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 */
diff --git a/cpukit/libnetworking/rtems/rtems_dhcp_failsafe.c b/cpukit/libnetworking/rtems/rtems_dhcp_failsafe.c
index c491ad9655..46a411bc55 100644
--- a/cpukit/libnetworking/rtems/rtems_dhcp_failsafe.c
+++ b/cpukit/libnetworking/rtems/rtems_dhcp_failsafe.c
@@ -71,8 +71,6 @@ struct proc; /* Unused parameter of some functions. */
#include <net/if_var.h> /* for in_var.h */
#include <netinet/in_var.h> /* for in_aliasreq */
#include <sys/sockio.h> /* for ioctl definitions */
-#include <arpa/inet.h> /* for inet_addr, inet_ntop */
-
static int network_fail_timeout = RTEMS_DHCP_FAILSAFE_NETWORK_FAIL_TIMEOUT;
static int network_down_time = RTEMS_DHCP_FAILSAFE_NETWORK_DOWN_TIME;
diff --git a/cpukit/libnetworking/rtems/rtems_glue.c b/cpukit/libnetworking/rtems/rtems_glue.c
index e9b371f700..4081be85c6 100644
--- a/cpukit/libnetworking/rtems/rtems_glue.c
+++ b/cpukit/libnetworking/rtems/rtems_glue.c
@@ -30,7 +30,6 @@
#include <net/route.h>
#include <netinet/in.h>
#include <vm/vm.h>
-#include <arpa/inet.h>
#include <net/netisr.h>
#include <net/route.h>
@@ -830,6 +829,8 @@ rtems_bsdnet_log (int priority, const char *fmt, ...)
* IP header checksum routine for processors which don't have an inline version
*/
+struct ip;
+
u_int in_cksum_hdr(const struct ip *);
u_int
diff --git a/cpukit/libnetworking/rtems/rtems_showifstat.c b/cpukit/libnetworking/rtems/rtems_showifstat.c
index 50be6c8eff..2e06a8ce5c 100644
--- a/cpukit/libnetworking/rtems/rtems_showifstat.c
+++ b/cpukit/libnetworking/rtems/rtems_showifstat.c
@@ -15,7 +15,6 @@
#include <net/if_dl.h>
#include <net/if_types.h>
#include <netinet/in.h>
-#include <arpa/inet.h>
#include <rtems/rtems_bsdnet.h>
diff --git a/cpukit/libnetworking/rtems/rtems_showroute.c b/cpukit/libnetworking/rtems/rtems_showroute.c
index 44b4c3bd28..30545d26d1 100644
--- a/cpukit/libnetworking/rtems/rtems_showroute.c
+++ b/cpukit/libnetworking/rtems/rtems_showroute.c
@@ -19,8 +19,6 @@
#include <netinet/in.h>
-#include <arpa/inet.h>
-
/*
* We'll use the application versions of realloc and free.
*/