From patchwork Wed Nov 29 01:52:53 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Grant Erickson X-Patchwork-Id: 13472095 Received: from mohas.pair.com (mohas.pair.com [209.68.5.112]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id DEF9A1FB5 for ; Wed, 29 Nov 2023 01:52:57 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=nuovations.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=nuovations.com Authentication-Results: smtp.subspace.kernel.org; dkim=none Received: from mohas.pair.com (localhost [127.0.0.1]) by mohas.pair.com (Postfix) with ESMTP id 06C707312C for ; Tue, 28 Nov 2023 20:52:57 -0500 (EST) Received: from localhost.localdomain (unknown [IPv6:2601:647:5a00:15c1:230d:b2c9:c388:f96b]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mohas.pair.com (Postfix) with ESMTPSA id B300F73159 for ; Tue, 28 Nov 2023 20:52:56 -0500 (EST) From: Grant Erickson To: connman@lists.linux.dev Subject: [PATCH 3/3] connection: Document 'is_ipv[46]_addr_any_str'. Date: Tue, 28 Nov 2023 17:52:53 -0800 Message-ID: <20231129015253.1254116-4-gerickson@nuovations.com> X-Mailer: git-send-email 2.42.0 In-Reply-To: <20231129015253.1254116-1-gerickson@nuovations.com> References: <20231129015253.1254116-1-gerickson@nuovations.com> Precedence: bulk X-Mailing-List: connman@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Scanned-By: mailmunge 3.11 on 209.68.5.112 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 9fb2298dde61..eddfdc721636 100644 --- a/src/connection.c +++ b/src/connection.c @@ -192,11 +192,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;