diff options
Diffstat (limited to 'nuttx/net/icmpv6')
-rw-r--r-- | nuttx/net/icmpv6/Kconfig | 22 | ||||
-rw-r--r-- | nuttx/net/icmpv6/icmpv6.h | 25 | ||||
-rw-r--r-- | nuttx/net/icmpv6/icmpv6_poll.c | 27 |
3 files changed, 72 insertions, 2 deletions
diff --git a/nuttx/net/icmpv6/Kconfig b/nuttx/net/icmpv6/Kconfig index 1a6120ac1..f361c75b0 100644 --- a/nuttx/net/icmpv6/Kconfig +++ b/nuttx/net/icmpv6/Kconfig @@ -32,6 +32,28 @@ config NET_ICMPv6_NEIGHBOR the target IPv6 address mapping does not appear in the Neighbor table. +if NET_ICMPv6_NEIGHBOR + +config ICMPv6_NEIGHBOR_MAXTRIES + int "ICMPv6 solicitation retries" + default 5 + ---help--- + Send the Neighbor solicitation this number of times before giving + up and deciding that the target IP6 address is non reachable. + +config ICMPv6_NEIGHBOR_DELAYMSEC + int "ICMPv6 re-solicit delay" + default 20 + ---help--- + Wait this number of milliseconds after sending the Neighbor + Solicitation before checking if the IPv6 address mapping is present + in the Neighbor Table. This time should be related to the maximum + round trip time on the network since it is basically the time from + when an Neighbor Solicitation is sent until the Neighbor + Advertisement is received. + +endif # NET_ICMPv6_NEIGHBOR + endif # NET_ICMPv6 endmenu # ICMPv6 Networking Support endif # NET_IPv6 diff --git a/nuttx/net/icmpv6/icmpv6.h b/nuttx/net/icmpv6/icmpv6.h index a96263ce3..d736331a7 100644 --- a/nuttx/net/icmpv6/icmpv6.h +++ b/nuttx/net/icmpv6/icmpv6.h @@ -56,6 +56,29 @@ * Public Type Definitions ****************************************************************************/ +#ifdef CONFIG_NET_IPv6_NEIGHBOR +/* For symmetry with other protocols, a "connection" structure is + * provided. But it is a singleton for the case of ARP packet transfers. + */ + +struct icmpv6_conn_s +{ + FAR struct devif_callback_s *list; /* ARP callbacks */ +}; +#endif + +#ifdef CONFIG_NET_IPv6_NEIGHBOR +/* Used to notify a thread waiting for a particular ARP response */ + +struct icmpv6_notify_s +{ + FAR struct icmpv6_notify_s *nt_flink; /* Supports singly linked list */ + in_addr_t nt_ipaddr; /* Waited for IP address in the mapping */ + sem_t nt_sem; /* Will wake up the waiter */ + int nt_result; /* The result of the wait */ +}; +#endif + /**************************************************************************** * Public Data ****************************************************************************/ @@ -104,7 +127,7 @@ void icmpv6_input(FAR struct net_driver_s *dev); * If the requested IPv6 address in not in the Neighbor Table, then this * function will send the Neighbor Solicitation, delay, then check if the * IP address is now in the Neighbor able. It will repeat this sequence - * until either (1) the IPv6 address mapping is now in the Neibhbor table, + * until either (1) the IPv6 address mapping is now in the Neighbor table, * or (2) a configurable number of timeouts occur without receiving the * ICMPv6 Neighbor Advertisement. * diff --git a/nuttx/net/icmpv6/icmpv6_poll.c b/nuttx/net/icmpv6/icmpv6_poll.c index 3a3c75df1..8885f0fc5 100644 --- a/nuttx/net/icmpv6/icmpv6_poll.c +++ b/nuttx/net/icmpv6/icmpv6_poll.c @@ -88,6 +88,8 @@ void icmpv6_poll(FAR struct net_driver_s *dev) { + uint16_t flags; + /* Setup for the application callback */ dev->d_appdata = &dev->d_buf[NET_LL_HDRLEN(dev) + IPICMPv6_HDRLEN]; @@ -96,7 +98,30 @@ void icmpv6_poll(FAR struct net_driver_s *dev) /* Perform the application callback */ - (void)devif_callback_execute(dev, NULL, ICMPv6_POLL, g_icmpv6_echocallback); +#ifdef CONFIG_NET_ICMPv6_PING +#ifdef CONFIG_NET_NET_ICMPv6_NEIGHBOR + flags = ICMPv6_POLL; +#endif + if (g_icmpv6_echocallback) + { + flags = devif_callback_execute(dev, NULL, ICMPv6_POLL, + g_icmpv6_echocallback); + } +#endif /* CONFIG_NET_ICMPv6_PING */ + +#ifdef CONFIG_NET_NET_ICMPv6_NEIGHBOR + if ( +#ifdef CONFIG_NET_ICMPv6_PING + flags != 0 && +#endif + g_icmpv6_neighborcallback) + { + flags = devif_callback_execute(dev, NULL, ICMPv6_POLL, + g_icmpv6_neighborcallback); + } +#endif /* CONFIG_NET_NET_ICMPv6_NEIGHBOR */ + + UNUSED(flags); } #endif /* CONFIG_NET_ICMPv6_PING || CONFIG_NET_NET_ICMPv6_NEIGHBOR */ |