From: Grant Erickson <gerickson@nuovations.com>
To: connman@lists.linux.dev
Subject: [PATCH 4/4] connection: Document '{un,}set_default_gateway'.
Date: Wed, 29 Nov 2023 21:26:22 -0800 [thread overview]
Message-ID: <20231130052622.1335266-5-gerickson@nuovations.com> (raw)
In-Reply-To: <20231130052622.1335266-1-gerickson@nuovations.com>
This adds documentation to the '{un,}set_default_gateway'
functions.
---
src/connection.c | 56 ++++++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 56 insertions(+)
diff --git a/src/connection.c b/src/connection.c
index 716569debfa5..94b2f90f515b 100644
--- a/src/connection.c
+++ b/src/connection.c
@@ -864,6 +864,35 @@ static int add_gateway(struct connman_service *service,
return err;
}
+/**
+ * @brief
+ * Set, or assign, the gateway, or default route, for the specified
+ * IP configuration type from the provided gateway data.
+ *
+ * This attempts to set, or assign, the gateway, or default, route
+ * for the specified IP configuration type from the provided gateway
+ * data. The network interface and, by extension, the network service
+ * with which the gateway is associated is determined by the @a index
+ * field of @a data.
+ *
+ * On success, the gateway configuration specific to @a type will
+ * have its @a active field set to true and the gateway data network
+ * service @a service will be signaled as the default via
+ * #__connman_service_indicate_default.
+ *
+ * @param[in,out] data A pointer to the mutable gateway data to
+ * assign as the default route.
+ * @param[in] type The IP configuration type for which the
+ * gateway, or default router, configuration
+ * will be selected from @a data and used to
+ * set the default route.
+ *
+ * @sa __connman_inet_add_default_to_table
+ * @sa __connman_service_indicate_default
+ * @sa connman_inet_set_gateway_interface
+ * @sa connman_inet_set_ipv6_gateway_interface
+ *
+ */
static void set_default_gateway(struct gateway_data *data,
enum connman_ipconfig_type type)
{
@@ -952,6 +981,33 @@ static void set_default_gateway(struct gateway_data *data,
__connman_service_indicate_default(data->service);
}
+/**
+ * @brief
+ * Unset the gateway, or default route, for the specified IP
+ * configuration type from the provided gateway data.
+ *
+ * This attempts to unset, or clear, the gateway, or default, route
+ * for the specified IP configuration type from the provided gateway
+ * data. The network interface and, by extension, the network service
+ * with which the gateway is associated is determined by the @a index
+ * field of @a data.
+ *
+ * On success, the gateway configuration specific to @a type will
+ * have its @a active field set to false.
+ *
+ * @param[in,out] data A pointer to the mutable gateway data to
+ * clear as the default route.
+ * @param[in] type The IP configuration type for which the
+ * gateway, or default router, configuration
+ * will be selected from @a data and used to
+ * unset the default route.
+ *
+ * @sa connman_inet_clear_gateway_address
+ * @sa connman_inet_clear_gateway_interface
+ * @sa connman_inet_clear_ipv6_gateway_address
+ * @sa connman_inet_clear_ipv6_gateway_interface
+ *
+ */
static void unset_default_gateway(struct gateway_data *data,
enum connman_ipconfig_type type)
{
--
2.42.0
prev parent reply other threads:[~2023-11-30 5:26 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-11-30 5:26 [PATCH 0/4] connection: Simplify '{un,}set_default_gateway' Flow Grant Erickson
2023-11-30 5:26 ` [PATCH 1/4] connection: Simplify 'set_default_gateway' flow Grant Erickson
2023-11-30 5:26 ` [PATCH 2/4] connection: Simplify 'unset_default_gateway' flow Grant Erickson
2023-11-30 5:26 ` [PATCH 3/4] connection: Add additional DBG statements to '{un,}set_default_gateway' Grant Erickson
2023-11-30 5:26 ` Grant Erickson [this message]
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=20231130052622.1335266-5-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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).