Index: c/src/lib/libbsp/arm/atsam/network/if_atsam.c
===================================================================
--- c/src/lib/libbsp/arm/atsam/network/if_atsam.c	(revision 657e6c93ef680a65ae59fa63aeef7f8c09e98cba)
+++ c/src/lib/libbsp/arm/atsam/network/if_atsam.c	(revision 4c02385d8fa3110e4208e2cb8cb2d04d630cf85e)
@@ -59,6 +59,4 @@
 #include <netinet/in.h>
 #include <netinet/if_ether.h>
-
-#include <arpa/inet.h>
 
 #include <dev/mii/mii.h>
Index: c/src/lib/libbsp/m68k/csb360/network/network.c
===================================================================
--- c/src/lib/libbsp/m68k/csb360/network/network.c	(revision 657e6c93ef680a65ae59fa63aeef7f8c09e98cba)
+++ c/src/lib/libbsp/m68k/csb360/network/network.c	(revision 4c02385d8fa3110e4208e2cb8cb2d04d630cf85e)
@@ -39,5 +39,4 @@
 #include <sys/types.h>
 #include <sys/socket.h>
-#include <arpa/inet.h>
 
 /*
Index: c/src/lib/libbsp/m68k/mvme167/network/network.c
===================================================================
--- c/src/lib/libbsp/m68k/mvme167/network/network.c	(revision 657e6c93ef680a65ae59fa63aeef7f8c09e98cba)
+++ c/src/lib/libbsp/m68k/mvme167/network/network.c	(revision 4c02385d8fa3110e4208e2cb8cb2d04d630cf85e)
@@ -67,5 +67,4 @@
 #include <netinet/in.h>
 #include <netinet/if_ether.h>
-#include <arpa/inet.h>
 
 #include "uti596.h"
Index: c/src/lib/libbsp/powerpc/beatnik/network/porting/if_xxx_rtems.c
===================================================================
--- c/src/lib/libbsp/powerpc/beatnik/network/porting/if_xxx_rtems.c	(revision 657e6c93ef680a65ae59fa63aeef7f8c09e98cba)
+++ c/src/lib/libbsp/powerpc/beatnik/network/porting/if_xxx_rtems.c	(revision 4c02385d8fa3110e4208e2cb8cb2d04d630cf85e)
@@ -28,5 +28,4 @@
 #include <netinet/in.h>
 #include <netinet/if_ether.h>
-#include <arpa/inet.h>
 
 #include <net/if_media.h>
Index: c/src/lib/libbsp/powerpc/haleakala/network/network.c
===================================================================
--- c/src/lib/libbsp/powerpc/haleakala/network/network.c	(revision 657e6c93ef680a65ae59fa63aeef7f8c09e98cba)
+++ c/src/lib/libbsp/powerpc/haleakala/network/network.c	(revision 4c02385d8fa3110e4208e2cb8cb2d04d630cf85e)
@@ -35,5 +35,4 @@
 #include <sys/types.h>
 #include <sys/socket.h>
-#include <arpa/inet.h>
 
 #include <ppc4xx/ppc405gp.h>
Index: c/src/lib/libbsp/powerpc/tqm8xx/network/network_fec.c
===================================================================
--- c/src/lib/libbsp/powerpc/tqm8xx/network/network_fec.c	(revision 657e6c93ef680a65ae59fa63aeef7f8c09e98cba)
+++ c/src/lib/libbsp/powerpc/tqm8xx/network/network_fec.c	(revision 4c02385d8fa3110e4208e2cb8cb2d04d630cf85e)
@@ -68,5 +68,4 @@
 #include <sys/types.h>
 #include <sys/socket.h>
-#include <arpa/inet.h>
 
 /*
Index: c/src/lib/libbsp/powerpc/tqm8xx/network/network_scc.c
===================================================================
--- c/src/lib/libbsp/powerpc/tqm8xx/network/network_scc.c	(revision 657e6c93ef680a65ae59fa63aeef7f8c09e98cba)
+++ c/src/lib/libbsp/powerpc/tqm8xx/network/network_scc.c	(revision 4c02385d8fa3110e4208e2cb8cb2d04d630cf85e)
@@ -64,5 +64,4 @@
 #include <sys/types.h>
 #include <sys/socket.h>
-#include <arpa/inet.h>
 
 /*
Index: cpukit/libnetworking/arpa/inet.h
===================================================================
--- cpukit/libnetworking/arpa/inet.h	(revision 657e6c93ef680a65ae59fa63aeef7f8c09e98cba)
+++ cpukit/libnetworking/arpa/inet.h	(revision 4c02385d8fa3110e4208e2cb8cb2d04d630cf85e)
@@ -52,7 +52,7 @@
 /*%
  *	@(#)inet.h	8.1 (Berkeley) 6/2/93
- * $FreeBSD: src/include/arpa/inet.h,v 1.33 2010/07/06 03:48:46 maxim Exp $
+ *	$Id: inet.h,v 1.3 2005/04/27 04:56:16 sra Exp $
+ * $FreeBSD: head/include/arpa/inet.h 269867 2014-08-12 12:36:06Z ume $
  */
