summaryrefslogtreecommitdiffstats
path: root/apps/nshlib
diff options
context:
space:
mode:
authorGregory Nutt <gnutt@nuttx.org>2015-02-03 08:01:55 -0600
committerGregory Nutt <gnutt@nuttx.org>2015-02-03 08:01:55 -0600
commitd2dd063179ec9ab25b0db59573aa5231ba82ad93 (patch)
treee1daaf9acdcc41cfff736d7d56babbe1c59045d2 /apps/nshlib
parent5facd80a972df125a152f2ac2493441c18985b51 (diff)
Add netlib and application hooks for ICMPv6 auto-configuration (still incomplete
Diffstat (limited to 'apps/nshlib')
-rw-r--r--apps/nshlib/Kconfig20
-rw-r--r--apps/nshlib/nsh_netinit.c21
2 files changed, 22 insertions, 19 deletions
diff --git a/apps/nshlib/Kconfig b/apps/nshlib/Kconfig
index 3805ffff4b..8bcd5eda7e 100644
--- a/apps/nshlib/Kconfig
+++ b/apps/nshlib/Kconfig
@@ -931,7 +931,7 @@ config NSH_NETMASK
endif # NET_IPv4
if NET_IPv6
-if !NSH_DHCPC
+if !NET_ICMPv6_AUTOCONF
comment "Target IPv6 address"
@@ -940,7 +940,7 @@ config NSH_IPv6ADDR_1
default 0xfc00
range 0x0 0xffff
---help---
- If NSH_DHCPC is NOT set, then the static IP address must be
+ If NET_ICMPv6_AUTOCONF is NOT set, then the static IP address must be
provided. This is a 16-bit integer value in host order. Each of the
eight values forming the full IP address must be specified
individually. This is the first of the 8-values. The default for
@@ -951,7 +951,7 @@ config NSH_IPv6ADDR_2
default 0x0000
range 0x0 0xffff
---help---
- If NSH_DHCPC is NOT set, then the static IP address must be
+ If NET_ICMPv6_AUTOCONF is NOT set, then the static IP address must be
provided. This is a 16-bit integer value in host order. Each of the
eight values forming the full IP address must be specified
individually. This is the second of the 8-values. The default for
@@ -962,7 +962,7 @@ config NSH_IPv6ADDR_3
default 0x0000
range 0x0 0xffff
---help---
- If NSH_DHCPC is NOT set, then the static IP address must be
+ If NET_ICMPv6_AUTOCONF is NOT set, then the static IP address must be
provided. This is a 16-bit integer value in host order. Each of the
eight values forming the full IP address must be specified
individually. This is the third of the 8-values. The default for
@@ -973,7 +973,7 @@ config NSH_IPv6ADDR_4
default 0x0000
range 0x0 0xffff
---help---
- If NSH_DHCPC is NOT set, then the static IP address must be
+ If NET_ICMPv6_AUTOCONF is NOT set, then the static IP address must be
provided. This is a 16-bit integer value in host order. Each of the
eight values forming the full IP address must be specified
individually. This is the fourth of the 8-values. The default for
@@ -984,7 +984,7 @@ config NSH_IPv6ADDR_5
default 0x0000
range 0x0 0xffff
---help---
- If NSH_DHCPC is NOT set, then the static IP address must be
+ If NET_ICMPv6_AUTOCONF is NOT set, then the static IP address must be
provided. This is a 16-bit integer value in host order. Each of the
eight values forming the full IP address must be specified
individually. This is the fifth of the 8-values. The default for
@@ -995,7 +995,7 @@ config NSH_IPv6ADDR_6
default 0x0000
range 0x0 0xffff
---help---
- If NSH_DHCPC is NOT set, then the static IP address must be
+ If NET_ICMPv6_AUTOCONF is NOT set, then the static IP address must be
provided. This is a 16-bit integer value in host order. Each of the
eight values forming the full IP address must be specified
individually. This is the sixth of the 8-values. The default for
@@ -1006,7 +1006,7 @@ config NSH_IPv6ADDR_7
default 0x0000
range 0x0 0xffff
---help---
- If NSH_DHCPC is NOT set, then the static IP address must be
+ If NET_ICMPv6_AUTOCONF is NOT set, then the static IP address must be
provided. This is a 16-bit integer value in host order. Each of the
eight values forming the full IP address must be specified
individually. This is the seventh of the 8-values. The default for
@@ -1017,13 +1017,13 @@ config NSH_IPv6ADDR_8
default 0x0002
range 0x0 0xffff
---help---
- If NSH_DHCPC is NOT set, then the static IP address must be
+ If NET_ICMPv6_AUTOCONF is NOT set, then the static IP address must be
provided. This is a 16-bit integer value in host order. Each of the
eight values forming the full IP address must be specified
individually. This is the last of the 8-values. The default for
all eight values is fc00::2.
-endif # !NSH_DHCPC
+endif # !NET_ICMPv6_AUTOCONF
comment "Router IPv6 address"
diff --git a/apps/nshlib/nsh_netinit.c b/apps/nshlib/nsh_netinit.c
index d2ea3520f0..c2b8bf9529 100644
--- a/apps/nshlib/nsh_netinit.c
+++ b/apps/nshlib/nsh_netinit.c
@@ -132,14 +132,9 @@ static sem_t g_notify_sem;
#endif
#ifdef CONFIG_NET_IPv6
- /* Host IPv6 address */
+#ifndef CONFIG_NET_ICMPv6_AUTOCONF
+/* Host IPv6 address */
-#ifdef CONFIG_NSH_DHCPC
-static const uint16_t g_ipv6_hostaddr[8] =
-{
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000
-};
-#else
static const uint16_t g_ipv6_hostaddr[8] =
{
HTONS(CONFIG_NSH_IPv6ADDR_1),
@@ -151,7 +146,7 @@ static const uint16_t g_ipv6_hostaddr[8] =
HTONS(CONFIG_NSH_IPv6ADDR_7),
HTONS(CONFIG_NSH_IPv6ADDR_8),
};
-#endif
+#endif /* CONFIG_NET_ICMPv6_AUTOCONF */
/* Default routine IPv6 address */
@@ -260,10 +255,18 @@ static void nsh_netinit_configure(void)
#endif
#ifdef CONFIG_NET_IPv6
- /* Set up our host address */
+#ifdef CONFIG_NET_ICMPv6_AUTOCONF
+ /* Perform ICMPv6 auto-configuration */
+
+ netlib_icmpv6_autoconfiguration(NET_DEVNAME);
+
+#else
+
+ /* Set up our fixed host address */
netlib_set_ipv6addr(NET_DEVNAME,
(FAR const struct in6_addr *)g_ipv6_hostaddr);
+#endif
/* Set up the default router address */