From patchwork Tue Nov 28 23:08:42 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Grant Erickson X-Patchwork-Id: 13471922 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 C7F125C066 for ; Tue, 28 Nov 2023 23:08:56 +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 668BF73154 for ; Tue, 28 Nov 2023 18:08:50 -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 1F1F873180 for ; Tue, 28 Nov 2023 18:08:50 -0500 (EST) From: Grant Erickson To: connman@lists.linux.dev Subject: [PATCH 4/8] connection: Document 'gateway_{config,data}_debug'. Date: Tue, 28 Nov 2023 15:08:42 -0800 Message-ID: <20231128230847.1224497-5-gerickson@nuovations.com> X-Mailer: git-send-email 2.42.0 In-Reply-To: <20231128230847.1224497-1-gerickson@nuovations.com> References: <20231128230847.1224497-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 'gateway_{config,data}_debug' functions. --- src/connection.c | 57 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 57 insertions(+) diff --git a/src/connection.c b/src/connection.c index cba1508da3b8..1227c9cdea77 100644 --- a/src/connection.c +++ b/src/connection.c @@ -59,11 +59,45 @@ struct gateway_data { static GHashTable *gateway_hash = NULL; +/** + * @brief + * Return the specified pointer if non-null; otherwise, the + * immutable "" string. + * + * @param[in] pointer The pointer to be returned if non-null. + * + * @returns + * @a pointer if non-null; otherwise the "" immutable + * null-terminated C string. + * + */ static const char *maybe_null(const void *pointer) { return pointer ? pointer : ""; } +/** + * @brief + * Conditionally log the specified gateway configuration. + * + * This conditionally logs at the debug level the specified + * #gateway_config gateway configuration, @a config, with the + * provided description, @a description, attributed to the provided + * function name, @a function. + * + * @param[in] function A pointer to an immutable null-terminated + * C string containing the function name to + * which the call to this function should be + * attributed. + * @param[in] description A pointer to an immutable null-terminated + * C string briefly describing @a + * config. For example, "ipv4_config". + * @param[in] config A pointer to the immutable gateway + * configuration to conditionally log. + * + * @sa CONNMAN_DEBUG + * + */ static void gateway_config_debug(const char *function, const char *description, const struct gateway_config *config) @@ -95,6 +129,29 @@ static void gateway_config_debug(const char *function, } } +/** + * @brief + * Conditionally log the specified gateway data. + * + * This conditionally logs at the debug level the specified + * #gateway_data gateway data, @a data, with the provided + * description, @a description, attributed to the provided function + * name, @a function. + * + * @param[in] function A pointer to an immutable null-terminated + * C string containing the function name to + * which the call to this function should be + * attributed. + * @param[in] description A pointer to an immutable null-terminated + * C string briefly describing @a + * data. For example, "default_gateway". + * @param[in] data A pointer to the immutable gateway + * data to conditionally log. + * + * @sa CONNMAN_DEBUG + * @sa gateway_config_debug + * + */ static void gateway_data_debug(const char *function, const char *description, const struct gateway_data *data)