ConnMan network manager
 help / color / mirror / Atom feed
From: Grant Erickson <gerickson@nuovations.com>
To: connman@lists.linux.dev
Subject: [PATCH 3/3] connection: Document 'del_gateway_routes{,_if_active}'.
Date: Tue, 28 Nov 2023 22:21:09 -0800	[thread overview]
Message-ID: <20231129062109.1270106-4-gerickson@nuovations.com> (raw)
In-Reply-To: <20231129062109.1270106-1-gerickson@nuovations.com>

This adds documentation to the 'del_gateway_routes{,_if_active}'
functions.
---
 src/connection.c | 77 ++++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 77 insertions(+)

diff --git a/src/connection.c b/src/connection.c
index 23adf570120a..ce38f35d68c7 100644
--- a/src/connection.c
+++ b/src/connection.c
@@ -567,6 +567,46 @@ static void set_vpn_routes(struct gateway_data *new_gateway,
 	}
 }
 
+/**
+ *  @brief
+ *    Delete all gateway, or default router, default or host routes
+ *    for the gateway data.
+ *
+ *  This attempts to delete, or remove, all gateway, or default
+ *  router, default or host routes associated with the specified
+ *  gateway data.
+ *
+ *  @note
+ *    Deletions or removals are restricted to the network * interface
+ *    associated with the network interface index specified by * the
+ *    @a data @a index field.
+ *
+ *  @param[in]  data  A pointer to the mutable gateway data for which
+ *                    to delete or remove all gateway, or default
+ *                    router, default or host routes.
+ *  @param[in]  type  The IP configuration type for which the gateway,
+ *                    or default router, default or host routes are to
+ *                    be deleted or removed.
+ *
+ *  @retval  0        If successful.
+ *  @retval  -EPERM   If the current process does not have the
+ *                    credentials or capabilities to delete routes.
+ *  @retval  -EINVAL  If the routing information to be deleted was
+ *                    invalid.
+ *  @retval  -EFAULT  If the address to the routing information to be
+ *                    deleted was invalid.
+ *  @retval  -ESRCH   A request was made to delete a non-existing
+ *                    routing entry.
+ *
+ *  @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
+ *  @sa connman_inet_del_host_route
+ *  @sa connman_inet_del_ipv6_host_route
+ *  @sa del_gateway_routes_if_active
+ *
+ */
 static int del_gateway_routes(struct gateway_data *data,
 			enum connman_ipconfig_type type)
 {
@@ -621,6 +661,43 @@ static int del_gateway_routes(struct gateway_data *data,
 	return (status4 < 0 ? status4 : status6);
 }
 
+/**
+ *  @brief
+ *    Delete all gateway, or default router, default or host routes
+ *    for the gateway data, if they are active.
+ *
+ *  This attempts to delete, or remove, all gateway, or default
+ *  router, default or host routes associated with the specified
+ *  gateway data, if the corresponding gateway configuration for the
+ *  specified type, @a type, is marked as active.
+ *
+ *  @note
+ *    Deletions or removals are restricted to the network interface
+ *    associated with the network interface index specified by the
+ *    @a data @a index field.
+ *
+ *  @param[in]  data  A pointer to the mutable gateway data for which
+ *                    to delete or remove all gateway, or default
+ *                    router, default or host routes, if they are
+ *                    active.
+ *  @param[in]  type  The IP configuration type for which the gateway,
+ *                    or default router, default or host routes are to
+ *                    be deleted or removed.
+ *
+ *  @retval  0        If successful.
+ *  @retval  -EINVAL  If data is null, if type is
+ *                    #CONNMAN_IPCONFIG_TYPE_UNKNOWN, if the routing
+ *                    information to be deleted was invalid.
+ *  @retval  -EPERM   If the current process does not have the
+ *                    credentials or capabilities to delete routes.
+ *  @retval  -EFAULT  If the address to the routing information to be
+ *                    deleted was invalid.
+ *  @retval  -ESRCH   A request was made to delete a non-existing
+ *                    routing entry.
+ *
+ *  @sa del_gateway_routes
+ *
+ */
 static int del_gateway_routes_if_active(struct gateway_data *data,
 			enum connman_ipconfig_type type)
 {
-- 
2.42.0


      parent reply	other threads:[~2023-11-29  6:21 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-11-29  6:21 [PATCH 0/3] Rename 'disable_gateway' and 'del_routes' Grant Erickson
2023-11-29  6:21 ` [PATCH 1/3] connection: Rename 'disable_gateway' Grant Erickson
2023-11-29  6:21 ` [PATCH 2/3] connection: Rename 'del_routes' Grant Erickson
2023-11-29  6:21 ` 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=20231129062109.1270106-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 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).