diff options
author | Grant Erickson <gerickson@nuovations.com> | 2023-12-06 11:26:08 -0800 |
---|---|---|
committer | Marcel Holtmann <marcel@holtmann.org> | 2023-12-08 01:55:44 +0100 |
commit | 3cddda7a78cdbb076d113f73ce4633c5570a9b30 (patch) | |
tree | d46100cc3dd08bf18b2bdc7da3eb7859201086ad | |
parent | d6a716b6600f31fe759d9576e2bebe85f1a4cbbb (diff) | |
download | connman-3cddda7a78cdbb076d113f73ce4633c5570a9b30.tar.gz |
connection: Document 'demote_default_gateway'.
This adds documentation to the 'demote_default_gateway' function.
-rw-r--r-- | src/connection.c | 49 |
1 files changed, 49 insertions, 0 deletions
diff --git a/src/connection.c b/src/connection.c index fddf0d540..17aa4e7a7 100644 --- a/src/connection.c +++ b/src/connection.c @@ -2125,6 +2125,55 @@ static int unset_low_priority_default_gateway(struct gateway_data *data, return mutate_default_gateway(data, type, &ops, __func__); } +/** + * @brief + * Demote, from high- to low-priority, the default route associated + * with the specified gateway data and IP configuration type. + * + * This attempts to demote, from high- (that is, metric 0) to low- + * (that is, metric > 0) priority, the default route associated with + * the specified gateway data and IP configuration type. + * + * @param[in,out] data The gateway data associated with the + * default route for which the priority is + * to be demoted. + * @param[in] type The IP configuration type for which + * the gateway, or default router, is to be + * demoted. + * @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. + * + * @retval 0 If successful. + * @retval -EINVAL If @a data is null, if @a type is + * #CONNMAN_IPCONFIG_TYPE_UNKNOWN, if the + * gateway configuration type is invalid; or + * if the routing information to be added or + * deleted was invalid. + * @retval -EINPROGRESS If the state of the gateway configuration + * for @a data is already + * #CONNMAN_GATEWAY_CONFIG_STATE_ADDED or + * #CONNMAN_GATEWAY_CONFIG_STATE_REMOVED. + * @retval -EALREADY If the state of the gateway configuration + * for @a data is already + * #CONNMAN_GATEWAY_CONFIG_STATE_ACTIVE or + * #CONNMAN_GATEWAY_CONFIG_STATE_INACTIVE. + * @retval -EFAULT If the address to the routing information + * to be added or deleted was invalid. + * @retval -EPERM If the current process does not have the + * credentials or capabilities to add or + * delete routes. + * @retval -EEXIST A request was made to add an existing + * routing entry. + * @retval -ESRCH A request was made to delete a non- + * existing routing entry. + * + * @sa unset_default_gateway + * @sa set_low_priority_default_gateway + * @sa promote_default_gateway + * + */ static int demote_default_gateway(struct gateway_data *data, enum connman_ipconfig_type type, const char *function) |