summaryrefslogtreecommitdiffstats
path: root/src/macaddr.c
diff options
context:
space:
mode:
authorHarald Welte <laforge@gnumonks.org>2016-04-25 12:11:20 +0200
committerHarald Welte <laforge@gnumonks.org>2016-05-05 18:49:27 +0200
commit2d2e2cca0dc1d62addc9c9fcb3a59f343fc3baf6 (patch)
tree8ec3ba89d486e4c324d32d1980ce68d5118d2db1 /src/macaddr.c
parent0996c879255e4653740814112bf98d0ddc93100c (diff)
Update doxygen annotations in libosmocore
This adds and improves doxygen API descriptions all over libosmocore, reducing the 'white spots' that don't have any documentation.
Diffstat (limited to 'src/macaddr.c')
-rw-r--r--src/macaddr.c27
1 files changed, 25 insertions, 2 deletions
diff --git a/src/macaddr.c b/src/macaddr.c
index a6e1304a..f83e0546 100644
--- a/src/macaddr.c
+++ b/src/macaddr.c
@@ -20,12 +20,24 @@
*
*/
+/*! \addtogroup utils
+ * @{
+ */
+
+/*! \file loggingrb.c */
+
#include <stdint.h>
#include <string.h>
#include <stdlib.h>
#include <unistd.h>
-
+/*! \brief Parse a MAC address from human-readable notation
+ * This function parses an ethernet MAC address in the commonly-used
+ * hex/colon notation (00:00:00:00:00:00) and generates the binary
+ * representation from it.
+ * \param[out] out pointer to caller-allocated buffer of 6 bytes
+ * \param[in] in pointer to input data as string with hex/colon notation
+ */
int osmo_macaddr_parse(uint8_t *out, const char *in)
{
/* 00:00:00:00:00:00 */
@@ -54,7 +66,11 @@ int osmo_macaddr_parse(uint8_t *out, const char *in)
#include <net/if_dl.h>
#include <net/if_types.h>
-
+/*! \brief Obtain the MAC address of a given network device
+ * \param[out] mac_out pointer to caller-allocated buffer of 6 bytes
+ * \param[in] dev_name string name of the network device
+ * \returns 0 in case of success; negative otherwise
+ */
int osmo_get_macaddr(uint8_t *mac_out, const char *dev_name)
{
int rc = -1;
@@ -92,6 +108,11 @@ int osmo_get_macaddr(uint8_t *mac_out, const char *dev_name)
#include <netinet/in.h>
#include <netinet/ip.h>
+/*! \brief Obtain the MAC address of a given network device
+ * \param[out] mac_out pointer to caller-allocated buffer of 6 bytes
+ * \param[in] dev_name string name of the network device
+ * \returns 0 in case of success; negative otherwise
+ */
int osmo_get_macaddr(uint8_t *mac_out, const char *dev_name)
{
int fd, rc;
@@ -114,3 +135,5 @@ int osmo_get_macaddr(uint8_t *mac_out, const char *dev_name)
return 0;
}
#endif
+
+/*! @} */