NSH changes to work with the network local loopback device
This commit is contained in:
parent
73fc8b501e
commit
ce3a2dc0d4
@ -155,7 +155,8 @@
|
||||
* domain sockets were enable.
|
||||
*/
|
||||
|
||||
#if !defined(CONFIG_NET_ETHERNET) && !defined(CONFIG_NET_SLIP) && !defined(CONFIG_NET_TUN)
|
||||
#if !defined(CONFIG_NET_ETHERNET) && !defined(CONFIG_NET_LOOPBACK) && \
|
||||
!defined(CONFIG_NET_SLIP) && !defined(CONFIG_NET_TUN)
|
||||
/* No link layer protocol is a good indication that there is no network
|
||||
* device.
|
||||
*/
|
||||
|
@ -515,6 +515,12 @@ static int ifconfig_callback(FAR struct net_driver_s *dev, void *arg)
|
||||
break;
|
||||
# endif
|
||||
|
||||
# if defined(CONFIG_NET_LOOPBACK)
|
||||
case NET_LL_LOOPBACK:
|
||||
nsh_output(vtbl, "%s\tLink encap:Local Loopback\n", dev->d_ifname);
|
||||
break;
|
||||
# endif
|
||||
|
||||
# if defined(CONFIG_NET_SLIP)
|
||||
case NET_LL_SLIP:
|
||||
nsh_output(vtbl, "%s\tLink encap:SLIP", dev->d_ifname);
|
||||
@ -543,6 +549,9 @@ static int ifconfig_callback(FAR struct net_driver_s *dev, void *arg)
|
||||
nsh_output(vtbl, "%s\tLink encap:Ethernet HWaddr %s at %s\n",
|
||||
dev->d_ifname, ether_ntoa(&dev->d_mac), status);
|
||||
|
||||
#elif defined(CONFIG_NET_LOOPBACK)
|
||||
nsh_output(vtbl, "%s\tLink encap:Local Loopback\n", dev->d_ifname);
|
||||
|
||||
#elif defined(CONFIG_NET_SLIP)
|
||||
nsh_output(vtbl, "%s\tLink encap:SLIP at %s\n", dev->d_ifname, status);
|
||||
|
||||
|
@ -103,19 +103,32 @@
|
||||
|
||||
#if defined(CONFIG_NET_ETHERNET)
|
||||
# define NET_DEVNAME "eth0"
|
||||
# define NSH_HAVE_NETDEV
|
||||
#elif defined(CONFIG_NET_SLIP)
|
||||
# define NET_DEVNAME "sl0"
|
||||
# ifndef CONFIG_NSH_NOMAC
|
||||
# error "CONFIG_NSH_NOMAC must be defined for SLIP"
|
||||
# endif
|
||||
# define NSH_HAVE_NETDEV
|
||||
#elif defined(CONFIG_NET_TUN)
|
||||
# define NET_DEVNAME "tun0"
|
||||
# define NSH_HAVE_NETDEV
|
||||
#elif defined(CONFIG_NET_LOCAL)
|
||||
# define NET_DEVNAME "lo"
|
||||
#else
|
||||
# define NSH_HAVE_NETDEV
|
||||
#elif !defined(CONFIG_NET_LOOPBACK)
|
||||
# error ERROR: No link layer protocol defined
|
||||
#endif
|
||||
|
||||
/* If we have no network device (only only the local loopback device), then we
|
||||
* cannot support the network monitor.
|
||||
*/
|
||||
|
||||
#ifndef NSH_HAVE_NETDEV
|
||||
# undef CONFIG_NSH_NETINIT_MONITOR
|
||||
#endif
|
||||
|
||||
|
||||
/* We need a valid IP domain (any domain) to create a socket that we can use
|
||||
* to comunicate with the network device.
|
||||
*/
|
||||
@ -208,6 +221,7 @@ static const uint16_t g_ipv6_netmask[8] =
|
||||
|
||||
static void nsh_netinit_configure(void)
|
||||
{
|
||||
#ifdef NSH_HAVE_NETDEV
|
||||
#ifdef CONFIG_NET_IPv4
|
||||
struct in_addr addr;
|
||||
#endif
|
||||
@ -328,6 +342,7 @@ static void nsh_netinit_configure(void)
|
||||
dhcpc_close(handle);
|
||||
}
|
||||
#endif
|
||||
#endif /* NSH_HAVE_NETDEV */
|
||||
|
||||
nvdbg("Exit\n");
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user