aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGrant Erickson <gerickson@nuovations.com>2023-12-14 16:10:28 -0800
committerMarcel Holtmann <marcel@holtmann.org>2023-12-15 09:49:19 +0100
commit444b0f86ee159ec5629600a942c8cca487e911de (patch)
treebd287c9e1997c64c44d43069965b102a21de58c4
parent030c2d198b7c65f75877d4adccc2b0e6edabfddb (diff)
downloadconnman-444b0f86ee159ec5629600a942c8cca487e911de.tar.gz
connection: Document 'inet_mask_addr_data'.
This adds documentation to the 'inet_mask_addr_data' function.
-rw-r--r--src/inet.c25
1 files changed, 25 insertions, 0 deletions
diff --git a/src/inet.c b/src/inet.c
index cc450355b..ca999fa31 100644
--- a/src/inet.c
+++ b/src/inet.c
@@ -651,6 +651,31 @@ static int inet_get_addr_data(int family,
return 0;
}
+/**
+ * @brief
+ * Apply the specified prefix length to the specified binary
+ * address data.
+ *
+ * This attempts to apply the specified prefix length as a network /
+ * prefix mask to the specified address data, in network (that is,
+ * big endian) byte order, to generate a network address / prefix.
+ *
+ * @param[in] addr_len The length, in bytes of the address
+ * pointed to by @a addr_data.
+ * @param[in,out] addr_data A pointer to the mutable address data
+ * in binary form in network (that is,
+ * big endian) byte order to mask with @a
+ * prefixlen.
+ * @param[in] prefixlen The prefix length to apply to @a
+ * addr_data as a mask to generate a
+ * network address / prefix.
+ *
+ * @retval 0 If successful.
+ * @retval -EINVAL If @a addr_len or @a addr_data are null
+ * or if the specified prefix length exceeds
+ * the address length.
+ *
+ */
static int inet_mask_addr_data(size_t addr_len,
void *addr_data,
uint8_t prefixlen)