-
 
 #ifndef _ARPA_INET_H_
@@ -62,11 +62,21 @@
 
 #include <sys/cdefs.h>
-#include <rtems/bsdnet/_types.h>
+#include <sys/_types.h>
 
 /* Required for byteorder(3) functions. */
-#include <rtems/endian.h>
+#include <machine/endian.h>
 
 #define	INET_ADDRSTRLEN		16
 #define	INET6_ADDRSTRLEN	46
+
+#ifndef _UINT16_T_DECLARED
+typedef	__uint16_t	uint16_t;
+#define	_UINT16_T_DECLARED
+#endif
+
+#ifndef _UINT32_T_DECLARED
+typedef	__uint32_t	uint32_t;
+#define	_UINT32_T_DECLARED
+#endif
 
 #ifndef _IN_ADDR_T_DECLARED
@@ -78,4 +88,11 @@
 typedef	uint16_t	in_port_t;
 #define	_IN_PORT_T_DECLARED
+#endif
+
+#if __BSD_VISIBLE
+#ifndef _SIZE_T_DECLARED
+typedef	__size_t	size_t;
+#define	_SIZE_T_DECLARED
+#endif
 #endif
 
@@ -96,30 +113,15 @@
 #endif
 
-#if !defined(__rtems__)	/* RTEMS -- Why rename these? */
-/* XXX all new diversions!! argh!! */
-#if __BSD_VISIBLE
-#define	inet_addr		__inet_addr
-#define	inet_aton		__inet_aton
-#define	inet_lnaof		__inet_lnaof
-#define	inet_makeaddr		__inet_makeaddr
-#define	inet_neta		__inet_neta
-#define	inet_netof		__inet_netof
-#define	inet_network		__inet_network
-#define	inet_net_ntop		__inet_net_ntop
-#define	inet_net_pton		__inet_net_pton
-#define	inet_cidr_ntop		__inet_cidr_ntop
-#define	inet_cidr_pton		__inet_cidr_pton
-#define	inet_ntoa		__inet_ntoa
-#define	inet_ntoa_r		__inet_ntoa_r
-#define	inet_pton		__inet_pton
-#define	inet_ntop		__inet_ntop
-#define	inet_nsap_addr		__inet_nsap_addr
-#define	inet_nsap_ntoa		__inet_nsap_ntoa
-#endif /* __BSD_VISIBLE */
-#endif /* __rtems__ */
+__BEGIN_DECLS
+#ifndef _BYTEORDER_PROTOTYPED
+#define	_BYTEORDER_PROTOTYPED
+uint32_t	 htonl(uint32_t);
+uint16_t	 htons(uint16_t);
+uint32_t	 ntohl(uint32_t);
+uint16_t	 ntohs(uint16_t);
+#endif
 
-__BEGIN_DECLS
 in_addr_t	 inet_addr(const char *);
-char		*inet_ntoa(struct in_addr);
+/*const*/ char	*inet_ntoa(struct in_addr);
 const char	*inet_ntop(int, const void * __restrict, char * __restrict,
 		    socklen_t);
@@ -135,4 +137,7 @@
 char		*inet_net_ntop(int, const void *, int, char *, size_t);
 int		 inet_net_pton(int, const char *, void *, size_t);
+char		*inet_ntoa_r(struct in_addr, char *buf, socklen_t size);
+char		*inet_cidr_ntop(int, const void *, int, char *, size_t);
+int		 inet_cidr_pton(int, const char *, void *, int *);
 unsigned	 inet_nsap_addr(const char *, unsigned char *, int);
 char		*inet_nsap_ntoa(int, const unsigned char *, char *);
@@ -140,3 +145,13 @@
 __END_DECLS
 
+#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
+
 #endif /* !_ARPA_INET_H_ */
+
+/*! \file */
Index: cpukit/libnetworking/arpa/nameser_compat.h
===================================================================
--- cpukit/libnetworking/arpa/nameser_compat.h	(revision 657e6c93ef680a65ae59fa63aeef7f8c09e98cba)
+++ cpukit/libnetworking/arpa/nameser_compat.h	(revision 4c02385d8fa3110e4208e2cb8cb2d04d630cf85e)
@@ -41,5 +41,5 @@
 #define	__BIND		19950621	/* (DEAD) interface version stamp. */
 
