[PATCH 4/5] network: Use kernel/user space header files

Sebastian Huber sebastian.huber at embedded-brains.de
Fri Sep 7 05:31:40 UTC 2018


Add and use <machine/rtems-bsd-kernel-space.h> and
<machine/rtems-bsd-user-space.h> similar to the libbsd to avoid command
line defines and defines scattered throught the code base.

Simplify cpukit/libnetworking/Makefile.am.

Update #3375.
---
 bsps/arm/atsam/net/if_atsam.c                      |   3 +-
 bsps/arm/csb336/net/lan91c11x.c                    |   2 +-
 bsps/arm/csb336/net/network.c                      |   2 +-
 bsps/arm/csb337/net/network.c                      |   2 +-
 bsps/arm/edb7312/net/network.c                     |   2 +-
 bsps/arm/gumstix/net/rtl8019.c                     |   2 +-
 bsps/arm/rtl22xx/net/network.c                     |   2 +-
 bsps/arm/shared/net/lpc-ethernet.c                 |   2 +-
 bsps/bfin/bf537Stamp/net/ethernet.c                |   2 +-
 bsps/bfin/bf537Stamp/net/networkconfig.c           |   2 +-
 bsps/i386/pc386/net/3c509.c                        |   2 +-
 bsps/i386/pc386/net/elink.c                        |   2 +-
 bsps/i386/pc386/net/ne2000.c                       |   2 +-
 bsps/i386/pc386/net/wd8003.c                       |   2 +-
 bsps/lm32/shared/net/network.c                     |   2 +-
 bsps/lm32/shared/net/tsmac.c                       |   3 +-
 bsps/m68k/av5282/net/network.c                     |   2 +-
 bsps/m68k/csb360/net/network.c                     |   2 +-
 bsps/m68k/gen68360/net/network.c                   |   2 +-
 bsps/m68k/genmcf548x/net/network.c                 |   2 +-
 bsps/m68k/mcf5235/net/network.c                    |   2 +-
 bsps/m68k/mcf5329/net/network.c                    |   2 +-
 bsps/m68k/mvme167/net/network.c                    |   3 +-
 bsps/m68k/uC5282/net/network.c                     |   2 +-
 bsps/mips/csb350/net/network.c                     |   2 +-
 bsps/powerpc/beatnik/net/porting/rtemscompat.h     |   2 +-
 bsps/powerpc/gen5200/net/network.c                 |   3 +-
 bsps/powerpc/gen83xx/net/network.c                 |   2 +-
 bsps/powerpc/haleakala/net/network.c               |   2 +-
 bsps/powerpc/mpc55xxevb/net/smsc9218i.c            |   3 +-
 bsps/powerpc/mpc8260ads/net/if_hdlcsubr.c          |   3 +-
 bsps/powerpc/mpc8260ads/net/network.c              |   2 +-
 bsps/powerpc/mvme3100/net/tsec.c                   |   9 +-
 bsps/powerpc/mvme5500/net/if_100MHz/GT64260eth.c   |   2 +-
 bsps/powerpc/mvme5500/net/if_1GHz/if_wm.c          |   2 +-
 bsps/powerpc/qoriq/net/if_intercom.c               |   3 +-
 bsps/powerpc/qoriq/net/network.c                   |   3 +-
 bsps/powerpc/shared/net/tsec.c                     |   2 +-
 bsps/powerpc/tqm8xx/net/network_fec.c              |   2 +-
 bsps/powerpc/tqm8xx/net/network_scc.c              |   2 +-
 bsps/powerpc/virtex/net/xiltemac.c                 |   2 +-
 bsps/shared/net/cs8900.c                           |   2 +-
 bsps/shared/net/dec21140.c                         |   2 +-
 bsps/shared/net/elnk.c                             |   2 +-
 bsps/shared/net/greth2.c                           |   2 +-
 bsps/shared/net/i82586.c                           |   2 +-
 bsps/shared/net/if_dc.c                            |   2 +-
 bsps/shared/net/if_fxp.c                           |   2 +-
 bsps/shared/net/open_eth.c                         |   2 +-
 bsps/shared/net/smc91111.c                         |   2 +-
 bsps/shared/net/sonic.c                            |   2 +-
 bsps/sparc/erc32/net/erc32sonic.c                  |   2 +-
 bsps/sparc/leon2/net/leon_open_eth.c               |   2 +-
 bsps/sparc/leon2/net/leon_smc91111.c               |   2 +-
 bsps/sparc/leon3/net/leon_greth.c                  |   2 +-
 bsps/sparc/leon3/net/leon_open_eth.c               |   2 +-
 bsps/sparc/leon3/net/leon_smc91111.c               |   2 +-
 bsps/sparc/shared/net/greth.c                      |   3 +-
 cpukit/libfs/src/nfsclient/src/sock_mbuf.c         |   1 -
 cpukit/libnetworking/Makefile.am                   | 222 +++++++++++----------
 cpukit/libnetworking/kern/kern_mib.c               |   2 +
 cpukit/libnetworking/kern/kern_subr.c              |   2 +
 cpukit/libnetworking/kern/kern_sysctl.c            |   2 +
 cpukit/libnetworking/kern/uipc_domain.c            |   2 +
 cpukit/libnetworking/kern/uipc_mbuf.c              |   2 +
 cpukit/libnetworking/kern/uipc_socket.c            |   2 +
 cpukit/libnetworking/kern/uipc_socket2.c           |   2 +
 cpukit/libnetworking/lib/getprotoby.c              |   2 +
 cpukit/libnetworking/lib/rtems_bsdnet_ntp.c        |   2 +
 cpukit/libnetworking/lib/syslog.c                  |   2 +
 cpukit/libnetworking/libc/base64.c                 |   2 +
 cpukit/libnetworking/libc/gethostbydns.c           |   2 +
 cpukit/libnetworking/libc/gethostbyht.c            |   2 +
 cpukit/libnetworking/libc/gethostbynis.c           |   2 +
 cpukit/libnetworking/libc/gethostnamadr.c          |   2 +
 cpukit/libnetworking/libc/getifaddrs.c             |   2 +
 cpukit/libnetworking/libc/getnameinfo.c            |   2 +
 cpukit/libnetworking/libc/getnetbydns.c            |   2 +
 cpukit/libnetworking/libc/getnetbyht.c             |   2 +
 cpukit/libnetworking/libc/getnetbynis.c            |   2 +
 cpukit/libnetworking/libc/getnetnamadr.c           |   2 +
 cpukit/libnetworking/libc/getproto.c               |   2 +
 cpukit/libnetworking/libc/getprotoent.c            |   2 +
 cpukit/libnetworking/libc/getprotoname.c           |   2 +
 cpukit/libnetworking/libc/getservbyname.c          |   2 +
 cpukit/libnetworking/libc/getservbyport.c          |   2 +
 cpukit/libnetworking/libc/getservent.c             |   2 +
 cpukit/libnetworking/libc/herror.c                 |   2 +
 cpukit/libnetworking/libc/if_indextoname.c         |   2 +
 cpukit/libnetworking/libc/if_nameindex.c           |   2 +
 cpukit/libnetworking/libc/inet_addr.c              |   2 +
 cpukit/libnetworking/libc/inet_lnaof.c             |   2 +
 cpukit/libnetworking/libc/inet_makeaddr.c          |   2 +
 cpukit/libnetworking/libc/inet_netof.c             |   2 +
 cpukit/libnetworking/libc/inet_network.c           |   2 +
 cpukit/libnetworking/libc/inet_ntoa.c              |   2 +
 cpukit/libnetworking/libc/inet_ntop.c              |   2 +
 cpukit/libnetworking/libc/inet_pton.c              |   2 +
 cpukit/libnetworking/libc/linkaddr.c               |   2 +
 cpukit/libnetworking/libc/map_v4v6.c               |   2 +
 cpukit/libnetworking/libc/ns_name.c                |   2 +
 cpukit/libnetworking/libc/ns_netint.c              |   2 +
 cpukit/libnetworking/libc/ns_parse.c               |   2 +
 cpukit/libnetworking/libc/ns_print.c               |   2 +
 cpukit/libnetworking/libc/ns_ttl.c                 |   2 +
 cpukit/libnetworking/libc/nsap_addr.c              |   2 +
 cpukit/libnetworking/libc/rcmd.c                   |   2 +
 cpukit/libnetworking/libc/recv.c                   |   2 +
 cpukit/libnetworking/libc/res_comp.c               |   2 +
 cpukit/libnetworking/libc/res_data.c               |   2 +
 cpukit/libnetworking/libc/res_debug.c              |   2 +
 cpukit/libnetworking/libc/res_init.c               |   2 +
 cpukit/libnetworking/libc/res_mkquery.c            |   2 +
 cpukit/libnetworking/libc/res_mkupdate.c           |   2 +
 cpukit/libnetworking/libc/res_query.c              |   2 +
 cpukit/libnetworking/libc/res_send.c               |   2 +
 cpukit/libnetworking/libc/res_stubs.c              |   2 +
 cpukit/libnetworking/libc/res_update.c             |   2 +
 cpukit/libnetworking/libc/send.c                   |   2 +
 cpukit/libnetworking/libc/strsep.c                 |   2 +
 .../libnetworking/machine/rtems-bsd-kernel-space.h |  42 ++++
 .../libnetworking/machine/rtems-bsd-user-space.h   |  40 ++++
 cpukit/libnetworking/net/if.c                      |   2 +
 cpukit/libnetworking/net/if_ethersubr.c            |   2 +
 cpukit/libnetworking/net/if_loop.c                 |   2 +
 cpukit/libnetworking/net/if_ppp.c                  |   2 +
 cpukit/libnetworking/net/ppp_tty.c                 |   2 +
 cpukit/libnetworking/net/radix.c                   |   2 +
 cpukit/libnetworking/net/raw_cb.c                  |   2 +
 cpukit/libnetworking/net/raw_usrreq.c              |   2 +
 cpukit/libnetworking/net/route.c                   |   2 +
 cpukit/libnetworking/net/rtsock.c                  |   2 +
 cpukit/libnetworking/net/slcompress.c              |   2 +
 cpukit/libnetworking/netinet/if_ether.c            |   2 +
 cpukit/libnetworking/netinet/igmp.c                |   2 +
 cpukit/libnetworking/netinet/in.c                  |   2 +
 cpukit/libnetworking/netinet/in_cksum.c            |   2 +
 cpukit/libnetworking/netinet/in_pcb.c              |   2 +
 cpukit/libnetworking/netinet/in_proto.c            |   2 +
 cpukit/libnetworking/netinet/in_rmx.c              |   2 +
 cpukit/libnetworking/netinet/ip_divert.c           |   2 +
 cpukit/libnetworking/netinet/ip_fw.c               |   2 +
 cpukit/libnetworking/netinet/ip_icmp.c             |   2 +
 cpukit/libnetworking/netinet/ip_input.c            |   2 +
 cpukit/libnetworking/netinet/ip_mroute.c           |   2 +
 cpukit/libnetworking/netinet/ip_output.c           |   2 +
 cpukit/libnetworking/netinet/raw_ip.c              |   2 +
 cpukit/libnetworking/netinet/tcp_debug.c           |   2 +
 cpukit/libnetworking/netinet/tcp_input.c           |   2 +
 cpukit/libnetworking/netinet/tcp_output.c          |   2 +
 cpukit/libnetworking/netinet/tcp_subr.c            |   2 +
 cpukit/libnetworking/netinet/tcp_timer.c           |   2 +
 cpukit/libnetworking/netinet/tcp_usrreq.c          |   2 +
 cpukit/libnetworking/netinet/udp_usrreq.c          |   2 +
 cpukit/libnetworking/nfs/bootp_subr.c              |   2 +
 cpukit/libnetworking/rtems/mkrootfs.c              |   2 +
 cpukit/libnetworking/rtems/rtems_bootp.c           |   2 +
 cpukit/libnetworking/rtems/rtems_bsdnet.h          |  22 --
 .../rtems/rtems_bsdnet_malloc_starvation.c         |   2 +
 cpukit/libnetworking/rtems/rtems_dhcp.c            |  17 +-
 cpukit/libnetworking/rtems/rtems_dhcp_failsafe.c   |   2 +
 cpukit/libnetworking/rtems/rtems_glue.c            |   2 +
 cpukit/libnetworking/rtems/rtems_malloc_mbuf.c     |   2 +
 cpukit/libnetworking/rtems/rtems_mii_ioctl.c       |   2 +
 cpukit/libnetworking/rtems/rtems_mii_ioctl_kern.c  |   2 +
 cpukit/libnetworking/rtems/rtems_select.c          |   2 +
 cpukit/libnetworking/rtems/rtems_showicmpstat.c    |   2 +
 cpukit/libnetworking/rtems/rtems_showifstat.c      |   2 +
 cpukit/libnetworking/rtems/rtems_showipstat.c      |   2 +
 cpukit/libnetworking/rtems/rtems_showmbuf.c        |   2 +
 cpukit/libnetworking/rtems/rtems_showroute.c       |   2 +
 cpukit/libnetworking/rtems/rtems_showtcpstat.c     |   2 +
 cpukit/libnetworking/rtems/rtems_showudpstat.c     |   2 +
 cpukit/libnetworking/rtems/rtems_socketpair.c      |   2 +
 cpukit/libnetworking/rtems/rtems_syscall.c         |   2 +
 cpukit/libnetworking/rtems/rtems_syscall_api.c     |   2 +
 cpukit/libnetworking/rtems/sghostname.c            |   2 +
 cpukit/wrapup/Makefile.am                          |   2 -
 178 files changed, 483 insertions(+), 221 deletions(-)
 create mode 100644 cpukit/libnetworking/machine/rtems-bsd-kernel-space.h
 create mode 100644 cpukit/libnetworking/machine/rtems-bsd-user-space.h

diff --git a/bsps/arm/atsam/net/if_atsam.c b/bsps/arm/atsam/net/if_atsam.c
index 7e7e0e6faf..75b1f952b6 100644
--- a/bsps/arm/atsam/net/if_atsam.c
+++ b/bsps/arm/atsam/net/if_atsam.c
@@ -33,8 +33,7 @@
 #include <libchip/include/gmacd.h>
 #include <libchip/include/pio.h>
 
-#define __INSIDE_RTEMS_BSD_TCPIP_STACK__	1
-#define __BSD_VISIBLE				1
+#include <machine/rtems-bsd-kernel-space.h>
 
 #include <bsp.h>
 #include <bsp/irq.h>
diff --git a/bsps/arm/csb336/net/lan91c11x.c b/bsps/arm/csb336/net/lan91c11x.c
index 37594776d1..e1c4fcc7ce 100644
--- a/bsps/arm/csb336/net/lan91c11x.c
+++ b/bsps/arm/csb336/net/lan91c11x.c
@@ -17,7 +17,7 @@
  *  http://www.rtems.org/license/LICENSE.
  */
 
-#define __INSIDE_RTEMS_BSD_TCPIP_STACK__
+#include <machine/rtems-bsd-kernel-space.h>
 
 #include <rtems.h>
 #include "lan91c11x.h"
diff --git a/bsps/arm/csb336/net/network.c b/bsps/arm/csb336/net/network.c
index be3d3f7b3d..ddc671a4cd 100644
--- a/bsps/arm/csb336/net/network.c
+++ b/bsps/arm/csb336/net/network.c
@@ -9,7 +9,7 @@
  *  http://www.rtems.org/license/LICENSE.
  */
 
-#define __INSIDE_RTEMS_BSD_TCPIP_STACK__
+#include <machine/rtems-bsd-kernel-space.h>
 
 #include <rtems.h>
 #include <rtems/rtems_bsdnet.h>
diff --git a/bsps/arm/csb337/net/network.c b/bsps/arm/csb337/net/network.c
index af7150122d..b795cf4bce 100644
--- a/bsps/arm/csb337/net/network.c
+++ b/bsps/arm/csb337/net/network.c
@@ -10,7 +10,7 @@
  *             MicroMonitor 1.17.
  */
 
