From 2cd27e17a1436a7bab3f960ce01243a009c1091a Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Tue, 19 Sep 2017 17:07:02 -0600 Subject: [PATCH] Update some comments. --- netutils/netlib/netlib_ipv4adaptor.c | 27 +++++++++++++++++++++++++++ netutils/netlib/netlib_ipv6adaptor.c | 27 +++++++++++++++++++++++++++ 2 files changed, 54 insertions(+) diff --git a/netutils/netlib/netlib_ipv4adaptor.c b/netutils/netlib/netlib_ipv4adaptor.c index 40cf6c367..abf3d8ff0 100644 --- a/netutils/netlib/netlib_ipv4adaptor.c +++ b/netutils/netlib/netlib_ipv4adaptor.c @@ -58,6 +58,33 @@ /**************************************************************************** * Name: netlib_ipv4adaptor + * + * Description: + * Given the destination address, destipaddr, return the IP address + * assigned to the network adaptor that connects the sub-net that + * includes destipaddr. + * + * NOTE: This does not account for any routing information that may + * appear in the routing table. A complete solution could involve three + * steps: + * + * 1. Call netlib_ipv4adaptor() to find the address of the network + * adaptor for the destination address. + * 2. If this fails, then look up the router address in the routing table + * that can forward to the destination address, then + * 3. Call netlib_ipv4adaptor() to find the address of the network + * adaptor for that router address. + * + * Input Parameters: + * destipaddr - The destination IPv4 address + * srcipaddr - The location to return that adaptor address that serves + * the sub-net that includes the destination address. + * + * Returned Value: + * Zero (OK) is returned on success with srcipaddr valid. A negated + * errno value is returned on any failure and in this case the srcipaddr + * is not valid. + * ****************************************************************************/ int netlib_ipv4adaptor(in_addr_t destipaddr, FAR in_addr_t *srcipaddr) diff --git a/netutils/netlib/netlib_ipv6adaptor.c b/netutils/netlib/netlib_ipv6adaptor.c index 5c558c809..4a358de5b 100644 --- a/netutils/netlib/netlib_ipv6adaptor.c +++ b/netutils/netlib/netlib_ipv6adaptor.c @@ -58,6 +58,33 @@ /**************************************************************************** * Name: netlib_ipv6adaptor + * + * Description: + * Given the destination address, destipaddr, return the IP address + * assigned to the network adaptor that connects the sub-net that + * includes destipaddr. + * + * NOTE: This does not account for any routing information that may + * appear in the routing table. A complete solution could involve three + * steps: + * + * 1. Call netlib_ipv4adaptor() to find the address of the network + * adaptor for the destination address. + * 2. If this fails, then look up the router address in the routing table + * that can forward to the destination address, then + * 3. Call netlib_ipv4adaptor() to find the address of the network + * adaptor for that router address. + * + * Input Parameters: + * destipaddr - The destination IPv4 address + * srcipaddr - The location to return that adaptor address that serves + * the sub-net that includes the destination address. + * + * Returned Value: + * Zero (OK) is returned on success with srcipaddr valid. A negated + * errno value is returned on any failure and in this case the srcipaddr + * is not valid. + * ****************************************************************************/ int netlib_ipv6adaptor(FAR const struct in6_addr *destipaddr,