diff mbox series

[v2,3/3] connection: Document 'is_ipv[46]_addr_any_str'.

Message ID 20231129204156.1298225-4-gerickson@nuovations.com (mailing list archive)
State Not Applicable, archived
Headers show
Series connection: Introduce and Leverage IP Any / Unspecified Address String Constants and Functions | expand

Commit Message

Grant Erickson Nov. 29, 2023, 8:41 p.m. UTC
This adds documentation to the 'is_ipv[46]_addr_any_str' functions.
---
 src/connection.c | 40 ++++++++++++++++++++++++++++++++++++++++
 1 file changed, 40 insertions(+)
diff mbox series

Patch

diff --git a/src/connection.c b/src/connection.c
index f7b5ca008d8a..a1a962578e9f 100644
--- a/src/connection.c
+++ b/src/connection.c
@@ -200,11 +200,51 @@  static void gateway_data_debug(const char *function,
 	}
 }
 
+/**
+ *  @brief
+ *    Determine whether the specified text-formatted IPv4 address is
+ *    the "any" or "unspecified" address.
+ *
+ *  This determines whether the specified text-formatted IPv4 address
+ *  is the "any" or "unspecified" address, that is "0.0.0.0".
+ *
+ *  @param[in]  address  A pointer to an immutable null-terminated C
+ *                       string containing the text-formatted address
+ *                       to determine whether it is the IPv4 "any" or
+ *                       "unspecified address.
+ *
+ *  @returns
+ *    True if @a address is the "any" or "unspecified" IPv4 address;
+ *    otherwise, false.
+ *
+ *  @sa is_ipv6_addr_any_str
+ *
+ */
 static bool is_ipv4_addr_any_str(const char *address)
 {
 	return g_strcmp0(ipv4_addr_any_str, address) == 0;
 }
 
+/**
+ *  @brief
+ *    Determine whether the specified text-formatted IPv6 address is
+ *    the "any" or "unspecified" address.
+ *
+ *  This determines whether the specified text-formatted IPv6 address
+ *  is the "any" or "unspecified" address, that is "::".
+ *
+ *  @param[in]  address  A pointer to an immutable null-terminated C
+ *                       string containing the text-formatted address
+ *                       to determine whether it is the IPv6 "any" or
+ *                       "unspecified address.
+ *
+ *  @returns
+ *    True if @a address is the "any" or "unspecified" IPv6 address;
+ *    otherwise, false.
+ *
+ *  @sa is_ipv4_addr_any_str
+ *
+ */
 static bool is_ipv6_addr_any_str(const char *address)
 {
 	return g_strcmp0(ipv6_addr_any_str, address) == 0;