-#include <rtems/endian.h>
+#include <sys/endian.h>
 
 #if !defined(BYTE_ORDER) || \
Index: cpukit/libnetworking/rtems/mkrootfs.c
===================================================================
--- cpukit/libnetworking/rtems/mkrootfs.c	(revision 657e6c93ef680a65ae59fa63aeef7f8c09e98cba)
+++ cpukit/libnetworking/rtems/mkrootfs.c	(revision 4c02385d8fa3110e4208e2cb8cb2d04d630cf85e)
@@ -37,8 +37,8 @@
 #include <sys/socket.h>
 #include <netinet/in.h>
-#include <arpa/inet.h>
 
 #include <rtems/mkrootfs.h>
 #include <rtems/libio.h>
+#include <rtems/endian.h>
 
 /*
Index: cpukit/libnetworking/rtems/mkrootfs.h
===================================================================
--- cpukit/libnetworking/rtems/mkrootfs.h	(revision 657e6c93ef680a65ae59fa63aeef7f8c09e98cba)
+++ cpukit/libnetworking/rtems/mkrootfs.h	(revision 4c02385d8fa3110e4208e2cb8cb2d04d630cf85e)
@@ -22,5 +22,5 @@
 #define _RTEMS_MKROOTFS_H
 
-#include <arpa/inet.h> /* in_addr_t */
+#include <sys/types.h> /* in_addr_t */
 
 #include <rtems.h>
Index: cpukit/libnetworking/rtems/rtems_bsdnet_internal.h
===================================================================
--- cpukit/libnetworking/rtems/rtems_bsdnet_internal.h	(revision 657e6c93ef680a65ae59fa63aeef7f8c09e98cba)
+++ cpukit/libnetworking/rtems/rtems_bsdnet_internal.h	(revision 4c02385d8fa3110e4208e2cb8cb2d04d630cf85e)
@@ -32,4 +32,5 @@
 #include <machine/types.h>
 #include <machine/param.h>
+#include <machine/endian.h>
 #include <sys/cdefs.h>
 
@@ -106,5 +107,28 @@
 #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 */
Index: cpukit/libnetworking/rtems/rtems_dhcp_failsafe.c
===================================================================
--- cpukit/libnetworking/rtems/rtems_dhcp_failsafe.c	(revision 657e6c93ef680a65ae59fa63aeef7f8c09e98cba)
+++ cpukit/libnetworking/rtems/rtems_dhcp_failsafe.c	(revision 4c02385d8fa3110e4208e2cb8cb2d04d630cf85e)
@@ -72,6 +72,4 @@
 #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;
Index: cpukit/libnetworking/rtems/rtems_glue.c
===================================================================
--- cpukit/libnetworking/rtems/rtems_glue.c	(revision 657e6c93ef680a65ae59fa63aeef7f8c09e98cba)
+++ cpukit/libnetworking/rtems/rtems_glue.c	(revision 4c02385d8fa3110e4208e2cb8cb2d04d630cf85e)
@@ -31,5 +31,4 @@
 #include <netinet/in.h>
 #include <vm/vm.h>
-#include <arpa/inet.h>
 
 #include <net/netisr.h>
@@ -830,4 +829,6 @@
  * IP header checksum routine for processors which don't have an inline version
  */
+
+struct ip;
 
 u_int in_cksum_hdr(const struct ip *);
Index: cpukit/libnetworking/rtems/rtems_showifstat.c
===================================================================
--- cpukit/libnetworking/rtems/rtems_showifstat.c	(revision 657e6c93ef680a65ae59fa63aeef7f8c09e98cba)
+++ cpukit/libnetworking/rtems/rtems_showifstat.c	(revision 4c02385d8fa3110e4208e2cb8cb2d04d630cf85e)
@@ -16,5 +16,4 @@
 #include <net/if_types.h>
 #include <netinet/in.h>
-#include <arpa/inet.h>
 
 #include <rtems/rtems_bsdnet.h>
Index: cpukit/libnetworking/rtems/rtems_showroute.c
===================================================================
--- cpukit/libnetworking/rtems/rtems_showroute.c	(revision 657e6c93ef680a65ae59fa63aeef7f8c09e98cba)
+++ cpukit/libnetworking/rtems/rtems_showroute.c	(revision 4c02385d8fa3110e4208e2cb8cb2d04d630cf85e)
@@ -19,6 +19,4 @@
 
 #include <netinet/in.h>
-
-#include <arpa/inet.h>
 
 /*
