From: Grant Erickson <gerickson@nuovations.com>
To: connman@lists.linux.dev
Subject: [PATCH v2 3/3] connection: Document 'is_ipv[46]_addr_any_str'.
Date: Wed, 29 Nov 2023 12:41:56 -0800 [thread overview]
Message-ID: <20231129204156.1298225-4-gerickson@nuovations.com> (raw)
In-Reply-To: <20231129204156.1298225-1-gerickson@nuovations.com>
This adds documentation to the 'is_ipv[46]_addr_any_str' functions.
---
src/connection.c | 40 ++++++++++++++++++++++++++++++++++++++++
1 file changed, 40 insertions(+)
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;
--
2.42.0
next prev parent reply other threads:[~2023-11-29 20:42 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-11-29 1:52 [PATCH 0/3] connection: Introduce and Leverage IP Any / Unspecified Address String Constants and Functions Grant Erickson
2023-11-29 1:52 ` [PATCH 1/3] connection: Introduce and leverage 'ipv[46]_addr_any_str' constants Grant Erickson
2023-11-29 13:19 ` Marcel Holtmann
2023-11-29 17:20 ` Grant Erickson
2023-11-29 17:58 ` Marcel Holtmann
2023-11-29 18:02 ` Grant Erickson
2023-11-29 20:42 ` Grant Erickson
2023-11-29 1:52 ` [PATCH 2/3] connection: Introduce and leverage 'is_ipv[46]_addr_any_str' functions Grant Erickson
2023-11-29 1:52 ` [PATCH 3/3] connection: Document 'is_ipv[46]_addr_any_str' Grant Erickson
2023-11-29 20:41 ` [PATCH v2 0/3] connection: Introduce and Leverage IP Any / Unspecified Address String Constants and Functions Grant Erickson
2023-11-29 20:41 ` [PATCH v2 1/3] connection: Introduce and leverage 'ipv[46]_addr_any_str' constants Grant Erickson
2023-11-29 20:41 ` [PATCH v2 2/3] connection: Introduce and leverage 'is_ipv[46]_addr_any_str' functions Grant Erickson
2023-11-29 20:41 ` Grant Erickson [this message]
2023-12-07 23:46 ` [PATCH v2 0/3] connection: Introduce and Leverage IP Any / Unspecified Address String Constants and Functions Marcel Holtmann
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20231129204156.1298225-4-gerickson@nuovations.com \
--to=gerickson@nuovations.com \
--cc=connman@lists.linux.dev \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.