-#define __INSIDE_RTEMS_BSD_TCPIP_STACK__
+#include <machine/rtems-bsd-kernel-space.h>
 
 #include <rtems.h>
 #include <rtems/rtems_bsdnet.h>
diff --git a/bsps/arm/edb7312/net/network.c b/bsps/arm/edb7312/net/network.c
index 480808aeaa..9a832293f9 100644
--- a/bsps/arm/edb7312/net/network.c
+++ b/bsps/arm/edb7312/net/network.c
@@ -1,4 +1,4 @@
-#define __INSIDE_RTEMS_BSD_TCPIP_STACK__
+#include <machine/rtems-bsd-kernel-space.h>
 
 #include <rtems.h>
 #include <sys/param.h>
diff --git a/bsps/arm/gumstix/net/rtl8019.c b/bsps/arm/gumstix/net/rtl8019.c
index 995835c689..a9edd71be1 100644
--- a/bsps/arm/gumstix/net/rtl8019.c
+++ b/bsps/arm/gumstix/net/rtl8019.c
@@ -8,7 +8,7 @@
  *  http://www.rtems.org/license/LICENSE.
  */
 
-#define __INSIDE_RTEMS_BSD_TCPIP_STACK__
+#include <machine/rtems-bsd-kernel-space.h>
 
 #include <bsp.h>
 #include <bsp/irq.h>
diff --git a/bsps/arm/rtl22xx/net/network.c b/bsps/arm/rtl22xx/net/network.c
index b269a6ddfc..5581b8fab5 100644
--- a/bsps/arm/rtl22xx/net/network.c
+++ b/bsps/arm/rtl22xx/net/network.c
@@ -1,6 +1,6 @@
 /*Note: this file is copy from 7312 BSP, and untested yet*/
 
-#define __INSIDE_RTEMS_BSD_TCPIP_STACK__
+#include <machine/rtems-bsd-kernel-space.h>
 
 #include <rtems.h>
 #include <sys/param.h>
diff --git a/bsps/arm/shared/net/lpc-ethernet.c b/bsps/arm/shared/net/lpc-ethernet.c
index fb8f014963..ccfe1696eb 100644
--- a/bsps/arm/shared/net/lpc-ethernet.c
+++ b/bsps/arm/shared/net/lpc-ethernet.c
@@ -20,7 +20,7 @@
  * http://www.rtems.org/license/LICENSE.
  */
 
-#define __INSIDE_RTEMS_BSD_TCPIP_STACK__
+#include <machine/rtems-bsd-kernel-space.h>
 
 #include <errno.h>
 #include <inttypes.h>
diff --git a/bsps/bfin/bf537Stamp/net/ethernet.c b/bsps/bfin/bf537Stamp/net/ethernet.c
index f08ffdd63b..1594219e16 100644
--- a/bsps/bfin/bf537Stamp/net/ethernet.c
+++ b/bsps/bfin/bf537Stamp/net/ethernet.c
@@ -10,7 +10,7 @@
  *
  */
 
-#define __INSIDE_RTEMS_BSD_TCPIP_STACK__
+#include <machine/rtems-bsd-kernel-space.h>
 
 #include <rtems.h>
 #include <rtems/rtems_bsdnet.h>
diff --git a/bsps/bfin/bf537Stamp/net/networkconfig.c b/bsps/bfin/bf537Stamp/net/networkconfig.c
index 9737530340..85655b3cd4 100644
--- a/bsps/bfin/bf537Stamp/net/networkconfig.c
+++ b/bsps/bfin/bf537Stamp/net/networkconfig.c
@@ -11,7 +11,7 @@
  *  http://www.rtems.org/license/LICENSE.
  */
 
-#define __INSIDE_RTEMS_BSD_TCPIP_STACK__
+#include <machine/rtems-bsd-kernel-space.h>
 
 #include <bsp.h>
 #include <rtems/rtems_bsdnet.h>
diff --git a/bsps/i386/pc386/net/3c509.c b/bsps/i386/pc386/net/3c509.c
index 3cf7ec5226..b30ad03573 100644
--- a/bsps/i386/pc386/net/3c509.c
+++ b/bsps/i386/pc386/net/3c509.c
@@ -53,7 +53,7 @@
  * eric at skatter.usask.ca
  */
 
-#define __INSIDE_RTEMS_BSD_TCPIP_STACK__
+#include <machine/rtems-bsd-kernel-space.h>
 
 #include <bsp.h>
 
diff --git a/bsps/i386/pc386/net/elink.c b/bsps/i386/pc386/net/elink.c
index ca637fb0a8..65cfdfd3ff 100644
--- a/bsps/i386/pc386/net/elink.c
+++ b/bsps/i386/pc386/net/elink.c
@@ -31,7 +31,7 @@
  * Common code for dealing with 3COM ethernet cards.
  */
 
-#define __INSIDE_RTEMS_BSD_TCPIP_STACK__
+#include <machine/rtems-bsd-kernel-space.h>
 
 #include <sys/types.h>
 
diff --git a/bsps/i386/pc386/net/ne2000.c b/bsps/i386/pc386/net/ne2000.c
index 17861405a6..08d805730a 100644
--- a/bsps/i386/pc386/net/ne2000.c
+++ b/bsps/i386/pc386/net/ne2000.c
@@ -27,7 +27,7 @@
  *  that.
  */
 
-#define __INSIDE_RTEMS_BSD_TCPIP_STACK__
+#include <machine/rtems-bsd-kernel-space.h>
 
 #include <bsp.h>
 #include <libchip/wd80x3.h>
diff --git a/bsps/i386/pc386/net/wd8003.c b/bsps/i386/pc386/net/wd8003.c
index d10361bf2c..f455bcca9e 100644
--- a/bsps/i386/pc386/net/wd8003.c
+++ b/bsps/i386/pc386/net/wd8003.c
@@ -9,7 +9,7 @@
  *    eric at skatter.usask.ca
  */
 
-#define __INSIDE_RTEMS_BSD_TCPIP_STACK__
+#include <machine/rtems-bsd-kernel-space.h>
 
 #include <bsp.h>
 #include <libchip/wd80x3.h>
diff --git a/bsps/lm32/shared/net/network.c b/bsps/lm32/shared/net/network.c
index 2bc518ef25..b53f25d5be 100644
--- a/bsps/lm32/shared/net/network.c
+++ b/bsps/lm32/shared/net/network.c
@@ -10,7 +10,7 @@
  *  Copyright (C) 2011 Sebastien Bourdeauducq
  */
 
-#define __INSIDE_RTEMS_BSD_TCPIP_STACK__
+#include <machine/rtems-bsd-kernel-space.h>
 #define RTEMS_STATUS_CHECKS_USE_PRINTK
 
 #include <bsp.h>
diff --git a/bsps/lm32/shared/net/tsmac.c b/bsps/lm32/shared/net/tsmac.c
index 6779f336d4..52abc64494 100644
--- a/bsps/lm32/shared/net/tsmac.c
+++ b/bsps/lm32/shared/net/tsmac.c
@@ -12,8 +12,7 @@
  *  Micro-Research Finland Oy
  */
 
-#define __INSIDE_RTEMS_BSD_TCPIP_STACK__
-#define _KERNEL
+#include <machine/rtems-bsd-kernel-space.h>
 
 #include <rtems.h>
 #include <bsp.h>
diff --git a/bsps/m68k/av5282/net/network.c b/bsps/m68k/av5282/net/network.c
index 457b43c5d6..8c37e67fd6 100644
--- a/bsps/m68k/av5282/net/network.c
+++ b/bsps/m68k/av5282/net/network.c
@@ -1,4 +1,4 @@
-#define __INSIDE_RTEMS_BSD_TCPIP_STACK__
+#include <machine/rtems-bsd-kernel-space.h>
 
 #include <bsp.h>
 #include <stdio.h>
diff --git a/bsps/m68k/csb360/net/network.c b/bsps/m68k/csb360/net/network.c
index 47e0adb44d..95769bf26a 100644
--- a/bsps/m68k/csb360/net/network.c
+++ b/bsps/m68k/csb360/net/network.c
@@ -22,7 +22,7 @@
  *  Copyright (c) 1999, National Research Council of Canada
  */
 
-#define __INSIDE_RTEMS_BSD_TCPIP_STACK__
+#include <machine/rtems-bsd-kernel-space.h>
 
 #include <bsp.h>
 #include <stdio.h>
diff --git a/bsps/m68k/gen68360/net/network.c b/bsps/m68k/gen68360/net/network.c
index 0a038d3348..b0110af064 100644
--- a/bsps/m68k/gen68360/net/network.c
+++ b/bsps/m68k/gen68360/net/network.c
@@ -8,7 +8,7 @@
  * eric at skatter.usask.ca
  */
 
-#define __INSIDE_RTEMS_BSD_TCPIP_STACK__
+#include <machine/rtems-bsd-kernel-space.h>
 
 #include <bsp.h>
 #include <rtems/m68k/m68360.h>
diff --git a/bsps/m68k/genmcf548x/net/network.c b/bsps/m68k/genmcf548x/net/network.c
index 13cb5fbdce..23bd8cba19 100644
--- a/bsps/m68k/genmcf548x/net/network.c
+++ b/bsps/m68k/genmcf548x/net/network.c
@@ -37,7 +37,7 @@
  *
  */
 
-#define __INSIDE_RTEMS_BSD_TCPIP_STACK__
+#include <machine/rtems-bsd-kernel-space.h>
 
 #include <rtems.h>
 #include <rtems/error.h>
diff --git a/bsps/m68k/mcf5235/net/network.c b/bsps/m68k/mcf5235/net/network.c
index 6c8fa88be2..f352b664db 100644
--- a/bsps/m68k/mcf5235/net/network.c
+++ b/bsps/m68k/mcf5235/net/network.c
@@ -4,7 +4,7 @@
  * TO DO: Check network stack code -- force longword alignment of all tx mbufs?
  */
 
-#define __INSIDE_RTEMS_BSD_TCPIP_STACK__
+#include <machine/rtems-bsd-kernel-space.h>
 
 #include <bsp.h>
 #include <stdio.h>
diff --git a/bsps/m68k/mcf5329/net/network.c b/bsps/m68k/mcf5329/net/network.c
index c752f8d669..21032a63ed 100644
--- a/bsps/m68k/mcf5329/net/network.c
+++ b/bsps/m68k/mcf5329/net/network.c
@@ -4,7 +4,7 @@
  * TO DO: Check network stack code -- force longword alignment of all tx mbufs?
  */
 
-#define __INSIDE_RTEMS_BSD_TCPIP_STACK__
+#include <machine/rtems-bsd-kernel-space.h>
 
 #include <bsp.h>
 #include <stdio.h>
diff --git a/bsps/m68k/mvme167/net/network.c b/bsps/m68k/mvme167/net/network.c
index 06bcbfa84a..56d61dd2f0 100644
--- a/bsps/m68k/mvme167/net/network.c
+++ b/bsps/m68k/mvme167/net/network.c
@@ -1,8 +1,7 @@
 /*  network.c: An 82596 ethernet driver for rtems-bsd.
  */
 
-#define __INSIDE_RTEMS_BSD_TCPIP_STACK__
-#define KERNEL
+#include <machine/rtems-bsd-kernel-space.h>
 
 /*
  *  Selectively define to debug the network driver. If you define any of these
diff --git a/bsps/m68k/uC5282/net/network.c b/bsps/m68k/uC5282/net/network.c
index b8afa0b968..49ce98a704 100644
--- a/bsps/m68k/uC5282/net/network.c
+++ b/bsps/m68k/uC5282/net/network.c
@@ -11,7 +11,7 @@
  *  http://www.rtems.org/license/LICENSE.
  */
 
-#define __INSIDE_RTEMS_BSD_TCPIP_STACK__
+#include <machine/rtems-bsd-kernel-space.h>
 
 #include <bsp.h>
 #include <stdio.h>
diff --git a/bsps/mips/csb350/net/network.c b/bsps/mips/csb350/net/network.c
index 15a1c320df..ba3b697cb8 100644
--- a/bsps/mips/csb350/net/network.c
+++ b/bsps/mips/csb350/net/network.c
@@ -13,7 +13,7 @@
  *  http://www.rtems.org/license/LICENSE.
  */
 
-#define __INSIDE_RTEMS_BSD_TCPIP_STACK__
+#include <machine/rtems-bsd-kernel-space.h>
 
 #include <rtems.h>
 #include <rtems/rtems_bsdnet.h>
diff --git a/bsps/powerpc/beatnik/net/porting/rtemscompat.h b/bsps/powerpc/beatnik/net/porting/rtemscompat.h
index 62821eb9ff..57d4ffbc11 100644
--- a/bsps/powerpc/beatnik/net/porting/rtemscompat.h
+++ b/bsps/powerpc/beatnik/net/porting/rtemscompat.h
@@ -37,7 +37,7 @@ static inline void  the_real_free(void *p)
 	return free(p);
 }
 
-#define __INSIDE_RTEMS_BSD_TCPIP_STACK__
+#include <machine/rtems-bsd-kernel-space.h>
 #include <rtems/rtems_bsdnet.h>
 #include <rtems/rtems_bsdnet_internal.h>
 #ifdef __i386__
diff --git a/bsps/powerpc/gen5200/net/network.c b/bsps/powerpc/gen5200/net/network.c
index 2e11915b26..cbc694ff7d 100644
--- a/bsps/powerpc/gen5200/net/network.c
+++ b/bsps/powerpc/gen5200/net/network.c
@@ -54,8 +54,7 @@
  *
  */
 
-#define __INSIDE_RTEMS_BSD_TCPIP_STACK__ 1
-#define __BSD_VISIBLE 1
+#include <machine/rtems-bsd-kernel-space.h>
 
 #include <rtems.h>
 #include <rtems/error.h>
diff --git a/bsps/powerpc/gen83xx/net/network.c b/bsps/powerpc/gen83xx/net/network.c
index b870673cd3..04267176fb 100644
--- a/bsps/powerpc/gen83xx/net/network.c
+++ b/bsps/powerpc/gen83xx/net/network.c
@@ -18,7 +18,7 @@
 | of the network interface driver                                 |
 \*===============================================================*/
 
-#define __INSIDE_RTEMS_BSD_TCPIP_STACK__
+#include <machine/rtems-bsd-kernel-space.h>
 
 #include <rtems.h>
 #include <rtems/rtems_bsdnet.h>
diff --git a/bsps/powerpc/haleakala/net/network.c b/bsps/powerpc/haleakala/net/network.c
index f77b03648f..41481255cb 100644
--- a/bsps/powerpc/haleakala/net/network.c
+++ b/bsps/powerpc/haleakala/net/network.c
@@ -12,7 +12,7 @@
  *
  */
 
-#define __INSIDE_RTEMS_BSD_TCPIP_STACK__
+#include <machine/rtems-bsd-kernel-space.h>
 
 #include <bsp.h>
 #include <stdio.h>
diff --git a/bsps/powerpc/mpc55xxevb/net/smsc9218i.c b/bsps/powerpc/mpc55xxevb/net/smsc9218i.c
index fb0b7aa113..30156a0d4f 100644
--- a/bsps/powerpc/mpc55xxevb/net/smsc9218i.c
+++ b/bsps/powerpc/mpc55xxevb/net/smsc9218i.c
@@ -26,8 +26,7 @@
 
 #if defined(RTEMS_NETWORKING) && defined(MPC55XX_HAS_SIU)
 
-#define __INSIDE_RTEMS_BSD_TCPIP_STACK__ 1
-#define __BSD_VISIBLE 1
+#include <machine/rtems-bsd-kernel-space.h>
 
 #include <errno.h>
 #include <assert.h>
