diff options
author | Gregory Nutt <gnutt@nuttx.org> | 2015-02-03 15:40:56 -0600 |
---|---|---|
committer | Gregory Nutt <gnutt@nuttx.org> | 2015-02-03 15:40:56 -0600 |
commit | 87bc48cc1efcedaae3bf1b176168ff3dc17637f7 (patch) | |
tree | 6953f9f33fcd7b75ec0019268bd13b3569099da8 /apps/examples/udp | |
parent | be5a9dbe26d3d362a250d7fbff2923090a144032 (diff) | |
download | nuttx-87bc48cc1efcedaae3bf1b176168ff3dc17637f7.tar.gz nuttx-87bc48cc1efcedaae3bf1b176168ff3dc17637f7.tar.bz2 nuttx-87bc48cc1efcedaae3bf1b176168ff3dc17637f7.zip |
ICMPv6: This completes coding of the ICMPv6 auto-configuration feature. It is not yet functional
Diffstat (limited to 'apps/examples/udp')
-rw-r--r-- | apps/examples/udp/Kconfig | 5 | ||||
-rw-r--r-- | apps/examples/udp/target.c | 18 |
2 files changed, 14 insertions, 9 deletions
diff --git a/apps/examples/udp/Kconfig b/apps/examples/udp/Kconfig index eecd937b0..ff357750e 100644 --- a/apps/examples/udp/Kconfig +++ b/apps/examples/udp/Kconfig @@ -56,6 +56,7 @@ config EXAMPLES_UDP_SERVERIP endif # EXAMPLES_UDP_IPv4 if EXAMPLES_UDP_IPv6 +if !NET_ICMPv6_AUTOCONF comment "Target IPv6 address" @@ -303,7 +304,9 @@ config EXAMPLES_UDP_IPv6NETMASK_8 individually. This is the eighth of the 8-values. The default for all eight values is fe00::0. -comment "Client IPv6 address" +#endif /* NET_ICMPv6_AUTOCONF */ + +comment "Server IPv6 address" config EXAMPLES_UDP_SERVERIPv6ADDR_1 hex "[0]" diff --git a/apps/examples/udp/target.c b/apps/examples/udp/target.c index 2d80ac0dc..48e28be8d 100644 --- a/apps/examples/udp/target.c +++ b/apps/examples/udp/target.c @@ -57,8 +57,7 @@ * Private Data ****************************************************************************/ -#ifdef CONFIG_EXAMPLES_UDP_IPv6 -#ifdef CONFIG_NET_ICMPv6_AUTOCONF +#if defined(CONFIG_EXAMPLES_UDP_IPv6) && !defined(CONFIG_NET_ICMPv6_AUTOCONF) /* Our host IPv6 address */ static const uint16_t g_ipv6_hostaddr[8] = @@ -72,7 +71,6 @@ static const uint16_t g_ipv6_hostaddr[8] = HTONS(CONFIG_EXAMPLES_UDP_IPv6ADDR_7), HTONS(CONFIG_EXAMPLES_UDP_IPv6ADDR_8), }; -#endif /* Default routine IPv6 address */ @@ -101,7 +99,7 @@ static const uint16_t g_ipv6_netmask[8] = HTONS(CONFIG_EXAMPLES_UDP_IPv6NETMASK_7), HTONS(CONFIG_EXAMPLES_UDP_IPv6NETMASK_8), }; -#endif /* CONFIG_EXAMPLES_UDP_IPv6 */ +#endif /* CONFIG_EXAMPLES_UDP_IPv6 && !CONFIG_NET_ICMPv6_AUTOCONF */ /**************************************************************************** * Public Functions @@ -123,12 +121,12 @@ int udp_main(int argc, char *argv[]) netlib_icmpv6_autoconfiguration("eth0"); -#else +#else /* CONFIG_NET_ICMPv6_AUTOCONF */ + /* Set up our fixed host address */ netlib_set_ipv6addr("eth0", (FAR const struct in6_addr *)g_ipv6_hostaddr); -#endif /* Set up the default router address */ @@ -139,7 +137,10 @@ int udp_main(int argc, char *argv[]) netlib_set_ipv6netmask("eth0", (FAR const struct in6_addr *)g_ipv6_netmask); -#else + +#endif /* CONFIG_NET_ICMPv6_AUTOCONF */ +#else /* CONFIG_EXAMPLES_UDP_IPv6 */ + struct in_addr addr; /* Set up our host address */ @@ -156,7 +157,8 @@ int udp_main(int argc, char *argv[]) addr.s_addr = HTONL(CONFIG_EXAMPLES_UDP_NETMASK); netlib_set_ipv4netmask("eth0", &addr); -#endif + +#endif /* CONFIG_EXAMPLES_UDP_IPv6 */ #ifdef CONFIG_EXAMPLES_UDP_SERVER recv_server(); |