#include <orte_rtems_shell.h>
-#include "networkconfig-static.h"
-
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
#define RTEMS_VER_CODE VER_CODE(__RTEMS_MAJOR__ ,__RTEMS_MINOR__ ,__RTEMS_REVISION__)
+#if RTEMS_VER_CODE < VER_CODE(4,10,99)
+ #ifndef RTEMS_USE_LOOPBACK
+ #define RTEMS_USE_LOOPBACK 1
+ #endif
+#endif
+
+#include "networkconfig-static.h"
+
#if RTEMS_VER_CODE < VER_CODE(4,7,99)
#define rtems_shell_add_cmd shell_add_cmd
#define rtems_shell_init(m_task_name,m_task_stacksize,m_task_priority,m_devname,m_forever,m_wait,m_login_check) \
static char ethernet_address[6] = {0x00, 0x04, 0x9F, 0x00, 0x27, 0x50 };
+#ifdef RTEMS_USE_LOOPBACK
+
+int rtems_bsdnet_loopattach(struct rtems_bsdnet_ifconfig *, int);
+
+#ifdef RTEMS_USE_LOOPBACK_ONLY
+static struct rtems_bsdnet_ifconfig netdriver_config = {
+#else
+static struct rtems_bsdnet_ifconfig loopback_config = {
+#endif
+ .name = "lo0",
+ .attach = rtems_bsdnet_loopattach,
+ .next = NULL,
+ .ip_address = "127.0.0.1",
+ .ip_netmask = "255.0.0.0",
+};
+
+#endif /*RTEMS_USE_LOOPBACK*/
+
+#ifndef RTEMS_USE_LOOPBACK_ONLY
static struct rtems_bsdnet_ifconfig netdriver_config = {
.name = RTEMS_BSP_NETWORK_DRIVER_NAME,
.attach = RTEMS_BSP_NETWORK_DRIVER_ATTACH,
+#ifdef RTEMS_USE_LOOPBACK
+ .next = &loopback_config,
+#else /*RTEMS_USE_LOOPBACK*/
.next = NULL,
+#endif /*RTEMS_USE_LOOPBACK*/
.ip_address = "192.168.2.3",
.ip_netmask = "255.255.255.0",
.hardware_address = ethernet_address,
.bpar = 0,
.drv_ctrl = NULL
};
+#endif /*RTEMS_USE_LOOPBACK_ONLY*/
struct rtems_bsdnet_config rtems_bsdnet_config = {
.ifconfig = &netdriver_config,
static char ethernet_address[6] = {0x00, 0x04, 0x9F, 0x00, 0x27, 0x50 };
+#ifdef RTEMS_USE_LOOPBACK
+
+int rtems_bsdnet_loopattach(struct rtems_bsdnet_ifconfig *, int);
+
+#ifdef RTEMS_USE_LOOPBACK_ONLY
+static struct rtems_bsdnet_ifconfig netdriver_config = {
+#else
+static struct rtems_bsdnet_ifconfig loopback_config = {
+#endif
+ .name = "lo0",
+ .attach = rtems_bsdnet_loopattach,
+ .next = NULL,
+ .ip_address = "127.0.0.1",
+ .ip_netmask = "255.0.0.0",
+};
+
+#endif /*RTEMS_USE_LOOPBACK*/
+
+#ifndef RTEMS_USE_LOOPBACK_ONLY
static struct rtems_bsdnet_ifconfig netdriver_config = {
.name = RTEMS_BSP_NETWORK_DRIVER_NAME,
.attach = RTEMS_BSP_NETWORK_DRIVER_ATTACH,
+#ifdef RTEMS_USE_LOOPBACK
+ .next = &loopback_config,
+#else /*RTEMS_USE_LOOPBACK*/
.next = NULL,
+#endif /*RTEMS_USE_LOOPBACK*/
.ip_address = "192.168.3.66",
.ip_netmask = "255.255.255.0",
.hardware_address = ethernet_address,
.bpar = 0,
.drv_ctrl = NULL
};
+#endif /*RTEMS_USE_LOOPBACK_ONLY*/
struct rtems_bsdnet_config rtems_bsdnet_config = {
.ifconfig = &netdriver_config,