Index: freebsd/usr.sbin/arp/arp.c
===================================================================
--- freebsd/usr.sbin/arp/arp.c	(revision 246b61e977e57e43dee9903fc0e09b242ff5ea4d)
+++ freebsd/usr.sbin/arp/arp.c	(revision 64c663c0d1341d208891e68a7e2c857485754f99)
@@ -1,3 +1,7 @@
 #include <machine/rtems-bsd-user-space.h>
+
+#ifdef __rtems__
+#include "rtems-bsd-arp-namespace.h"
+#endif /* __rtems__ */
 
 /*
@@ -52,4 +56,10 @@
 
 
+#ifdef __rtems__
+#define __need_getopt_newlib
+#include <getopt.h>
+#include <machine/rtems-bsd-program.h>
+#include <machine/rtems-bsd-commands.h>
+#endif /* __rtems__ */
 #include <rtems/bsd/sys/param.h>
 #include <sys/file.h>
@@ -82,4 +92,11 @@
 #include <strings.h>
 #include <unistd.h>
+#ifdef __rtems__
+#include "rtems-bsd-arp-arp-data.h"
+static struct timespec tp;
+static int seq;
+static int s = -1;
+static pid_t pid;
+#endif /* __rtems__ */
 
 typedef void (action_fn)(struct sockaddr_dl *sdl,
@@ -107,5 +124,5 @@
 static int	flags, doing_proxy;
 
-struct if_nameindex *ifnameindex;
+static struct if_nameindex *ifnameindex;
 
 /* which function we're supposed to do */
@@ -118,4 +135,27 @@
 #define SETFUNC(f)	{ if (func) usage(); func = (f); }
 
+#ifdef __rtems__
+static int main(int argc, char *argv[]);
+
+RTEMS_LINKER_RWSET(bsd_prog_arp, char);
+
+int
+rtems_bsd_command_arp(int argc, char *argv[])
+{
+	int exit_code;
+	void *data_begin;
+	size_t data_size;
+
+	data_begin = RTEMS_LINKER_SET_BEGIN(bsd_prog_arp);
+	data_size = RTEMS_LINKER_SET_SIZE(bsd_prog_arp);
+
+	rtems_bsd_program_lock();
+	exit_code = rtems_bsd_program_call_main_with_data_restore("arp",
+	    main, argc, argv, data_begin, data_size);
+	rtems_bsd_program_unlock();
+
+	return exit_code;
+}
+#endif /* __rtems__ */
 int
 main(int argc, char *argv[])
@@ -124,4 +164,13 @@
 	int rtn = 0;
 	int aflag = 0;	/* do it for all entries */
+#ifdef __rtems__
+	struct getopt_data getopt_data;
+	memset(&getopt_data, 0, sizeof(getopt_data));
+#define optind getopt_data.optind
+#define optarg getopt_data.optarg
+#define opterr getopt_data.opterr
+#define optopt getopt_data.optopt
+#define getopt(argc, argv, opt) getopt_r(argc, argv, "+" opt, &getopt_data)
+#endif /* __rtems__ */
 
 	while ((ch = getopt(argc, argv, "andfsSi:")) != -1)
@@ -620,5 +669,7 @@
 		printf(" permanent");
 	else {
+#ifndef __rtems__
 		static struct timespec tp;
+#endif /* __rtems__ */
 		if (tp.tv_sec == 0)
 			clock_gettime(CLOCK_MONOTONIC, &tp);
@@ -704,10 +755,14 @@
 rtmsg(int cmd, struct sockaddr_in *dst, struct sockaddr_dl *sdl)
 {
+#ifndef __rtems__
 	static int seq;
+#endif /* __rtems__ */
 	int rlen;
 	int l;
 	struct sockaddr_in so_mask, *som = &so_mask;
+#ifndef __rtems__
 	static int s = -1;
 	static pid_t pid;
+#endif /* __rtems__ */
 
 	static struct	{
Index: freebsd/usr.sbin/arp/rtems-bsd-arp-arp-data.h
===================================================================
--- freebsd/usr.sbin/arp/rtems-bsd-arp-arp-data.h	(revision 64c663c0d1341d208891e68a7e2c857485754f99)
+++ freebsd/usr.sbin/arp/rtems-bsd-arp-arp-data.h	(revision 64c663c0d1341d208891e68a7e2c857485754f99)
@@ -0,0 +1,14 @@
+/* generated by userspace-header-gen.py */
+#include <rtems/linkersets.h>
+#include "rtems-bsd-arp-data.h"
+/* arp.c */
+RTEMS_LINKER_RWSET_CONTENT(bsd_prog_arp, static int nflag);
+RTEMS_LINKER_RWSET_CONTENT(bsd_prog_arp, static char *rifname);
+RTEMS_LINKER_RWSET_CONTENT(bsd_prog_arp, static time_t expire_time);
+RTEMS_LINKER_RWSET_CONTENT(bsd_prog_arp, static int flags);
+RTEMS_LINKER_RWSET_CONTENT(bsd_prog_arp, static int doing_proxy);
+RTEMS_LINKER_RWSET_CONTENT(bsd_prog_arp, static struct if_nameindex *ifnameindex);
+RTEMS_LINKER_RWSET_CONTENT(bsd_prog_arp, static struct timespec tp);
+RTEMS_LINKER_RWSET_CONTENT(bsd_prog_arp, static int seq);
+RTEMS_LINKER_RWSET_CONTENT(bsd_prog_arp, static int s);
+RTEMS_LINKER_RWSET_CONTENT(bsd_prog_arp, static pid_t pid);
Index: freebsd/usr.sbin/arp/rtems-bsd-arp-data.h
===================================================================
--- freebsd/usr.sbin/arp/rtems-bsd-arp-data.h	(revision 64c663c0d1341d208891e68a7e2c857485754f99)
+++ freebsd/usr.sbin/arp/rtems-bsd-arp-data.h	(revision 64c663c0d1341d208891e68a7e2c857485754f99)
@@ -0,0 +1,3 @@
+/* generated by userspace-header-gen.py */
+#include <rtems/linkersets.h>
+/* arp.c */
Index: freebsd/usr.sbin/arp/rtems-bsd-arp-namespace.h
===================================================================
--- freebsd/usr.sbin/arp/rtems-bsd-arp-namespace.h	(revision 64c663c0d1341d208891e68a7e2c857485754f99)
+++ freebsd/usr.sbin/arp/rtems-bsd-arp-namespace.h	(revision 64c663c0d1341d208891e68a7e2c857485754f99)
@@ -0,0 +1,2 @@
+/* generated by userspace-header-gen.py */
+/* arp.c */
Index: libbsd.py
===================================================================
--- libbsd.py	(revision 246b61e977e57e43dee9903fc0e09b242ff5ea4d)
+++ libbsd.py	(revision 64c663c0d1341d208891e68a7e2c857485754f99)
@@ -71,4 +71,5 @@
             'rtems/rtems-bsd-rc-conf.c',
             'rtems/rtems-bsd-shell.c',
+            'rtems/rtems-bsd-shell-arp.c',
             'rtems/rtems-bsd-shell-ifconfig.c',
             'rtems/rtems-bsd-shell-netstat.c',
@@ -2220,4 +2221,5 @@
             'usr.bin/netstat/unix.c',
             'usr.bin/vmstat/vmstat.c',
+            'usr.sbin/arp/arp.c',
         ],
         mm.generator['source'](['-DINET6', '-DINET'])
Index: libbsd_waf.py
===================================================================
--- libbsd_waf.py	(revision 246b61e977e57e43dee9903fc0e09b242ff5ea4d)
+++ libbsd_waf.py	(revision 64c663c0d1341d208891e68a7e2c857485754f99)
@@ -448,5 +448,6 @@
                      'freebsd/usr.bin/netstat/sctp.c',
                      'freebsd/usr.bin/netstat/unix.c',
-                     'freebsd/usr.bin/vmstat/vmstat.c']
+                     'freebsd/usr.bin/vmstat/vmstat.c',
+                     'freebsd/usr.sbin/arp/arp.c']
     bld.objects(target = "objs01",
                 features = "c",
@@ -1100,4 +1101,5 @@
               'rtemsbsd/rtems/rtems-bsd-rc-conf-pf.c',
               'rtemsbsd/rtems/rtems-bsd-rc-conf.c',
+              'rtemsbsd/rtems/rtems-bsd-shell-arp.c',
               'rtemsbsd/rtems/rtems-bsd-shell-dhcpcd.c',
               'rtemsbsd/rtems/rtems-bsd-shell-ifconfig.c',
Index: rtemsbsd/include/machine/rtems-bsd-commands.h
===================================================================
--- rtemsbsd/include/machine/rtems-bsd-commands.h	(revision 246b61e977e57e43dee9903fc0e09b242ff5ea4d)
+++ rtemsbsd/include/machine/rtems-bsd-commands.h	(revision 64c663c0d1341d208891e68a7e2c857485754f99)
@@ -47,4 +47,6 @@
 __BEGIN_DECLS
 
+int rtems_bsd_command_arp(int argc, char **argv);
+
 int rtems_bsd_command_ifconfig(int argc, char **argv);
 
Index: rtemsbsd/include/rtems/netcmds-config.h
===================================================================
--- rtemsbsd/include/rtems/netcmds-config.h	(revision 246b61e977e57e43dee9903fc0e09b242ff5ea4d)
+++ rtemsbsd/include/rtems/netcmds-config.h	(revision 64c663c0d1341d208891e68a7e2c857485754f99)
@@ -22,4 +22,6 @@
 extern "C" {
 #endif /* __cplusplus */
+
+extern rtems_shell_cmd_t rtems_shell_ARP_Command;
 
 extern rtems_shell_cmd_t rtems_shell_BSD_Command;
Index: rtemsbsd/rtems/rtems-bsd-shell-arp.c
===================================================================
--- rtemsbsd/rtems/rtems-bsd-shell-arp.c	(revision 64c663c0d1341d208891e68a7e2c857485754f99)
+++ rtemsbsd/rtems/rtems-bsd-shell-arp.c	(revision 64c663c0d1341d208891e68a7e2c857485754f99)
@@ -0,0 +1,40 @@
+/*
+ * Copyright (c) 2016 embedded brains GmbH.  All rights reserved.
+ *
+ *  embedded brains GmbH
+ *  Dornierstr. 4
+ *  82178 Puchheim
+ *  Germany
+ *  <rtems@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.
+ */
+
+#include <rtems/netcmds-config.h>
+#include <machine/rtems-bsd-commands.h>
+
+rtems_shell_cmd_t rtems_shell_ARP_Command = {
+  .name = "arp",
+  .usage = "arp [args]",
+  .topic = "net",
+  .command = rtems_bsd_command_arp
+};
Index: testsuite/include/rtems/bsd/test/default-network-init.h
===================================================================
--- testsuite/include/rtems/bsd/test/default-network-init.h	(revision 246b61e977e57e43dee9903fc0e09b242ff5ea4d)
+++ testsuite/include/rtems/bsd/test/default-network-init.h	(revision 64c663c0d1341d208891e68a7e2c857485754f99)
@@ -358,4 +358,5 @@
 #define CONFIGURE_SHELL_USER_COMMANDS \
   &bsp_interrupt_shell_command, \
+  &rtems_shell_ARP_Command, \
   &rtems_shell_BSD_Command, \
   &rtems_shell_HOSTNAME_Command, \
Index: testsuite/media01/test_main.c
===================================================================
--- testsuite/media01/test_main.c	(revision 246b61e977e57e43dee9903fc0e09b242ff5ea4d)
+++ testsuite/media01/test_main.c	(revision 64c663c0d1341d208891e68a7e2c857485754f99)
@@ -200,4 +200,5 @@
 #define CONFIGURE_SHELL_USER_COMMANDS \
   &bsp_interrupt_shell_command, \
+  &rtems_shell_ARP_Command, \
   &rtems_shell_BSD_Command, \
   &rtems_shell_HOSTNAME_Command, \
Index: testsuite/netshell01/shellconfig.c
===================================================================
--- testsuite/netshell01/shellconfig.c	(revision 246b61e977e57e43dee9903fc0e09b242ff5ea4d)
+++ testsuite/netshell01/shellconfig.c	(revision 64c663c0d1341d208891e68a7e2c857485754f99)
@@ -11,4 +11,5 @@
 
 #define CONFIGURE_SHELL_USER_COMMANDS \
+    &rtems_shell_ARP_Command, \
     &rtems_shell_SYSCTL_Command, \
     &rtems_shell_HOSTNAME_Command, \