diff --git a/bsps/powerpc/mpc8260ads/net/if_hdlcsubr.c b/bsps/powerpc/mpc8260ads/net/if_hdlcsubr.c
index 350efdbc22..0c9cb8a842 100644
--- a/bsps/powerpc/mpc8260ads/net/if_hdlcsubr.c
+++ b/bsps/powerpc/mpc8260ads/net/if_hdlcsubr.c
@@ -47,14 +47,13 @@
  *	@(#)if_ethersubr.c	8.1 (Berkeley) 6/10/93
  */
 
-#define __INSIDE_RTEMS_BSD_TCPIP_STACK__
+#include <machine/rtems-bsd-kernel-space.h>
 
 #include <rtems/rtems_bsdnet.h>
 
 #include <sys/param.h>
 /*#include <sys/systm.h>
 #include <sys/kernel.h> */
-#define KERNEL
 #include <sys/malloc.h>
 #include <sys/mbuf.h>
 #include <sys/protosw.h>
diff --git a/bsps/powerpc/mpc8260ads/net/network.c b/bsps/powerpc/mpc8260ads/net/network.c
index fb87fc0e64..31cf96a800 100644
--- a/bsps/powerpc/mpc8260ads/net/network.c
+++ b/bsps/powerpc/mpc8260ads/net/network.c
@@ -24,7 +24,7 @@
  * eric at skatter.usask.ca
  */
 
-#define __INSIDE_RTEMS_BSD_TCPIP_STACK__
+#include <machine/rtems-bsd-kernel-space.h>
 
 #include <bsp.h>
 #include <bsp/irq.h>
diff --git a/bsps/powerpc/mvme3100/net/tsec.c b/bsps/powerpc/mvme3100/net/tsec.c
index 37a24099c0..23afbc0ba3 100644
--- a/bsps/powerpc/mvme3100/net/tsec.c
+++ b/bsps/powerpc/mvme3100/net/tsec.c
@@ -44,7 +44,7 @@
  * ------------------ SLAC Software Notices, Set 4 OTT.002a, 2004 FEB 03
  */
 
-#define __INSIDE_RTEMS_BSD_TCPIP_STACK__
+#include <machine/rtems-bsd-kernel-space.h>
 
 #include <rtems.h>
 #include <rtems/error.h>
@@ -56,13 +56,6 @@
 #include <assert.h>
 #include <bsp.h>
 
-#ifndef KERNEL
-#define KERNEL
-#endif
-#ifndef _KERNEL
-#define _KERNEL
-#endif
-
 #include <rtems/rtems_bsdnet.h>
 #include <sys/param.h>
 #include <sys/mbuf.h>
diff --git a/bsps/powerpc/mvme5500/net/if_100MHz/GT64260eth.c b/bsps/powerpc/mvme5500/net/if_100MHz/GT64260eth.c
index fa1d9471dd..ea29d766b3 100644
--- a/bsps/powerpc/mvme5500/net/if_100MHz/GT64260eth.c
+++ b/bsps/powerpc/mvme5500/net/if_100MHz/GT64260eth.c
@@ -19,7 +19,7 @@
  *
  */
 
-#define __INSIDE_RTEMS_BSD_TCPIP_STACK__
+#include <machine/rtems-bsd-kernel-space.h>
 
 #define BYTE_ORDER BIG_ENDIAN
 
diff --git a/bsps/powerpc/mvme5500/net/if_1GHz/if_wm.c b/bsps/powerpc/mvme5500/net/if_1GHz/if_wm.c
index dc89399b6c..11705ac04b 100644
--- a/bsps/powerpc/mvme5500/net/if_1GHz/if_wm.c
+++ b/bsps/powerpc/mvme5500/net/if_1GHz/if_wm.c
@@ -30,7 +30,7 @@
  *
  */
 
-#define __INSIDE_RTEMS_BSD_TCPIP_STACK__
+#include <machine/rtems-bsd-kernel-space.h>
 
 #define BYTE_ORDER BIG_ENDIAN
 
diff --git a/bsps/powerpc/qoriq/net/if_intercom.c b/bsps/powerpc/qoriq/net/if_intercom.c
index b692ced655..3fe7d84824 100644
--- a/bsps/powerpc/qoriq/net/if_intercom.c
+++ b/bsps/powerpc/qoriq/net/if_intercom.c
@@ -12,8 +12,7 @@
  * http://www.rtems.org/license/LICENSE.
  */
 
-#define __INSIDE_RTEMS_BSD_TCPIP_STACK__ 1
-#define __BSD_VISIBLE 1
+#include <machine/rtems-bsd-kernel-space.h>
 
 #include <assert.h>
 #include <errno.h>
diff --git a/bsps/powerpc/qoriq/net/network.c b/bsps/powerpc/qoriq/net/network.c
index 208b1a5434..15eeef0705 100644
--- a/bsps/powerpc/qoriq/net/network.c
+++ b/bsps/powerpc/qoriq/net/network.c
@@ -20,8 +20,7 @@
  * http://www.rtems.org/license/LICENSE.
  */
 
-#define __INSIDE_RTEMS_BSD_TCPIP_STACK__ 1
-#define __BSD_VISIBLE 1
+#include <machine/rtems-bsd-kernel-space.h>
 
 #include <assert.h>
 #include <string.h>
diff --git a/bsps/powerpc/shared/net/tsec.c b/bsps/powerpc/shared/net/tsec.c
index ea1c29052e..3dc77b0c8e 100644
--- a/bsps/powerpc/shared/net/tsec.c
+++ b/bsps/powerpc/shared/net/tsec.c
@@ -17,7 +17,7 @@
 | this file contains the MPC83xx TSEC networking driver           |
 \*===============================================================*/
 
-#define __INSIDE_RTEMS_BSD_TCPIP_STACK__
+#include <machine/rtems-bsd-kernel-space.h>
 
 #include <stdlib.h>
 #include <bsp.h>
diff --git a/bsps/powerpc/tqm8xx/net/network_fec.c b/bsps/powerpc/tqm8xx/net/network_fec.c
index a2a3016801..dec7de4f43 100644
--- a/bsps/powerpc/tqm8xx/net/network_fec.c
+++ b/bsps/powerpc/tqm8xx/net/network_fec.c
@@ -48,7 +48,7 @@
  *  Copyright (c) 1999, National Research Council of Canada
  */
 
-#define __INSIDE_RTEMS_BSD_TCPIP_STACK__
+#include <machine/rtems-bsd-kernel-space.h>
 
 #include <bsp.h>
 #include <stdio.h>
diff --git a/bsps/powerpc/tqm8xx/net/network_scc.c b/bsps/powerpc/tqm8xx/net/network_scc.c
index 98acbb3e7a..e263beba40 100644
--- a/bsps/powerpc/tqm8xx/net/network_scc.c
+++ b/bsps/powerpc/tqm8xx/net/network_scc.c
@@ -45,7 +45,7 @@
  *  Copyright (c) 1999, National Research Council of Canada
  */
 
-#define __INSIDE_RTEMS_BSD_TCPIP_STACK__
+#include <machine/rtems-bsd-kernel-space.h>
 
 #include <bsp.h>
 #include <stdio.h>
diff --git a/bsps/powerpc/virtex/net/xiltemac.c b/bsps/powerpc/virtex/net/xiltemac.c
index 1c3a461466..2e8b31b5f2 100644
--- a/bsps/powerpc/virtex/net/xiltemac.c
+++ b/bsps/powerpc/virtex/net/xiltemac.c
@@ -10,7 +10,7 @@
  *
  */
 
-#define __INSIDE_RTEMS_BSD_TCPIP_STACK__
+#include <machine/rtems-bsd-kernel-space.h>
 #define PPC_HAS_CLASSIC_EXCEPTIONS FALSE
 
 #include <bsp.h>
diff --git a/bsps/shared/net/cs8900.c b/bsps/shared/net/cs8900.c
index 650a0e1fef..452a33a372 100644
--- a/bsps/shared/net/cs8900.c
+++ b/bsps/shared/net/cs8900.c
@@ -23,7 +23,7 @@
 
 */
 
-#define __INSIDE_RTEMS_BSD_TCPIP_STACK__
+#include <machine/rtems-bsd-kernel-space.h>
 
 #include <errno.h>
 #include <string.h>
diff --git a/bsps/shared/net/dec21140.c b/bsps/shared/net/dec21140.c
index 6fd3d5b33f..382f3d6b70 100644
--- a/bsps/shared/net/dec21140.c
+++ b/bsps/shared/net/dec21140.c
@@ -35,7 +35,7 @@
  *
  */
 
-#define __INSIDE_RTEMS_BSD_TCPIP_STACK__
+#include <machine/rtems-bsd-kernel-space.h>
 
 #include <rtems.h>
 #include <inttypes.h>
diff --git a/bsps/shared/net/elnk.c b/bsps/shared/net/elnk.c
index 29adbe9c21..85af4b5043 100644
--- a/bsps/shared/net/elnk.c
+++ b/bsps/shared/net/elnk.c
@@ -62,7 +62,7 @@
  * THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-#define __INSIDE_RTEMS_BSD_TCPIP_STACK__
+#include <machine/rtems-bsd-kernel-space.h>
 
 #include <rtems.h>
 
diff --git a/bsps/shared/net/greth2.c b/bsps/shared/net/greth2.c
index 20be83ee48..78886f57b7 100644
--- a/bsps/shared/net/greth2.c
+++ b/bsps/shared/net/greth2.c
@@ -9,7 +9,7 @@
  * 2007-09-07, Ported GBIT support from 4.6.5
  */
 
-#define __INSIDE_RTEMS_BSD_TCPIP_STACK__
+#include <machine/rtems-bsd-kernel-space.h>
 
 #include <rtems.h>
 #include <bsp.h>
diff --git a/bsps/shared/net/i82586.c b/bsps/shared/net/i82586.c
index c79af66e0d..8933ddf3c4 100644
--- a/bsps/shared/net/i82586.c
+++ b/bsps/shared/net/i82586.c
@@ -147,7 +147,7 @@ Mode of operation:
    the synchronization.
 */
 
-#define __INSIDE_RTEMS_BSD_TCPIP_STACK__
+#include <machine/rtems-bsd-kernel-space.h>
 
 #include <rtems.h>
 #include <rtems/error.h>
diff --git a/bsps/shared/net/if_dc.c b/bsps/shared/net/if_dc.c
index e822a7c533..69e84944c0 100644
--- a/bsps/shared/net/if_dc.c
+++ b/bsps/shared/net/if_dc.c
@@ -99,7 +99,7 @@
  *  from being compiled on systems which can't support this driver.
  */
 
-#define __INSIDE_RTEMS_BSD_TCPIP_STACK__
+#include <machine/rtems-bsd-kernel-space.h>
 
 #if defined(DRIVER_SUPPORTED)
 	#undef DRIVER_SUPPORTED
diff --git a/bsps/shared/net/if_fxp.c b/bsps/shared/net/if_fxp.c
index 2fe9a5c403..2bf99077f7 100644
--- a/bsps/shared/net/if_fxp.c
+++ b/bsps/shared/net/if_fxp.c
@@ -55,7 +55,7 @@
  *     Original RTEMS modifications.
  */
 
-#define __INSIDE_RTEMS_BSD_TCPIP_STACK__
+#include <machine/rtems-bsd-kernel-space.h>
 
 #if defined(__i386__)
 
diff --git a/bsps/shared/net/open_eth.c b/bsps/shared/net/open_eth.c
index 88df0882cf..2335b7f2e1 100644
--- a/bsps/shared/net/open_eth.c
+++ b/bsps/shared/net/open_eth.c
@@ -19,7 +19,7 @@
  *        that used by this driver.
  */
 
-#define __INSIDE_RTEMS_BSD_TCPIP_STACK__
+#include <machine/rtems-bsd-kernel-space.h>
 
 #if defined(__i386__) || defined(__arm__) || defined(__PPC__)
   #define OPENETH_NOT_SUPPORTED
diff --git a/bsps/shared/net/smc91111.c b/bsps/shared/net/smc91111.c
index 45c87e8245..61703c7334 100644
--- a/bsps/shared/net/smc91111.c
+++ b/bsps/shared/net/smc91111.c
@@ -1,4 +1,4 @@
-#define __INSIDE_RTEMS_BSD_TCPIP_STACK__
+#include <machine/rtems-bsd-kernel-space.h>
 
 #include <rtems.h>
 #include <errno.h>
diff --git a/bsps/shared/net/sonic.c b/bsps/shared/net/sonic.c
index dc97008b8d..77e3651023 100644
--- a/bsps/shared/net/sonic.c
+++ b/bsps/shared/net/sonic.c
@@ -31,7 +31,7 @@
  *  interrupt-free transmission by Jiri, 22/03/1999.
  */
 
-#define __INSIDE_RTEMS_BSD_TCPIP_STACK__
+#include <machine/rtems-bsd-kernel-space.h>
 
 #include <rtems.h>
 #include <rtems/rtems_bsdnet.h>
diff --git a/bsps/sparc/erc32/net/erc32sonic.c b/bsps/sparc/erc32/net/erc32sonic.c
index ce108bd825..af37b42598 100644
--- a/bsps/sparc/erc32/net/erc32sonic.c
+++ b/bsps/sparc/erc32/net/erc32sonic.c
@@ -20,7 +20,7 @@
  *  http://www.rtems.org/license/LICENSE.
  */
 
-#define __INSIDE_RTEMS_BSD_TCPIP_STACK__
+#include <machine/rtems-bsd-kernel-space.h>
 
 #include <bsp.h>
 #include <libchip/sonic.h>
diff --git a/bsps/sparc/leon2/net/leon_open_eth.c b/bsps/sparc/leon2/net/leon_open_eth.c
index 27b04cd386..326850e248 100644
--- a/bsps/sparc/leon2/net/leon_open_eth.c
+++ b/bsps/sparc/leon2/net/leon_open_eth.c
@@ -13,7 +13,7 @@
  * http://www.rtems.org/license/LICENSE.
  */
 
-#define __INSIDE_RTEMS_BSD_TCPIP_STACK__
+#include <machine/rtems-bsd-kernel-space.h>
 
 #include <bsp.h>
 #include <libchip/open_eth.h>
diff --git a/bsps/sparc/leon2/net/leon_smc91111.c b/bsps/sparc/leon2/net/leon_smc91111.c
index 748ca35491..68c359edda 100644
--- a/bsps/sparc/leon2/net/leon_smc91111.c
+++ b/bsps/sparc/leon2/net/leon_smc91111.c
@@ -13,7 +13,7 @@
  * http://www.rtems.org/license/LICENSE.
  */
 
-#define __INSIDE_RTEMS_BSD_TCPIP_STACK__
+#include <machine/rtems-bsd-kernel-space.h>
 
 #include <rtems.h>
 
diff --git a/bsps/sparc/leon3/net/leon_greth.c b/bsps/sparc/leon3/net/leon_greth.c
index d630522a5d..7878d80f0f 100644
--- a/bsps/sparc/leon3/net/leon_greth.c
+++ b/bsps/sparc/leon3/net/leon_greth.c
@@ -9,7 +9,7 @@
  *  http://www.rtems.org/license/LICENSE.
  */
 
-#define __INSIDE_RTEMS_BSD_TCPIP_STACK__
+#include <machine/rtems-bsd-kernel-space.h>
 
 #include <bsp.h>
 #include <libchip/greth.h>
diff --git a/bsps/sparc/leon3/net/leon_open_eth.c b/bsps/sparc/leon3/net/leon_open_eth.c
index c59d613d75..5b9794cb89 100644
--- a/bsps/sparc/leon3/net/leon_open_eth.c
+++ b/bsps/sparc/leon3/net/leon_open_eth.c
@@ -13,7 +13,7 @@
  * http://www.rtems.org/license/LICENSE.
  */
 
-#define __INSIDE_RTEMS_BSD_TCPIP_STACK__
+#include <machine/rtems-bsd-kernel-space.h>
 
 #include <bsp.h>
 #include <libchip/open_eth.h>
diff --git a/bsps/sparc/leon3/net/leon_smc91111.c b/bsps/sparc/leon3/net/leon_smc91111.c
index e4adac6c2b..5111f4936a 100644
--- a/bsps/sparc/leon3/net/leon_smc91111.c
+++ b/bsps/sparc/leon3/net/leon_smc91111.c
@@ -13,7 +13,7 @@
  * http://www.rtems.org/license/LICENSE.
  */
 
-#define __INSIDE_RTEMS_BSD_TCPIP_STACK__
+#include <machine/rtems-bsd-kernel-space.h>
 
 #include <bsp.h>
 #include <libchip/smc91111exp.h>
diff --git a/bsps/sparc/shared/net/greth.c b/bsps/sparc/shared/net/greth.c
index d2824516a0..649ae9df24 100644
--- a/bsps/sparc/shared/net/greth.c
+++ b/bsps/sparc/shared/net/greth.c
@@ -12,10 +12,9 @@
  *  2007-09-07, Ported GBIT support from 4.6.5
  */
 
-#define __INSIDE_RTEMS_BSD_TCPIP_STACK__
+#include <machine/rtems-bsd-kernel-space.h>
 
 #include <rtems.h>
-#define _KERNEL
 #define CPU_U32_FIX
 #include <bsp.h>
 
diff --git a/cpukit/libfs/src/nfsclient/src/sock_mbuf.c b/cpukit/libfs/src/nfsclient/src/sock_mbuf.c
index 2712d763e0..d8acd07a3d 100644
--- a/cpukit/libfs/src/nfsclient/src/sock_mbuf.c
+++ b/cpukit/libfs/src/nfsclient/src/sock_mbuf.c
@@ -79,7 +79,6 @@
 #endif
 
 #define _KERNEL
-#define __BSD_VISIBLE	1
 
 #include <string.h>
 #include <stdarg.h>
diff --git a/cpukit/libnetworking/Makefile.am b/cpukit/libnetworking/Makefile.am
index 9c49348c02..1615db0844 100644
--- a/cpukit/libnetworking/Makefile.am
+++ b/cpukit/libnetworking/Makefile.am
@@ -17,118 +17,124 @@ $(PROJECT_LIB)/libtftpfs.a: libtftpfs.a
 TMPINSTALL_FILES += $(PROJECT_LIB)/libtftpfs.a
 
 if LIBNETWORKING
-# Add -DFORWARD_PROTOCOL to enable UDP forwarding -- requires missing net/pf.h
-libnetworking_CPPFLAGS = -DINET -DNFS \
-    -DDIAGNOSTIC -DBOOTP_COMPAT -D_KERNEL -D__BSD_VISIBLE
-
 noinst_LIBRARIES = libnetworking.a
-libnetworking_a_CPPFLAGS = $(AM_CPPFLAGS) $(libnetworking_CPPFLAGS)
-
-## poll.h is not in the list because RTEMS does not have poll()
-## and installing poll.h confuses autoconf.
-libnetworking_a_SOURCES = opt_atalk.h opt_bdg.h opt_compat.h opt_inet6.h \
-    opt_inet.h opt_ipfw.h opt_ipx.h opt_mac.h opt_mrouting.h opt_netgraph.h \
-    opt_tcpdebug.h opt_ipsec.h loop.h
-libnetworking_a_SOURCES += opt_ppp.h
-libnetworking_a_SOURCES += bpfilter.h
-
-# arpa
-
-## kern
-
-libnetworking_a_SOURCES += kern/kern_mib.c kern/kern_subr.c \
-    kern/kern_sysctl.c kern/uipc_domain.c kern/uipc_mbuf.c \
-    kern/uipc_socket.c kern/uipc_socket2.c
-
-## machine
-
-libnetworking_a_SOURCES += machine/limits.h
-
-## net
-
-libnetworking_a_SOURCES += net/if.c net/if_ethersubr.c net/if_loop.c \
-    net/radix.c net/route.c net/rtsock.c net/raw_cb.c net/raw_usrreq.c \
-    net/if_ppp.c net/ppp_tty.c net/slcompress.c
-
-## netinet
-
-libnetworking_a_SOURCES += netinet/if_ether.c netinet/igmp.c netinet/in.c \
-    netinet/in_cksum.c netinet/in_pcb.c netinet/in_proto.c netinet/in_rmx.c \
-    netinet/ip_divert.c netinet/ip_fw.c netinet/ip_icmp.c netinet/ip_input.c \
-    netinet/ip_mroute.c netinet/ip_output.c netinet/raw_ip.c \
-    netinet/tcp_debug.c netinet/tcp_input.c netinet/tcp_output.c \
-    netinet/tcp_subr.c netinet/tcp_timer.c netinet/tcp_usrreq.c \
-    netinet/udp_usrreq.c netinet/in_cksum_arm.h netinet/in_cksum_i386.h \
-    netinet/in_cksum_m68k.h netinet/in_cksum_powerpc.h
-
-## netinet6
-
-
-## nfs
-
+libnetworking_a_SOURCES =
+libnetworking_a_SOURCES += kern/kern_mib.c
+libnetworking_a_SOURCES += kern/kern_subr.c
+libnetworking_a_SOURCES += kern/kern_sysctl.c
+libnetworking_a_SOURCES += kern/uipc_domain.c
+libnetworking_a_SOURCES += kern/uipc_mbuf.c
+libnetworking_a_SOURCES += kern/uipc_socket2.c
+libnetworking_a_SOURCES += kern/uipc_socket.c
+libnetworking_a_SOURCES += libc/base64.c
+libnetworking_a_SOURCES += libc/gethostbydns.c
+libnetworking_a_SOURCES += libc/gethostbyht.c
+libnetworking_a_SOURCES += libc/gethostbynis.c
+libnetworking_a_SOURCES += libc/gethostnamadr.c
+libnetworking_a_SOURCES += libc/getifaddrs.c
+libnetworking_a_SOURCES += libc/getnameinfo.c
+libnetworking_a_SOURCES += libc/getnetbydns.c
+libnetworking_a_SOURCES += libc/getnetbyht.c
+libnetworking_a_SOURCES += libc/getnetbynis.c
+libnetworking_a_SOURCES += libc/getnetnamadr.c
+libnetworking_a_SOURCES += libc/getproto.c
+libnetworking_a_SOURCES += libc/getprotoent.c
+libnetworking_a_SOURCES += libc/getprotoname.c
+libnetworking_a_SOURCES += libc/getservbyname.c
+libnetworking_a_SOURCES += libc/getservbyport.c
+libnetworking_a_SOURCES += libc/getservent.c
+libnetworking_a_SOURCES += libc/herror.c
+libnetworking_a_SOURCES += libc/if_indextoname.c
+libnetworking_a_SOURCES += libc/if_nameindex.c
+libnetworking_a_SOURCES += libc/inet_addr.c
+libnetworking_a_SOURCES += libc/inet_lnaof.c
+libnetworking_a_SOURCES += libc/inet_makeaddr.c
+libnetworking_a_SOURCES += libc/inet_netof.c
+libnetworking_a_SOURCES += libc/inet_network.c
+libnetworking_a_SOURCES += libc/inet_ntoa.c
+libnetworking_a_SOURCES += libc/inet_ntop.c
+libnetworking_a_SOURCES += libc/inet_pton.c
+libnetworking_a_SOURCES += libc/linkaddr.c
+libnetworking_a_SOURCES += libc/map_v4v6.c
+libnetworking_a_SOURCES += libc/nsap_addr.c
+libnetworking_a_SOURCES += libc/ns_name.c
+libnetworking_a_SOURCES += libc/ns_netint.c
+libnetworking_a_SOURCES += libc/ns_parse.c
+libnetworking_a_SOURCES += libc/ns_print.c
+libnetworking_a_SOURCES += libc/ns_ttl.c
+libnetworking_a_SOURCES += libc/rcmd.c
+libnetworking_a_SOURCES += libc/recv.c
+libnetworking_a_SOURCES += libc/res_comp.c
+libnetworking_a_SOURCES += libc/res_data.c
+libnetworking_a_SOURCES += libc/res_debug.c
+libnetworking_a_SOURCES += libc/res_init.c
+libnetworking_a_SOURCES += libc/res_mkquery.c
+libnetworking_a_SOURCES += libc/res_mkupdate.c
+libnetworking_a_SOURCES += libc/res_query.c
+libnetworking_a_SOURCES += libc/res_send.c
+libnetworking_a_SOURCES += libc/res_stubs.c
+libnetworking_a_SOURCES += libc/res_update.c
+libnetworking_a_SOURCES += libc/send.c
+libnetworking_a_SOURCES += libc/strsep.c
+libnetworking_a_SOURCES += lib/getprotoby.c
+libnetworking_a_SOURCES += lib/rtems_bsdnet_ntp.c
+libnetworking_a_SOURCES += lib/syslog.c
+libnetworking_a_SOURCES += net/if.c
+libnetworking_a_SOURCES += net/if_ethersubr.c
+libnetworking_a_SOURCES += net/if_loop.c
+libnetworking_a_SOURCES += net/if_ppp.c
+libnetworking_a_SOURCES += netinet/if_ether.c
+libnetworking_a_SOURCES += netinet/igmp.c
+libnetworking_a_SOURCES += netinet/in.c
+libnetworking_a_SOURCES += netinet/in_cksum.c
+libnetworking_a_SOURCES += netinet/in_pcb.c
+libnetworking_a_SOURCES += netinet/in_proto.c
+libnetworking_a_SOURCES += netinet/in_rmx.c
+libnetworking_a_SOURCES += netinet/ip_divert.c
+libnetworking_a_SOURCES += netinet/ip_fw.c
+libnetworking_a_SOURCES += netinet/ip_icmp.c
+libnetworking_a_SOURCES += netinet/ip_input.c
+libnetworking_a_SOURCES += netinet/ip_mroute.c
+libnetworking_a_SOURCES += netinet/ip_output.c
+libnetworking_a_SOURCES += netinet/raw_ip.c
+libnetworking_a_SOURCES += netinet/tcp_debug.c
+libnetworking_a_SOURCES += netinet/tcp_input.c
+libnetworking_a_SOURCES += netinet/tcp_output.c
+libnetworking_a_SOURCES += netinet/tcp_subr.c
+libnetworking_a_SOURCES += netinet/tcp_timer.c
+libnetworking_a_SOURCES += netinet/tcp_usrreq.c
+libnetworking_a_SOURCES += netinet/udp_usrreq.c
+libnetworking_a_SOURCES += net/ppp_tty.c
+libnetworking_a_SOURCES += net/radix.c
+libnetworking_a_SOURCES += net/raw_cb.c
+libnetworking_a_SOURCES += net/raw_usrreq.c
+libnetworking_a_SOURCES += net/route.c
+libnetworking_a_SOURCES += net/rtsock.c
+libnetworking_a_SOURCES += net/slcompress.c
 libnetworking_a_SOURCES += nfs/bootp_subr.c
-
-## nfsclient
-## rtems
-
-libnetworking_a_SOURCES += rtems/sghostname.c \
-    rtems/rtems_glue.c rtems/rtems_malloc_mbuf.c rtems/rtems_syscall.c \
-    rtems/rtems_bootp.c rtems/rtems_dhcp.c rtems/rtems_dhcp_failsafe.c \
-    rtems/rtems_showmbuf.c rtems/rtems_showroute.c rtems/rtems_showifstat.c \
-    rtems/rtems_showipstat.c rtems/rtems_showicmpstat.c \
-    rtems/rtems_showtcpstat.c rtems/rtems_showudpstat.c rtems/rtems_select.c \
-    rtems/mkrootfs.c rtems/rtems_bsdnet_malloc_starvation.c \
-    rtems/rtems_mii_ioctl.c rtems/rtems_mii_ioctl_kern.c \
-    rtems/rtems_socketpair.c
-
-## sys
-
-# vm
-
-# dev
-## libc
-
-libc_CPPFLAGS = -DNOPOLL -DNOSELECT -D__BSD_VISIBLE -D_THREAD_SAFE
-
-noinst_LIBRARIES += libc.a
-libc_a_CPPFLAGS = $(AM_CPPFLAGS) $(libc_CPPFLAGS)
-
-libc_a_SOURCES = libc/base64.c \
-    libc/gethostbydns.c libc/gethostbyht.c libc/gethostbynis.c \
-    libc/gethostnamadr.c libc/getnetbydns.c libc/getnetbyht.c \
-    libc/getnetbynis.c libc/getnetnamadr.c libc/getnameinfo.c libc/getproto.c \
-    libc/getprotoent.c libc/getprotoname.c libc/getservbyname.c \
-    libc/getservbyport.c libc/getservent.c libc/herror.c libc/inet_addr.c \
-    libc/inet_lnaof.c libc/inet_makeaddr.c libc/inet_netof.c \
-    libc/inet_network.c libc/inet_ntoa.c libc/inet_ntop.c libc/inet_pton.c \
-    libc/linkaddr.c libc/map_v4v6.c libc/nsap_addr.c libc/ns_name.c \
-    libc/ns_netint.c libc/ns_parse.c libc/ns_print.c libc/ns_ttl.c \
-    libc/res_comp.c libc/res_data.c libc/res_debug.c libc/res_init.c \
-    libc/res_mkquery.c libc/res_mkupdate.c libc/res_query.c libc/res_send.c \
-    libc/res_stubs.c libc/res_update.c libc/strsep.c libc/rcmd.c
-libc_a_SOURCES += libc/res_config.h
-libc_a_SOURCES += libc/send.c
-libc_a_SOURCES += libc/recv.c
-libc_a_SOURCES += libc/getifaddrs.c
-libc_a_SOURCES += libc/if_indextoname.c
-libc_a_SOURCES += libc/if_nameindex.c
+libnetworking_a_SOURCES += rtems/mkrootfs.c
+libnetworking_a_SOURCES += rtems/rtems_bootp.c
+libnetworking_a_SOURCES += rtems/rtems_bsdnet_malloc_starvation.c
+libnetworking_a_SOURCES += rtems/rtems_dhcp.c
+libnetworking_a_SOURCES += rtems/rtems_dhcp_failsafe.c
+libnetworking_a_SOURCES += rtems/rtems_glue.c
+libnetworking_a_SOURCES += rtems/rtems_malloc_mbuf.c
+libnetworking_a_SOURCES += rtems/rtems_mii_ioctl.c
+libnetworking_a_SOURCES += rtems/rtems_mii_ioctl_kern.c
+libnetworking_a_SOURCES += rtems/rtems_select.c
+libnetworking_a_SOURCES += rtems/rtems_showicmpstat.c
+libnetworking_a_SOURCES += rtems/rtems_showifstat.c
+libnetworking_a_SOURCES += rtems/rtems_showipstat.c
+libnetworking_a_SOURCES += rtems/rtems_showmbuf.c
+libnetworking_a_SOURCES += rtems/rtems_showroute.c
+libnetworking_a_SOURCES += rtems/rtems_showtcpstat.c
+libnetworking_a_SOURCES += rtems/rtems_showudpstat.c
+libnetworking_a_SOURCES += rtems/rtems_socketpair.c
+libnetworking_a_SOURCES += rtems/rtems_syscall_api.c
+libnetworking_a_SOURCES += rtems/rtems_syscall.c
+libnetworking_a_SOURCES += rtems/sghostname.c
 endif
 
-if LIBNETWORKING
-## lib
-
-
-lib_CPPFLAGS = -DNOPOLL -DNOSELECT
-
-noinst_LIBRARIES += lib.a
-lib_a_CPPFLAGS = $(AM_CPPFLAGS) $(lib_CPPFLAGS) -D__BSD_VISIBLE
-
-lib_a_SOURCES = lib/getprotoby.c lib/rtems_bsdnet_ntp.c \
-    lib/syslog.c
-lib_a_SOURCES += rtems/rtems_syscall_api.c
-endif
-
-
 include $(top_srcdir)/automake/local.am
 if LIBNETWORKING
 include $(srcdir)/headers.am
diff --git a/cpukit/libnetworking/kern/kern_mib.c b/cpukit/libnetworking/kern/kern_mib.c
index 7895476133..c429ad4a8e 100644
--- a/cpukit/libnetworking/kern/kern_mib.c
+++ b/cpukit/libnetworking/kern/kern_mib.c
@@ -1,3 +1,5 @@
+#include <machine/rtems-bsd-kernel-space.h>
+
 /*-
  * Copyright (c) 1982, 1986, 1989, 1993
  *	The Regents of the University of California.  All rights reserved.
diff --git a/cpukit/libnetworking/kern/kern_subr.c b/cpukit/libnetworking/kern/kern_subr.c
index 9252d3049d..0c4b803eb5 100644
--- a/cpukit/libnetworking/kern/kern_subr.c
+++ b/cpukit/libnetworking/kern/kern_subr.c
@@ -1,3 +1,5 @@
+#include <machine/rtems-bsd-kernel-space.h>
+
 /*
  * Copyright (c) 1982, 1986, 1991, 1993
  *	The Regents of the University of California.  All rights reserved.
diff --git a/cpukit/libnetworking/kern/kern_sysctl.c b/cpukit/libnetworking/kern/kern_sysctl.c
index e2de690d55..c0a38f311b 100644
--- a/cpukit/libnetworking/kern/kern_sysctl.c
+++ b/cpukit/libnetworking/kern/kern_sysctl.c
@@ -1,3 +1,5 @@
+#include <machine/rtems-bsd-kernel-space.h>
+
 /*-
  * Copyright (c) 1982, 1986, 1989, 1993
  *	The Regents of the University of California.  All rights reserved.
diff --git a/cpukit/libnetworking/kern/uipc_domain.c b/cpukit/libnetworking/kern/uipc_domain.c
index 7d7dd7ff54..2e4b15182c 100644
--- a/cpukit/libnetworking/kern/uipc_domain.c
+++ b/cpukit/libnetworking/kern/uipc_domain.c
@@ -1,3 +1,5 @@
+#include <machine/rtems-bsd-kernel-space.h>
+
 /*
  * Copyright (c) 1982, 1986, 1993
  *	The Regents of the University of California.  All rights reserved.
diff --git a/cpukit/libnetworking/kern/uipc_mbuf.c b/cpukit/libnetworking/kern/uipc_mbuf.c
index 9d6b3c429f..2267ddbe61 100644
--- a/cpukit/libnetworking/kern/uipc_mbuf.c
+++ b/cpukit/libnetworking/kern/uipc_mbuf.c
@@ -1,3 +1,5 @@
+#include <machine/rtems-bsd-kernel-space.h>
+
 /*
  * Copyright (c) 1982, 1986, 1988, 1991, 1993
  *	The Regents of the University of California.  All rights reserved.
diff --git a/cpukit/libnetworking/kern/uipc_socket.c b/cpukit/libnetworking/kern/uipc_socket.c
index 110f8cebfc..c6220bd34e 100644
--- a/cpukit/libnetworking/kern/uipc_socket.c
+++ b/cpukit/libnetworking/kern/uipc_socket.c
@@ -1,3 +1,5 @@
+#include <machine/rtems-bsd-kernel-space.h>
+
 /*
  * Copyright (c) 1982, 1986, 1988, 1990, 1993
  *	The Regents of the University of California.  All rights reserved.
diff --git a/cpukit/libnetworking/kern/uipc_socket2.c b/cpukit/libnetworking/kern/uipc_socket2.c
index e6ea6725dd..137eb0f5f0 100644
--- a/cpukit/libnetworking/kern/uipc_socket2.c
+++ b/cpukit/libnetworking/kern/uipc_socket2.c
@@ -1,3 +1,5 @@
+#include <machine/rtems-bsd-kernel-space.h>
+
 /*
  * This file has undergone several changes to reflect the
  * differences between the RTEMS and FreeBSD kernels.
diff --git a/cpukit/libnetworking/lib/getprotoby.c b/cpukit/libnetworking/lib/getprotoby.c
index 88bffe06ec..4eeec598f8 100644
--- a/cpukit/libnetworking/lib/getprotoby.c
+++ b/cpukit/libnetworking/lib/getprotoby.c
@@ -1,3 +1,5 @@
+#include <machine/rtems-bsd-user-space.h>
+
 #ifdef HAVE_CONFIG_H
 #include "config.h"
 #endif
diff --git a/cpukit/libnetworking/lib/rtems_bsdnet_ntp.c b/cpukit/libnetworking/lib/rtems_bsdnet_ntp.c
index 35092ea631..e6757599ac 100644
--- a/cpukit/libnetworking/lib/rtems_bsdnet_ntp.c
+++ b/cpukit/libnetworking/lib/rtems_bsdnet_ntp.c
@@ -1,3 +1,5 @@
+#include <machine/rtems-bsd-user-space.h>
+
 /*
  * Synchronize with an NTP server
  *
diff --git a/cpukit/libnetworking/lib/syslog.c b/cpukit/libnetworking/lib/syslog.c
index 8f0cbc8885..8e167a41de 100644
--- a/cpukit/libnetworking/lib/syslog.c
+++ b/cpukit/libnetworking/lib/syslog.c
@@ -1,3 +1,5 @@
+#include <machine/rtems-bsd-user-space.h>
+
 /*
  * RTEMS version of syslog and associated routines
  */
diff --git a/cpukit/libnetworking/libc/base64.c b/cpukit/libnetworking/libc/base64.c
index 070cc52231..ad2db725d3 100644
--- a/cpukit/libnetworking/libc/base64.c
+++ b/cpukit/libnetworking/libc/base64.c
@@ -1,3 +1,5 @@
+#include <machine/rtems-bsd-user-space.h>
+
 /*
  * Copyright (c) 1996, 1998 by Internet Software Consortium.
  *
diff --git a/cpukit/libnetworking/libc/gethostbydns.c b/cpukit/libnetworking/libc/gethostbydns.c
index 7300ef4564..3d967e9fe5 100644
--- a/cpukit/libnetworking/libc/gethostbydns.c
+++ b/cpukit/libnetworking/libc/gethostbydns.c
@@ -1,3 +1,5 @@
+#include <machine/rtems-bsd-user-space.h>
+
 /*
  * ++Copyright++ 1985, 1988, 1993
  * -
diff --git a/cpukit/libnetworking/libc/gethostbyht.c b/cpukit/libnetworking/libc/gethostbyht.c
index 279514ea89..6d9fc1e0a5 100644
--- a/cpukit/libnetworking/libc/gethostbyht.c
+++ b/cpukit/libnetworking/libc/gethostbyht.c
@@ -1,3 +1,5 @@
+#include <machine/rtems-bsd-user-space.h>
+
 /*-
  * Copyright (c) 1985, 1988, 1993
  *	The Regents of the University of California.  All rights reserved.
diff --git a/cpukit/libnetworking/libc/gethostbynis.c b/cpukit/libnetworking/libc/gethostbynis.c
index 3a4195c187..d157f3c777 100644
--- a/cpukit/libnetworking/libc/gethostbynis.c
+++ b/cpukit/libnetworking/libc/gethostbynis.c
@@ -1,3 +1,5 @@
+#include <machine/rtems-bsd-user-space.h>
+
 /*-
  * Copyright (c) 1994, Garrett Wollman
  *
diff --git a/cpukit/libnetworking/libc/gethostnamadr.c b/cpukit/libnetworking/libc/gethostnamadr.c
index cf0a12d68f..df6a4a25d3 100644
--- a/cpukit/libnetworking/libc/gethostnamadr.c
+++ b/cpukit/libnetworking/libc/gethostnamadr.c
@@ -1,3 +1,5 @@
+#include <machine/rtems-bsd-user-space.h>
+
 /*-
  * Copyright (c) 1994, Garrett Wollman
  *
diff --git a/cpukit/libnetworking/libc/getifaddrs.c b/cpukit/libnetworking/libc/getifaddrs.c
index b5979cd372..354b3f2e9d 100644
--- a/cpukit/libnetworking/libc/getifaddrs.c
+++ b/cpukit/libnetworking/libc/getifaddrs.c
@@ -1,3 +1,5 @@
+#include <machine/rtems-bsd-user-space.h>
+
 /*	$KAME: getifaddrs.c,v 1.9 2001/08/20 02:31:20 itojun Exp $	*/
 
 /*
diff --git a/cpukit/libnetworking/libc/getnameinfo.c b/cpukit/libnetworking/libc/getnameinfo.c
index 99a253f0ec..2955bf4aa1 100644
--- a/cpukit/libnetworking/libc/getnameinfo.c
+++ b/cpukit/libnetworking/libc/getnameinfo.c
@@ -1,3 +1,5 @@
+#include <machine/rtems-bsd-user-space.h>
+
 /*
  * Copyright (c) 2016 embedded brains GmbH.  All rights reserved.
  *
diff --git a/cpukit/libnetworking/libc/getnetbydns.c b/cpukit/libnetworking/libc/getnetbydns.c
index adbd0c9e4c..70f23124fc 100644
--- a/cpukit/libnetworking/libc/getnetbydns.c
+++ b/cpukit/libnetworking/libc/getnetbydns.c
@@ -1,3 +1,5 @@
+#include <machine/rtems-bsd-user-space.h>
+
 /*-
  * Copyright (c) 1985, 1988, 1993
  *	The Regents of the University of California.  All rights reserved.
diff --git a/cpukit/libnetworking/libc/getnetbyht.c b/cpukit/libnetworking/libc/getnetbyht.c
index 4a388c7dd4..9e21767c32 100644
--- a/cpukit/libnetworking/libc/getnetbyht.c
+++ b/cpukit/libnetworking/libc/getnetbyht.c
@@ -1,3 +1,5 @@
+#include <machine/rtems-bsd-user-space.h>
+
 /*
  * Copyright (c) 1983, 1993
  *	The Regents of the University of California.  All rights reserved.
diff --git a/cpukit/libnetworking/libc/getnetbynis.c b/cpukit/libnetworking/libc/getnetbynis.c
index 14f09bca58..1aa426f102 100644
--- a/cpukit/libnetworking/libc/getnetbynis.c
+++ b/cpukit/libnetworking/libc/getnetbynis.c
@@ -1,3 +1,5 @@
+#include <machine/rtems-bsd-user-space.h>
+
 /*-
  * Copyright (c) 1994, Garrett Wollman
  *
diff --git a/cpukit/libnetworking/libc/getnetnamadr.c b/cpukit/libnetworking/libc/getnetnamadr.c
index 7cb1b1bc08..0e11ba665d 100644
--- a/cpukit/libnetworking/libc/getnetnamadr.c
+++ b/cpukit/libnetworking/libc/getnetnamadr.c
@@ -1,3 +1,5 @@
+#include <machine/rtems-bsd-user-space.h>
+
 /*-
  * Copyright (c) 1994, Garrett Wollman
  *
diff --git a/cpukit/libnetworking/libc/getproto.c b/cpukit/libnetworking/libc/getproto.c
index 8b107331ab..6c6149aeff 100644
--- a/cpukit/libnetworking/libc/getproto.c
+++ b/cpukit/libnetworking/libc/getproto.c
@@ -1,3 +1,5 @@
+#include <machine/rtems-bsd-user-space.h>
+
 /*
  * Copyright (c) 1983, 1993
  *	The Regents of the University of California.  All rights reserved.
diff --git a/cpukit/libnetworking/libc/getprotoent.c b/cpukit/libnetworking/libc/getprotoent.c
index eefd7f593b..6b046eabe4 100644
--- a/cpukit/libnetworking/libc/getprotoent.c
+++ b/cpukit/libnetworking/libc/getprotoent.c
@@ -1,3 +1,5 @@
+#include <machine/rtems-bsd-user-space.h>
+
 /*
  * Copyright (c) 1983, 1993
  *	The Regents of the University of California.  All rights reserved.
diff --git a/cpukit/libnetworking/libc/getprotoname.c b/cpukit/libnetworking/libc/getprotoname.c
index 63c5ee5207..ee8b2f5443 100644
--- a/cpukit/libnetworking/libc/getprotoname.c
+++ b/cpukit/libnetworking/libc/getprotoname.c
@@ -1,3 +1,5 @@
+#include <machine/rtems-bsd-user-space.h>
+
 /*
  * Copyright (c) 1983, 1993
  *	The Regents of the University of California.  All rights reserved.
diff --git a/cpukit/libnetworking/libc/getservbyname.c b/cpukit/libnetworking/libc/getservbyname.c
index bf2e643385..80c9284175 100644
--- a/cpukit/libnetworking/libc/getservbyname.c
+++ b/cpukit/libnetworking/libc/getservbyname.c
@@ -1,3 +1,5 @@
+#include <machine/rtems-bsd-user-space.h>
+
 /*
  * Copyright (c) 1983, 1993
  *	The Regents of the University of California.  All rights reserved.
diff --git a/cpukit/libnetworking/libc/getservbyport.c b/cpukit/libnetworking/libc/getservbyport.c
index db3ce400b8..9bc0ab3c36 100644
--- a/cpukit/libnetworking/libc/getservbyport.c
+++ b/cpukit/libnetworking/libc/getservbyport.c
@@ -1,3 +1,5 @@
+#include <machine/rtems-bsd-user-space.h>
+
 /*
  * Copyright (c) 1983, 1993
  *	The Regents of the University of California.  All rights reserved.
diff --git a/cpukit/libnetworking/libc/getservent.c b/cpukit/libnetworking/libc/getservent.c
index dc1fc9ca95..a82e3a82d4 100644
--- a/cpukit/libnetworking/libc/getservent.c
+++ b/cpukit/libnetworking/libc/getservent.c
@@ -1,3 +1,5 @@
+#include <machine/rtems-bsd-user-space.h>
+
 /*
  * Copyright (c) 1983, 1993
  *	The Regents of the University of California.  All rights reserved.
diff --git a/cpukit/libnetworking/libc/herror.c b/cpukit/libnetworking/libc/herror.c
index bb1112f336..d6ebcb90c6 100644
--- a/cpukit/libnetworking/libc/herror.c
+++ b/cpukit/libnetworking/libc/herror.c
@@ -1,3 +1,5 @@
+#include <machine/rtems-bsd-user-space.h>
+
 /*
  * Copyright (c) 1987, 1993
  *	The Regents of the University of California.  All rights reserved.
diff --git a/cpukit/libnetworking/libc/if_indextoname.c b/cpukit/libnetworking/libc/if_indextoname.c
index 32a499590e..467c2eb1e5 100644
--- a/cpukit/libnetworking/libc/if_indextoname.c
+++ b/cpukit/libnetworking/libc/if_indextoname.c
@@ -1,3 +1,5 @@
+#include <machine/rtems-bsd-user-space.h>
+
 /*	$KAME: if_indextoname.c,v 1.7 2000/11/08 03:09:30 itojun Exp $	*/
 
 /*-
diff --git a/cpukit/libnetworking/libc/if_nameindex.c b/cpukit/libnetworking/libc/if_nameindex.c
index 8c1ebb8381..7c7777f543 100644
--- a/cpukit/libnetworking/libc/if_nameindex.c
+++ b/cpukit/libnetworking/libc/if_nameindex.c
@@ -1,3 +1,5 @@
+#include <machine/rtems-bsd-user-space.h>
+
 /*	$KAME: if_nameindex.c,v 1.8 2000/11/24 08:20:01 itojun Exp $	*/
 
 /*-
diff --git a/cpukit/libnetworking/libc/inet_addr.c b/cpukit/libnetworking/libc/inet_addr.c
index af72d507a4..d014266ac2 100644
--- a/cpukit/libnetworking/libc/inet_addr.c
+++ b/cpukit/libnetworking/libc/inet_addr.c
@@ -1,3 +1,5 @@
+#include <machine/rtems-bsd-user-space.h>
+
 /*
  * Copyright (c) 1983, 1990, 1993
  *    The Regents of the University of California.  All rights reserved.
diff --git a/cpukit/libnetworking/libc/inet_lnaof.c b/cpukit/libnetworking/libc/inet_lnaof.c
index 717daed64b..f9e182b869 100644
--- a/cpukit/libnetworking/libc/inet_lnaof.c
+++ b/cpukit/libnetworking/libc/inet_lnaof.c
@@ -1,3 +1,5 @@
+#include <machine/rtems-bsd-user-space.h>
+
 /*
  * Copyright (c) 1983, 1993
  *	The Regents of the University of California.  All rights reserved.
diff --git a/cpukit/libnetworking/libc/inet_makeaddr.c b/cpukit/libnetworking/libc/inet_makeaddr.c
index 0a14d191b1..887c611906 100644
--- a/cpukit/libnetworking/libc/inet_makeaddr.c
+++ b/cpukit/libnetworking/libc/inet_makeaddr.c
@@ -1,3 +1,5 @@
+#include <machine/rtems-bsd-user-space.h>
+
 /*
  * Copyright (c) 1983, 1993
  *	The Regents of the University of California.  All rights reserved.
diff --git a/cpukit/libnetworking/libc/inet_netof.c b/cpukit/libnetworking/libc/inet_netof.c
index 65655124bf..8ff3407376 100644
--- a/cpukit/libnetworking/libc/inet_netof.c
+++ b/cpukit/libnetworking/libc/inet_netof.c
@@ -1,3 +1,5 @@
+#include <machine/rtems-bsd-user-space.h>
+
 /*
  * Copyright (c) 1983, 1993
  *	The Regents of the University of California.  All rights reserved.
diff --git a/cpukit/libnetworking/libc/inet_network.c b/cpukit/libnetworking/libc/inet_network.c
index 92c3af34ef..098867f906 100644
--- a/cpukit/libnetworking/libc/inet_network.c
+++ b/cpukit/libnetworking/libc/inet_network.c
@@ -1,3 +1,5 @@
+#include <machine/rtems-bsd-user-space.h>
+
 /*
  * Copyright (c) 1983, 1993
  *	The Regents of the University of California.  All rights reserved.
diff --git a/cpukit/libnetworking/libc/inet_ntoa.c b/cpukit/libnetworking/libc/inet_ntoa.c
index 80f662d929..c67678be27 100644
--- a/cpukit/libnetworking/libc/inet_ntoa.c
+++ b/cpukit/libnetworking/libc/inet_ntoa.c
@@ -1,3 +1,5 @@
+#include <machine/rtems-bsd-user-space.h>
+
 /*-
  * Copyright (c) 1983, 1993
  *	The Regents of the University of California.  All rights reserved.
diff --git a/cpukit/libnetworking/libc/inet_ntop.c b/cpukit/libnetworking/libc/inet_ntop.c
index 4ea2ee348c..d070ce8e18 100644
--- a/cpukit/libnetworking/libc/inet_ntop.c
+++ b/cpukit/libnetworking/libc/inet_ntop.c
@@ -1,3 +1,5 @@
+#include <machine/rtems-bsd-user-space.h>
+
 /*
  * Copyright (c) 2004 by Internet Systems Consortium, Inc. ("ISC")
  * Copyright (c) 1996-1999 by Internet Software Consortium.
diff --git a/cpukit/libnetworking/libc/inet_pton.c b/cpukit/libnetworking/libc/inet_pton.c
index 963c071353..3dc1966027 100644
--- a/cpukit/libnetworking/libc/inet_pton.c
+++ b/cpukit/libnetworking/libc/inet_pton.c
@@ -1,3 +1,5 @@
+#include <machine/rtems-bsd-user-space.h>
+
 /* Copyright (c) 1996 by Internet Software Consortium.
  *
  * Permission to use, copy, modify, and distribute this software for any
diff --git a/cpukit/libnetworking/libc/linkaddr.c b/cpukit/libnetworking/libc/linkaddr.c
index 728234d57e..c8d99c6fff 100644
--- a/cpukit/libnetworking/libc/linkaddr.c
+++ b/cpukit/libnetworking/libc/linkaddr.c
@@ -1,3 +1,5 @@
+#include <machine/rtems-bsd-user-space.h>
+
 /*-
  * Copyright (c) 1990, 1993
  *	The Regents of the University of California.  All rights reserved.
diff --git a/cpukit/libnetworking/libc/map_v4v6.c b/cpukit/libnetworking/libc/map_v4v6.c
index 66287d4c3c..a0b1860fa3 100644
--- a/cpukit/libnetworking/libc/map_v4v6.c
+++ b/cpukit/libnetworking/libc/map_v4v6.c
@@ -1,3 +1,5 @@
+#include <machine/rtems-bsd-user-space.h>
+
 /*
  * ++Copyright++ 1985, 1988, 1993
  * -
diff --git a/cpukit/libnetworking/libc/ns_name.c b/cpukit/libnetworking/libc/ns_name.c
index 2823f4e43d..0ecd2f4772 100644
--- a/cpukit/libnetworking/libc/ns_name.c
+++ b/cpukit/libnetworking/libc/ns_name.c
@@ -1,3 +1,5 @@
+#include <machine/rtems-bsd-user-space.h>
+
 /*
  * Copyright (c) 1996 by Internet Software Consortium.
  *
diff --git a/cpukit/libnetworking/libc/ns_netint.c b/cpukit/libnetworking/libc/ns_netint.c
index e620faf95c..dcdcacb435 100644
--- a/cpukit/libnetworking/libc/ns_netint.c
+++ b/cpukit/libnetworking/libc/ns_netint.c
@@ -1,3 +1,5 @@
+#include <machine/rtems-bsd-user-space.h>
+
 /*
  * Copyright (c) 1996 by Internet Software Consortium.
  *
diff --git a/cpukit/libnetworking/libc/ns_parse.c b/cpukit/libnetworking/libc/ns_parse.c
index f0ada7df4f..3b676732fb 100644
--- a/cpukit/libnetworking/libc/ns_parse.c
+++ b/cpukit/libnetworking/libc/ns_parse.c
@@ -1,3 +1,5 @@
+#include <machine/rtems-bsd-user-space.h>
+
 /*
  * Copyright (c) 1996 by Internet Software Consortium.
  *
diff --git a/cpukit/libnetworking/libc/ns_print.c b/cpukit/libnetworking/libc/ns_print.c
index d8133c97d9..1cb6e8fdfb 100644
--- a/cpukit/libnetworking/libc/ns_print.c
+++ b/cpukit/libnetworking/libc/ns_print.c
@@ -1,3 +1,5 @@
+#include <machine/rtems-bsd-user-space.h>
+
 /*
  * Copyright (c) 1996, 1998 by Internet Software Consortium.
  *
diff --git a/cpukit/libnetworking/libc/ns_ttl.c b/cpukit/libnetworking/libc/ns_ttl.c
index f88890bfa9..a0c8baa2d2 100644
--- a/cpukit/libnetworking/libc/ns_ttl.c
+++ b/cpukit/libnetworking/libc/ns_ttl.c
@@ -1,3 +1,5 @@
+#include <machine/rtems-bsd-user-space.h>
+
 /*
  * Copyright (c) 1996 by Internet Software Consortium.
  *
diff --git a/cpukit/libnetworking/libc/nsap_addr.c b/cpukit/libnetworking/libc/nsap_addr.c
index d8effa2e70..29ecb05a31 100644
--- a/cpukit/libnetworking/libc/nsap_addr.c
+++ b/cpukit/libnetworking/libc/nsap_addr.c
@@ -1,3 +1,5 @@
+#include <machine/rtems-bsd-user-space.h>
+
 /*
  * Copyright (c) 1996, 1998 by Internet Software Consortium.
  *
diff --git a/cpukit/libnetworking/libc/rcmd.c b/cpukit/libnetworking/libc/rcmd.c
index d21e019c82..dde1acfaee 100644
--- a/cpukit/libnetworking/libc/rcmd.c
+++ b/cpukit/libnetworking/libc/rcmd.c
@@ -1,3 +1,5 @@
+#include <machine/rtems-bsd-user-space.h>
+
 /*
  * Copyright (c) 1983, 1993, 1994
  *	The Regents of the University of California.  All rights reserved.
diff --git a/cpukit/libnetworking/libc/recv.c b/cpukit/libnetworking/libc/recv.c
index fc4d5ac98c..9f33d5c881 100644
--- a/cpukit/libnetworking/libc/recv.c
+++ b/cpukit/libnetworking/libc/recv.c
@@ -1,3 +1,5 @@
+#include <machine/rtems-bsd-user-space.h>
+
 /*
  * Copyright (c) 1988, 1993
  *	The Regents of the University of California.  All rights reserved.
diff --git a/cpukit/libnetworking/libc/res_comp.c b/cpukit/libnetworking/libc/res_comp.c
index a1381fb12b..cd4820114e 100644
--- a/cpukit/libnetworking/libc/res_comp.c
+++ b/cpukit/libnetworking/libc/res_comp.c
@@ -1,3 +1,5 @@
+#include <machine/rtems-bsd-user-space.h>
+
 /*
  * Copyright (c) 1985, 1993
  *    The Regents of the University of California.  All rights reserved.
diff --git a/cpukit/libnetworking/libc/res_data.c b/cpukit/libnetworking/libc/res_data.c
index 241d049c7a..cd1a25ca83 100644
--- a/cpukit/libnetworking/libc/res_data.c
+++ b/cpukit/libnetworking/libc/res_data.c
@@ -1,3 +1,5 @@
+#include <machine/rtems-bsd-user-space.h>
+
 /*
  * Copyright (c) 1995,1996 by Internet Software Consortium.
  *
diff --git a/cpukit/libnetworking/libc/res_debug.c b/cpukit/libnetworking/libc/res_debug.c
index e6e7cbfa04..5ce5125fdf 100644
--- a/cpukit/libnetworking/libc/res_debug.c
+++ b/cpukit/libnetworking/libc/res_debug.c
@@ -1,3 +1,5 @@
+#include <machine/rtems-bsd-user-space.h>
+
 /*
  * Copyright (c) 1985
  *    The Regents of the University of California.  All rights reserved.
diff --git a/cpukit/libnetworking/libc/res_init.c b/cpukit/libnetworking/libc/res_init.c
index 9af80e3727..a5f7fc9b4f 100644
--- a/cpukit/libnetworking/libc/res_init.c
+++ b/cpukit/libnetworking/libc/res_init.c
@@ -1,3 +1,5 @@
+#include <machine/rtems-bsd-user-space.h>
+
 /*
  * Copyright (c) 1985, 1989, 1993
  *    The Regents of the University of California.  All rights reserved.
diff --git a/cpukit/libnetworking/libc/res_mkquery.c b/cpukit/libnetworking/libc/res_mkquery.c
index 832e2df740..e663d9821a 100644
--- a/cpukit/libnetworking/libc/res_mkquery.c
+++ b/cpukit/libnetworking/libc/res_mkquery.c
@@ -1,3 +1,5 @@
+#include <machine/rtems-bsd-user-space.h>
+
 /*
  * Copyright (c) 1985, 1993
  *    The Regents of the University of California.  All rights reserved.
diff --git a/cpukit/libnetworking/libc/res_mkupdate.c b/cpukit/libnetworking/libc/res_mkupdate.c
index 402a9250ca..46e001c550 100644
--- a/cpukit/libnetworking/libc/res_mkupdate.c
+++ b/cpukit/libnetworking/libc/res_mkupdate.c
@@ -1,3 +1,5 @@
+#include <machine/rtems-bsd-user-space.h>
+
 /*
  * Copyright (c) 1996 by Internet Software Consortium.
  *
diff --git a/cpukit/libnetworking/libc/res_query.c b/cpukit/libnetworking/libc/res_query.c
index b742c30315..a2b3713e29 100644
--- a/cpukit/libnetworking/libc/res_query.c
+++ b/cpukit/libnetworking/libc/res_query.c
@@ -1,3 +1,5 @@
+#include <machine/rtems-bsd-user-space.h>
+
 /*
  * Copyright (c) 1988, 1993
  *    The Regents of the University of California.  All rights reserved.
diff --git a/cpukit/libnetworking/libc/res_send.c b/cpukit/libnetworking/libc/res_send.c
index 316d3ad69c..bbe1642c6a 100644
--- a/cpukit/libnetworking/libc/res_send.c
+++ b/cpukit/libnetworking/libc/res_send.c
@@ -1,3 +1,5 @@
+#include <machine/rtems-bsd-user-space.h>
+
 /*
  * Copyright (c) 1985, 1989, 1993
  *    The Regents of the University of California.  All rights reserved.
diff --git a/cpukit/libnetworking/libc/res_stubs.c b/cpukit/libnetworking/libc/res_stubs.c
index 3e8b4ee45b..0b0f26ca76 100644
--- a/cpukit/libnetworking/libc/res_stubs.c
+++ b/cpukit/libnetworking/libc/res_stubs.c
@@ -1,3 +1,5 @@
+#include <machine/rtems-bsd-user-space.h>
+
 /*
  * Copyright (C) 1996 Peter Wemm <peter at freebsd.org>.
  * All rights reserved.
diff --git a/cpukit/libnetworking/libc/res_update.c b/cpukit/libnetworking/libc/res_update.c
index 85c55694fe..0c02330e9c 100644
--- a/cpukit/libnetworking/libc/res_update.c
+++ b/cpukit/libnetworking/libc/res_update.c
@@ -1,3 +1,5 @@
+#include <machine/rtems-bsd-user-space.h>
+
 /*
  * Copyright (c) 1996 by Internet Software Consortium.
  *
diff --git a/cpukit/libnetworking/libc/send.c b/cpukit/libnetworking/libc/send.c
index e087e597f1..ce793e3307 100644
--- a/cpukit/libnetworking/libc/send.c
+++ b/cpukit/libnetworking/libc/send.c
@@ -1,3 +1,5 @@
+#include <machine/rtems-bsd-user-space.h>
+
 /*
  * Copyright (c) 1988, 1993
  *	The Regents of the University of California.  All rights reserved.
diff --git a/cpukit/libnetworking/libc/strsep.c b/cpukit/libnetworking/libc/strsep.c
index 96e921097c..e7b52a9cbf 100644
--- a/cpukit/libnetworking/libc/strsep.c
+++ b/cpukit/libnetworking/libc/strsep.c
@@ -1,3 +1,5 @@
+#include <machine/rtems-bsd-user-space.h>
+
 /*-
  * Copyright (c) 1990, 1993
  *	The Regents of the University of California.  All rights reserved.
diff --git a/cpukit/libnetworking/machine/rtems-bsd-kernel-space.h b/cpukit/libnetworking/machine/rtems-bsd-kernel-space.h
new file mode 100644
index 0000000000..6debe20281
--- /dev/null
+++ b/cpukit/libnetworking/machine/rtems-bsd-kernel-space.h
@@ -0,0 +1,42 @@
+/*
+ * Copyright (c) 2018 embedded brains GmbH.  All rights reserved.
+ *
+ *  embedded brains GmbH
+ *  Dornierstr. 4
+ *  82178 Puchheim
+ *  Germany
+ *  <rtems at embedded-brains.de>
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+#ifndef _RTEMS_BSD_MACHINE_RTEMS_BSD_KERNEL_SPACE_H_
+#define	_RTEMS_BSD_MACHINE_RTEMS_BSD_KERNEL_SPACE_H_
+
+#define	BOOTP_COMPAT 1
+#define	DIAGNOSTIC 1
+#define	INET 1
+#define	__INSIDE_RTEMS_BSD_TCPIP_STACK__ 1
+#define	_KERNEL 1
+#define	NFS 1
+
+#endif /* _RTEMS_BSD_MACHINE_RTEMS_BSD_KERNEL_SPACE_H_ */
diff --git a/cpukit/libnetworking/machine/rtems-bsd-user-space.h b/cpukit/libnetworking/machine/rtems-bsd-user-space.h
new file mode 100644
index 0000000000..4cd313ac39
--- /dev/null
+++ b/cpukit/libnetworking/machine/rtems-bsd-user-space.h
@@ -0,0 +1,40 @@
+/*
+ * Copyright (c) 2018 embedded brains GmbH.  All rights reserved.
+ *
+ *  embedded brains GmbH
+ *  Dornierstr. 4
+ *  82178 Puchheim
+ *  Germany
+ *  <rtems at embedded-brains.de>
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+#ifndef _RTEMS_BSD_MACHINE_RTEMS_BSD_USER_SPACE_H_
+#define _RTEMS_BSD_MACHINE_RTEMS_BSD_USER_SPACE_H_
+
+#define	NOPOLL 1
+#define	NOSELECT 1
+#define	_THREAD_SAFE 1
+
+#endif /* _RTEMS_BSD_MACHINE_RTEMS_BSD_USER_SPACE_H_ */
+
diff --git a/cpukit/libnetworking/net/if.c b/cpukit/libnetworking/net/if.c
index b6c73cd002..dcef1e8244 100644
--- a/cpukit/libnetworking/net/if.c
+++ b/cpukit/libnetworking/net/if.c
@@ -1,3 +1,5 @@
+#include <machine/rtems-bsd-kernel-space.h>
+
 /*
  * Copyright (c) 1980, 1986, 1993
  *	The Regents of the University of California.  All rights reserved.
diff --git a/cpukit/libnetworking/net/if_ethersubr.c b/cpukit/libnetworking/net/if_ethersubr.c
index 5771d1dc35..258bdda478 100644
--- a/cpukit/libnetworking/net/if_ethersubr.c
+++ b/cpukit/libnetworking/net/if_ethersubr.c
@@ -1,3 +1,5 @@
+#include <machine/rtems-bsd-kernel-space.h>
+
 /*
  * Copyright (c) 1982, 1989, 1993
  *	The Regents of the University of California.  All rights reserved.
diff --git a/cpukit/libnetworking/net/if_loop.c b/cpukit/libnetworking/net/if_loop.c
index 48cf014418..6440a48fcb 100644
--- a/cpukit/libnetworking/net/if_loop.c
+++ b/cpukit/libnetworking/net/if_loop.c
@@ -1,3 +1,5 @@
+#include <machine/rtems-bsd-kernel-space.h>
+
 /*
  * Copyright (c) 1982, 1986, 1993
  *	The Regents of the University of California.  All rights reserved.
diff --git a/cpukit/libnetworking/net/if_ppp.c b/cpukit/libnetworking/net/if_ppp.c
index 9284f6d302..adc0901f54 100644
--- a/cpukit/libnetworking/net/if_ppp.c
+++ b/cpukit/libnetworking/net/if_ppp.c
@@ -1,3 +1,5 @@
+#include <machine/rtems-bsd-kernel-space.h>
+
 /*
  * if_ppp.c - Point-to-Point Protocol (PPP) Asynchronous driver.
  */
diff --git a/cpukit/libnetworking/net/ppp_tty.c b/cpukit/libnetworking/net/ppp_tty.c
index 140a7e6baa..705c2c148c 100644
--- a/cpukit/libnetworking/net/ppp_tty.c
+++ b/cpukit/libnetworking/net/ppp_tty.c
@@ -1,3 +1,5 @@
+#include <machine/rtems-bsd-kernel-space.h>
+
 /*
  * ppp_tty.c - Point-to-Point Protocol (PPP) driver for asynchronous
  * 	       tty devices.
diff --git a/cpukit/libnetworking/net/radix.c b/cpukit/libnetworking/net/radix.c
index d1a9e90832..b098a1c742 100644
--- a/cpukit/libnetworking/net/radix.c
+++ b/cpukit/libnetworking/net/radix.c
@@ -1,3 +1,5 @@
+#include <machine/rtems-bsd-kernel-space.h>
+
 /*
  * Copyright (c) 1988, 1989, 1993
  *	The Regents of the University of California.  All rights reserved.
diff --git a/cpukit/libnetworking/net/raw_cb.c b/cpukit/libnetworking/net/raw_cb.c
index 23d524b435..d11ece3f73 100644
--- a/cpukit/libnetworking/net/raw_cb.c
+++ b/cpukit/libnetworking/net/raw_cb.c
@@ -1,3 +1,5 @@
+#include <machine/rtems-bsd-kernel-space.h>
+
 /*
  * Copyright (c) 1980, 1986, 1993
  *	The Regents of the University of California.  All rights reserved.
diff --git a/cpukit/libnetworking/net/raw_usrreq.c b/cpukit/libnetworking/net/raw_usrreq.c
index 3c739759b9..03a4efe492 100644
--- a/cpukit/libnetworking/net/raw_usrreq.c
+++ b/cpukit/libnetworking/net/raw_usrreq.c
@@ -1,3 +1,5 @@
+#include <machine/rtems-bsd-kernel-space.h>
+
 /*
  * Copyright (c) 1980, 1986, 1993
  *	The Regents of the University of California.  All rights reserved.
diff --git a/cpukit/libnetworking/net/route.c b/cpukit/libnetworking/net/route.c
index bb9f3ff844..91e248fba6 100644
--- a/cpukit/libnetworking/net/route.c
+++ b/cpukit/libnetworking/net/route.c
@@ -1,3 +1,5 @@
+#include <machine/rtems-bsd-kernel-space.h>
+
 /*
  * Copyright (c) 1980, 1986, 1991, 1993
  *	The Regents of the University of California.  All rights reserved.
diff --git a/cpukit/libnetworking/net/rtsock.c b/cpukit/libnetworking/net/rtsock.c
index d0d46b3a84..54c5eb189b 100644
--- a/cpukit/libnetworking/net/rtsock.c
+++ b/cpukit/libnetworking/net/rtsock.c
@@ -1,3 +1,5 @@
+#include <machine/rtems-bsd-kernel-space.h>
+
 /*
  * Copyright (c) 1988, 1991, 1993
  *	The Regents of the University of California.  All rights reserved.
diff --git a/cpukit/libnetworking/net/slcompress.c b/cpukit/libnetworking/net/slcompress.c
index 9606c9e3c2..03d1133c2e 100644
--- a/cpukit/libnetworking/net/slcompress.c
+++ b/cpukit/libnetworking/net/slcompress.c
@@ -1,3 +1,5 @@
+#include <machine/rtems-bsd-kernel-space.h>
+
 /*-
  * Copyright (c) 1989, 1993, 1994
  *	The Regents of the University of California.  All rights reserved.
diff --git a/cpukit/libnetworking/netinet/if_ether.c b/cpukit/libnetworking/netinet/if_ether.c
index db703b4c60..e0686744e5 100644
--- a/cpukit/libnetworking/netinet/if_ether.c
+++ b/cpukit/libnetworking/netinet/if_ether.c
@@ -1,3 +1,5 @@
+#include <machine/rtems-bsd-kernel-space.h>
+
 /*
  * Copyright (c) 1982, 1986, 1988, 1993
  *	The Regents of the University of California.  All rights reserved.
diff --git a/cpukit/libnetworking/netinet/igmp.c b/cpukit/libnetworking/netinet/igmp.c
index 4ecd0ea501..7078914aa9 100644
--- a/cpukit/libnetworking/netinet/igmp.c
+++ b/cpukit/libnetworking/netinet/igmp.c
@@ -1,3 +1,5 @@
+#include <machine/rtems-bsd-kernel-space.h>
+
 /*
  * Copyright (c) 1988 Stephen Deering.
  * Copyright (c) 1992, 1993
diff --git a/cpukit/libnetworking/netinet/in.c b/cpukit/libnetworking/netinet/in.c
index 372252cddf..cb08232449 100644
--- a/cpukit/libnetworking/netinet/in.c
+++ b/cpukit/libnetworking/netinet/in.c
@@ -1,3 +1,5 @@
+#include <machine/rtems-bsd-kernel-space.h>
+
 /*
  * Copyright (c) 1982, 1986, 1991, 1993
  *	The Regents of the University of California.  All rights reserved.
diff --git a/cpukit/libnetworking/netinet/in_cksum.c b/cpukit/libnetworking/netinet/in_cksum.c
index 3ece6fa0b3..39dc9ac03d 100644
--- a/cpukit/libnetworking/netinet/in_cksum.c
+++ b/cpukit/libnetworking/netinet/in_cksum.c
@@ -1,3 +1,5 @@
+#include <machine/rtems-bsd-kernel-space.h>
+
 /*
  * Copyright (c) 1988, 1992, 1993
  *	The Regents of the University of California.  All rights reserved.
diff --git a/cpukit/libnetworking/netinet/in_pcb.c b/cpukit/libnetworking/netinet/in_pcb.c
index bba5528a6c..d9d4417f82 100644
--- a/cpukit/libnetworking/netinet/in_pcb.c
+++ b/cpukit/libnetworking/netinet/in_pcb.c
@@ -1,3 +1,5 @@
+#include <machine/rtems-bsd-kernel-space.h>
+
 /*
  * Copyright (c) 1982, 1986, 1991, 1993, 1995
  *	The Regents of the University of California.  All rights reserved.
diff --git a/cpukit/libnetworking/netinet/in_proto.c b/cpukit/libnetworking/netinet/in_proto.c
index 36c91f7854..558c3e2315 100644
--- a/cpukit/libnetworking/netinet/in_proto.c
+++ b/cpukit/libnetworking/netinet/in_proto.c
@@ -1,3 +1,5 @@
+#include <machine/rtems-bsd-kernel-space.h>
+
 /*
  * Copyright (c) 1982, 1986, 1993
  *	The Regents of the University of California.  All rights reserved.
diff --git a/cpukit/libnetworking/netinet/in_rmx.c b/cpukit/libnetworking/netinet/in_rmx.c
index f825cdc9e2..5dd276a879 100644
--- a/cpukit/libnetworking/netinet/in_rmx.c
+++ b/cpukit/libnetworking/netinet/in_rmx.c
@@ -1,3 +1,5 @@
+#include <machine/rtems-bsd-kernel-space.h>
+
 /*
  * Copyright 1994, 1995 Massachusetts Institute of Technology
  *
diff --git a/cpukit/libnetworking/netinet/ip_divert.c b/cpukit/libnetworking/netinet/ip_divert.c
index c731e6492d..c34da82d28 100644
--- a/cpukit/libnetworking/netinet/ip_divert.c
+++ b/cpukit/libnetworking/netinet/ip_divert.c
@@ -1,3 +1,5 @@
+#include <machine/rtems-bsd-kernel-space.h>
+
 /*
  * Copyright (c) 1982, 1986, 1988, 1993
  *	The Regents of the University of California.  All rights reserved.
diff --git a/cpukit/libnetworking/netinet/ip_fw.c b/cpukit/libnetworking/netinet/ip_fw.c
index 4c19d4992e..e5f8ab2127 100644
--- a/cpukit/libnetworking/netinet/ip_fw.c
+++ b/cpukit/libnetworking/netinet/ip_fw.c
@@ -1,3 +1,5 @@
+#include <machine/rtems-bsd-kernel-space.h>
+
 /*
  * Copyright (c) 1996 Alex Nash
  * Copyright (c) 1993 Daniel Boulet
diff --git a/cpukit/libnetworking/netinet/ip_icmp.c b/cpukit/libnetworking/netinet/ip_icmp.c
index 001cd49ccc..e1c7518af2 100644
--- a/cpukit/libnetworking/netinet/ip_icmp.c
+++ b/cpukit/libnetworking/netinet/ip_icmp.c
@@ -1,3 +1,5 @@
+#include <machine/rtems-bsd-kernel-space.h>
+
 /*
  * Copyright (c) 1982, 1986, 1988, 1993
  *	The Regents of the University of California.  All rights reserved.
diff --git a/cpukit/libnetworking/netinet/ip_input.c b/cpukit/libnetworking/netinet/ip_input.c
index e61ba26aa9..927537f9d2 100644
--- a/cpukit/libnetworking/netinet/ip_input.c
+++ b/cpukit/libnetworking/netinet/ip_input.c
@@ -1,3 +1,5 @@
+#include <machine/rtems-bsd-kernel-space.h>
+
 /*
  * Copyright (c) 1982, 1986, 1988, 1993
  *	The Regents of the University of California.  All rights reserved.
diff --git a/cpukit/libnetworking/netinet/ip_mroute.c b/cpukit/libnetworking/netinet/ip_mroute.c
index 5fc3023ee3..3a894970ec 100644
--- a/cpukit/libnetworking/netinet/ip_mroute.c
+++ b/cpukit/libnetworking/netinet/ip_mroute.c
@@ -1,3 +1,5 @@
+#include <machine/rtems-bsd-kernel-space.h>
+
 /*
  * IP multicast forwarding procedures
  *
diff --git a/cpukit/libnetworking/netinet/ip_output.c b/cpukit/libnetworking/netinet/ip_output.c
index 304a349dd4..5b1c497ad6 100644
--- a/cpukit/libnetworking/netinet/ip_output.c
+++ b/cpukit/libnetworking/netinet/ip_output.c
@@ -1,3 +1,5 @@
+#include <machine/rtems-bsd-kernel-space.h>
+
 /*
  * Copyright (c) 1982, 1986, 1988, 1990, 1993
  *	The Regents of the University of California.  All rights reserved.
diff --git a/cpukit/libnetworking/netinet/raw_ip.c b/cpukit/libnetworking/netinet/raw_ip.c
index 7647b8cb81..58b85a9fc2 100644
--- a/cpukit/libnetworking/netinet/raw_ip.c
+++ b/cpukit/libnetworking/netinet/raw_ip.c
@@ -1,3 +1,5 @@
+#include <machine/rtems-bsd-kernel-space.h>
+
 /*
  * Copyright (c) 1982, 1986, 1988, 1993
  *	The Regents of the University of California.  All rights reserved.
diff --git a/cpukit/libnetworking/netinet/tcp_debug.c b/cpukit/libnetworking/netinet/tcp_debug.c
index ca449bb9e7..a014158ae4 100644
--- a/cpukit/libnetworking/netinet/tcp_debug.c
+++ b/cpukit/libnetworking/netinet/tcp_debug.c
@@ -1,3 +1,5 @@
+#include <machine/rtems-bsd-kernel-space.h>
+
 /*
  * Copyright (c) 1982, 1986, 1993
  *	The Regents of the University of California.  All rights reserved.
diff --git a/cpukit/libnetworking/netinet/tcp_input.c b/cpukit/libnetworking/netinet/tcp_input.c
index ee76d63156..e62f1eb4cc 100644
--- a/cpukit/libnetworking/netinet/tcp_input.c
+++ b/cpukit/libnetworking/netinet/tcp_input.c
@@ -1,3 +1,5 @@
+#include <machine/rtems-bsd-kernel-space.h>
+
 /*
  * Copyright (c) 1982, 1986, 1988, 1990, 1993, 1994, 1995
  *	The Regents of the University of California.  All rights reserved.
diff --git a/cpukit/libnetworking/netinet/tcp_output.c b/cpukit/libnetworking/netinet/tcp_output.c
index 5cb0a25d3d..0e50329123 100644
--- a/cpukit/libnetworking/netinet/tcp_output.c
+++ b/cpukit/libnetworking/netinet/tcp_output.c
@@ -1,3 +1,5 @@
+#include <machine/rtems-bsd-kernel-space.h>
+
 /*
  * Copyright (c) 1982, 1986, 1988, 1990, 1993, 1995
  *	The Regents of the University of California.  All rights reserved.
diff --git a/cpukit/libnetworking/netinet/tcp_subr.c b/cpukit/libnetworking/netinet/tcp_subr.c
index f576e5686b..69012cc190 100644
--- a/cpukit/libnetworking/netinet/tcp_subr.c
+++ b/cpukit/libnetworking/netinet/tcp_subr.c
@@ -1,3 +1,5 @@
+#include <machine/rtems-bsd-kernel-space.h>
+
 /*
  * Copyright (c) 1982, 1986, 1988, 1990, 1993, 1995
  *	The Regents of the University of California.  All rights reserved.
diff --git a/cpukit/libnetworking/netinet/tcp_timer.c b/cpukit/libnetworking/netinet/tcp_timer.c
index b27d2eea42..a6df2b2b3c 100644
--- a/cpukit/libnetworking/netinet/tcp_timer.c
+++ b/cpukit/libnetworking/netinet/tcp_timer.c
@@ -1,3 +1,5 @@
+#include <machine/rtems-bsd-kernel-space.h>
+
 /*
  * Copyright (c) 1982, 1986, 1988, 1990, 1993, 1995
  *	The Regents of the University of California.  All rights reserved.
diff --git a/cpukit/libnetworking/netinet/tcp_usrreq.c b/cpukit/libnetworking/netinet/tcp_usrreq.c
index f288b68735..7f4c110a95 100644
--- a/cpukit/libnetworking/netinet/tcp_usrreq.c
+++ b/cpukit/libnetworking/netinet/tcp_usrreq.c
@@ -1,3 +1,5 @@
+#include <machine/rtems-bsd-kernel-space.h>
+
 /*
  * Copyright (c) 1982, 1986, 1988, 1993
  *	The Regents of the University of California.  All rights reserved.
diff --git a/cpukit/libnetworking/netinet/udp_usrreq.c b/cpukit/libnetworking/netinet/udp_usrreq.c
index 621f97d063..e4ae5c0c0a 100644
--- a/cpukit/libnetworking/netinet/udp_usrreq.c
+++ b/cpukit/libnetworking/netinet/udp_usrreq.c
@@ -1,3 +1,5 @@
+#include <machine/rtems-bsd-kernel-space.h>
+
 /*
  * Copyright (c) 1982, 1986, 1988, 1990, 1993, 1995
  *	The Regents of the University of California.  All rights reserved.
diff --git a/cpukit/libnetworking/nfs/bootp_subr.c b/cpukit/libnetworking/nfs/bootp_subr.c
index b24ba945e7..03b68ec0f1 100644
--- a/cpukit/libnetworking/nfs/bootp_subr.c
+++ b/cpukit/libnetworking/nfs/bootp_subr.c
@@ -1,3 +1,5 @@
+#include <machine/rtems-bsd-kernel-space.h>
+
 /*
  * Copyright (c) 1995 Gordon Ross, Adam Glass
  * Copyright (c) 1992 Regents of the University of California.
diff --git a/cpukit/libnetworking/rtems/mkrootfs.c b/cpukit/libnetworking/rtems/mkrootfs.c
index c110a62b0a..66d79750b7 100644
--- a/cpukit/libnetworking/rtems/mkrootfs.c
+++ b/cpukit/libnetworking/rtems/mkrootfs.c
@@ -1,3 +1,5 @@
+#include <machine/rtems-bsd-kernel-space.h>
+
 /*
   ------------------------------------------------------------------------
 
diff --git a/cpukit/libnetworking/rtems/rtems_bootp.c b/cpukit/libnetworking/rtems/rtems_bootp.c
index 2743dc0a05..8446d6ade9 100644
--- a/cpukit/libnetworking/rtems/rtems_bootp.c
+++ b/cpukit/libnetworking/rtems/rtems_bootp.c
@@ -1,3 +1,5 @@
+#include <machine/rtems-bsd-kernel-space.h>
+
 #if HAVE_CONFIG_H
 #include "config.h"
 #endif
diff --git a/cpukit/libnetworking/rtems/rtems_bsdnet.h b/cpukit/libnetworking/rtems/rtems_bsdnet.h
index a97c058f78..74626378e3 100644
--- a/cpukit/libnetworking/rtems/rtems_bsdnet.h
+++ b/cpukit/libnetworking/rtems/rtems_bsdnet.h
@@ -17,28 +17,6 @@ extern "C" {
 #endif
 
 /*
- *  If this file is included from inside the Network Stack proper or
- *  a device driver, then __INSIDE_RTEMS_BSD_TCPIP_STACK__ should be
- *  defined.  This triggers a number of internally used definitions.
- */
-
-#if defined(__INSIDE_RTEMS_BSD_TCPIP_STACK__)
-#undef _KERNEL
-#undef INET
-#undef NFS
-#undef DIAGNOSTIC
-#undef BOOTP_COMPAT
-#undef __BSD_VISIBLE
-
-#define _KERNEL
-#define INET
-#define NFS
-#define DIAGNOSTIC
-#define BOOTP_COMPAT
-#define __BSD_VISIBLE 1
-#endif
-
-/*
  * Values that may be obtained by BOOTP
  */
 extern struct in_addr rtems_bsdnet_bootp_server_address;
diff --git a/cpukit/libnetworking/rtems/rtems_bsdnet_malloc_starvation.c b/cpukit/libnetworking/rtems/rtems_bsdnet_malloc_starvation.c
index 563ece810b..1744f714f6 100644
--- a/cpukit/libnetworking/rtems/rtems_bsdnet_malloc_starvation.c
+++ b/cpukit/libnetworking/rtems/rtems_bsdnet_malloc_starvation.c
@@ -1,3 +1,5 @@
+#include <machine/rtems-bsd-kernel-space.h>
+
 /*
  *  Routine called when malloc() is not succeeding.  This can be overridden
  *  by a BSP.
diff --git a/cpukit/libnetworking/rtems/rtems_dhcp.c b/cpukit/libnetworking/rtems/rtems_dhcp.c
index 13c06bc732..ca89b19fd5 100644
--- a/cpukit/libnetworking/rtems/rtems_dhcp.c
+++ b/cpukit/libnetworking/rtems/rtems_dhcp.c
@@ -1,3 +1,5 @@
+#include <machine/rtems-bsd-kernel-space.h>
+
 /*
  *  DCHP client for RTEMS
  *  Andrew Bythell, <abythell at nortelnetworks.com>
@@ -54,20 +56,7 @@
  *
  */
 
-/*
- * WARNING:
- *   This file should be moved into c/src/libnetworking/nfs
- *   and the following two #ifndef...#endif blocks and the #undefs at
- *   the end of the file should be removed
- */
-
-#ifndef __INSIDE_RTEMS_BSD_TCPIP_STACK__
-#define __INSIDE_RTEMS_BSD_TCPIP_STACK__
-#endif
-
-#ifndef __BSD_VISIBLE
-#define __BSD_VISIBLE 1
-#endif
+#include <machine/rtems-bsd-kernel-space.h>
 
 #if HAVE_CONFIG_H
 #include "config.h"
diff --git a/cpukit/libnetworking/rtems/rtems_dhcp_failsafe.c b/cpukit/libnetworking/rtems/rtems_dhcp_failsafe.c
index acdec137fc..10ac661aee 100644
--- a/cpukit/libnetworking/rtems/rtems_dhcp_failsafe.c
+++ b/cpukit/libnetworking/rtems/rtems_dhcp_failsafe.c
@@ -1,3 +1,5 @@
+#include <machine/rtems-bsd-kernel-space.h>
+
 /*
   Description: Wrapper around DHCP client to restart it when the interface
                moves to another network.
diff --git a/cpukit/libnetworking/rtems/rtems_glue.c b/cpukit/libnetworking/rtems/rtems_glue.c
index 1b3f3a6483..13b16c9113 100644
--- a/cpukit/libnetworking/rtems/rtems_glue.c
+++ b/cpukit/libnetworking/rtems/rtems_glue.c
@@ -1,3 +1,5 @@
+#include <machine/rtems-bsd-kernel-space.h>
+
 #if HAVE_CONFIG_H
 #include "config.h"
 #endif
diff --git a/cpukit/libnetworking/rtems/rtems_malloc_mbuf.c b/cpukit/libnetworking/rtems/rtems_malloc_mbuf.c
index 602876a76b..99b9dbae30 100644
--- a/cpukit/libnetworking/rtems/rtems_malloc_mbuf.c
+++ b/cpukit/libnetworking/rtems/rtems_malloc_mbuf.c
@@ -1,3 +1,5 @@
+#include <machine/rtems-bsd-kernel-space.h>
+
 #if HAVE_CONFIG_H
 #include "config.h"
 #endif
diff --git a/cpukit/libnetworking/rtems/rtems_mii_ioctl.c b/cpukit/libnetworking/rtems/rtems_mii_ioctl.c
index cb970caad3..2559f4b3c7 100644
--- a/cpukit/libnetworking/rtems/rtems_mii_ioctl.c
+++ b/cpukit/libnetworking/rtems/rtems_mii_ioctl.c
@@ -1,3 +1,5 @@
+#include <machine/rtems-bsd-kernel-space.h>
+
 /* Simple (default) implementation for SIOCGIFMEDIA/SIOCSIFMEDIA
  * to be used by ethernet drivers [from their ioctl].
  *
diff --git a/cpukit/libnetworking/rtems/rtems_mii_ioctl_kern.c b/cpukit/libnetworking/rtems/rtems_mii_ioctl_kern.c
index 47d4de90db..2944f0add5 100644
--- a/cpukit/libnetworking/rtems/rtems_mii_ioctl_kern.c
+++ b/cpukit/libnetworking/rtems/rtems_mii_ioctl_kern.c
@@ -1,3 +1,5 @@
+#include <machine/rtems-bsd-kernel-space.h>
+
 /* Simple (default) implementation for SIOCGIFMEDIA/SIOCSIFMEDIA
  * to be used by ethernet drivers [from their ioctl].
  *
diff --git a/cpukit/libnetworking/rtems/rtems_select.c b/cpukit/libnetworking/rtems/rtems_select.c
index eddb122d63..309aa020da 100644
--- a/cpukit/libnetworking/rtems/rtems_select.c
+++ b/cpukit/libnetworking/rtems/rtems_select.c
@@ -1,3 +1,5 @@
+#include <machine/rtems-bsd-kernel-space.h>
+
 #if HAVE_CONFIG_H
 #include "config.h"
 #endif
diff --git a/cpukit/libnetworking/rtems/rtems_showicmpstat.c b/cpukit/libnetworking/rtems/rtems_showicmpstat.c
index c5ba5528d9..1e44fcf73a 100644
--- a/cpukit/libnetworking/rtems/rtems_showicmpstat.c
+++ b/cpukit/libnetworking/rtems/rtems_showicmpstat.c
@@ -1,3 +1,5 @@
+#include <machine/rtems-bsd-kernel-space.h>
+
 #if HAVE_CONFIG_H
 #include "config.h"
 #endif
diff --git a/cpukit/libnetworking/rtems/rtems_showifstat.c b/cpukit/libnetworking/rtems/rtems_showifstat.c
index d13efa6129..cbab561001 100644
--- a/cpukit/libnetworking/rtems/rtems_showifstat.c
+++ b/cpukit/libnetworking/rtems/rtems_showifstat.c
@@ -1,3 +1,5 @@
+#include <machine/rtems-bsd-kernel-space.h>
+
 #if HAVE_CONFIG_H
 #include "config.h"
 #endif
diff --git a/cpukit/libnetworking/rtems/rtems_showipstat.c b/cpukit/libnetworking/rtems/rtems_showipstat.c
index 1040c71ef0..01a89bace6 100644
--- a/cpukit/libnetworking/rtems/rtems_showipstat.c
+++ b/cpukit/libnetworking/rtems/rtems_showipstat.c
@@ -1,3 +1,5 @@
+#include <machine/rtems-bsd-kernel-space.h>
+
 #if HAVE_CONFIG_H
 #include "config.h"
 #endif
diff --git a/cpukit/libnetworking/rtems/rtems_showmbuf.c b/cpukit/libnetworking/rtems/rtems_showmbuf.c
index 14aa79e733..247b1b1473 100644
--- a/cpukit/libnetworking/rtems/rtems_showmbuf.c
+++ b/cpukit/libnetworking/rtems/rtems_showmbuf.c
@@ -1,3 +1,5 @@
+#include <machine/rtems-bsd-kernel-space.h>
+
 #if HAVE_CONFIG_H
 #include "config.h"
 #endif
diff --git a/cpukit/libnetworking/rtems/rtems_showroute.c b/cpukit/libnetworking/rtems/rtems_showroute.c
index fb85ff2d3c..952bb7ee73 100644
--- a/cpukit/libnetworking/rtems/rtems_showroute.c
+++ b/cpukit/libnetworking/rtems/rtems_showroute.c
@@ -1,3 +1,5 @@
+#include <machine/rtems-bsd-kernel-space.h>
+
 #if HAVE_CONFIG_H
 #include "config.h"
 #endif
diff --git a/cpukit/libnetworking/rtems/rtems_showtcpstat.c b/cpukit/libnetworking/rtems/rtems_showtcpstat.c
index 403e3c9f3d..d4b4a98fb3 100644
--- a/cpukit/libnetworking/rtems/rtems_showtcpstat.c
+++ b/cpukit/libnetworking/rtems/rtems_showtcpstat.c
@@ -1,3 +1,5 @@
+#include <machine/rtems-bsd-kernel-space.h>
+
 #if HAVE_CONFIG_H
 #include "config.h"
 #endif
diff --git a/cpukit/libnetworking/rtems/rtems_showudpstat.c b/cpukit/libnetworking/rtems/rtems_showudpstat.c
index 285a5a69fc..1e3f294a48 100644
--- a/cpukit/libnetworking/rtems/rtems_showudpstat.c
+++ b/cpukit/libnetworking/rtems/rtems_showudpstat.c
@@ -1,3 +1,5 @@
+#include <machine/rtems-bsd-kernel-space.h>
+
 #if HAVE_CONFIG_H
 #include "config.h"
 #endif
diff --git a/cpukit/libnetworking/rtems/rtems_socketpair.c b/cpukit/libnetworking/rtems/rtems_socketpair.c
index 55734dd791..0a0ad2eadb 100644
--- a/cpukit/libnetworking/rtems/rtems_socketpair.c
+++ b/cpukit/libnetworking/rtems/rtems_socketpair.c
@@ -1,3 +1,5 @@
+#include <machine/rtems-bsd-kernel-space.h>
+
 /*
  *  socketpair() for RTEMS
  *
diff --git a/cpukit/libnetworking/rtems/rtems_syscall.c b/cpukit/libnetworking/rtems/rtems_syscall.c
index 5225b53beb..5fa0e7d10c 100644
--- a/cpukit/libnetworking/rtems/rtems_syscall.c
+++ b/cpukit/libnetworking/rtems/rtems_syscall.c
@@ -1,3 +1,5 @@
+#include <machine/rtems-bsd-kernel-space.h>
+
 #if HAVE_CONFIG_H
 #include "config.h"
 #endif
diff --git a/cpukit/libnetworking/rtems/rtems_syscall_api.c b/cpukit/libnetworking/rtems/rtems_syscall_api.c
index ac3ab6e4e2..7315a6c0f1 100644
--- a/cpukit/libnetworking/rtems/rtems_syscall_api.c
+++ b/cpukit/libnetworking/rtems/rtems_syscall_api.c
@@ -1,3 +1,5 @@
+#include <machine/rtems-bsd-user-space.h>
+
 /*
  * Copyright (c) 2016 embedded brains GmbH.  All rights reserved.
  *
diff --git a/cpukit/libnetworking/rtems/sghostname.c b/cpukit/libnetworking/rtems/sghostname.c
index af383d41b9..9c756bcc31 100644
--- a/cpukit/libnetworking/rtems/sghostname.c
+++ b/cpukit/libnetworking/rtems/sghostname.c
@@ -1,3 +1,5 @@
+#include <machine/rtems-bsd-kernel-space.h>
+
 /*
  * RTEMS versions of hostname functions
  * FIXME: Not thread-safe
diff --git a/cpukit/wrapup/Makefile.am b/cpukit/wrapup/Makefile.am
index fcca5604e2..c69cfedecb 100644
--- a/cpukit/wrapup/Makefile.am
+++ b/cpukit/wrapup/Makefile.am
@@ -84,8 +84,6 @@ endif
 
 if LIBNETWORKING
 TMP_LIBS += ../libnetworking/libnetworking.a
-TMP_LIBS += ../libnetworking/libc.a
-TMP_LIBS += ../libnetworking/lib.a
 TMP_LIBS += ../librpc/librpc.a
 TMP_LIBS += ../librpc/libxdr.a
 endif
-- 
2.13.7






More information about the devel mailing list