diff options
author | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2014-01-20 13:09:13 +0100 |
---|---|---|
committer | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2014-01-30 15:04:19 +0100 |
commit | c50f1b42fe25f4debc203f1fd78b93fea67ca56a (patch) | |
tree | 11a45e0ff02a7145350d42ecd989454044375594 /rtemsbsd/include/rtems/bsd/util.h | |
parent | Add <rtems/bsd/util.h> (diff) | |
download | rtems-libbsd-c50f1b42fe25f4debc203f1fd78b93fea67ca56a.tar.bz2 |
Add rtems_bsd_get_ethernet_addr()
Diffstat (limited to 'rtemsbsd/include/rtems/bsd/util.h')
-rw-r--r-- | rtemsbsd/include/rtems/bsd/util.h | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/rtemsbsd/include/rtems/bsd/util.h b/rtemsbsd/include/rtems/bsd/util.h index a5bd2ecd..2b1e6eeb 100644 --- a/rtemsbsd/include/rtems/bsd/util.h +++ b/rtemsbsd/include/rtems/bsd/util.h @@ -32,10 +32,31 @@ #ifndef _RTEMS_BSD_UTIL_H_ #define _RTEMS_BSD_UTIL_H_ +#include <sys/types.h> + +#include <net/ethernet.h> + +#include <stdint.h> + #ifdef __cplusplus extern "C" { #endif /* __cplusplus */ +/** + * @brief Gets the Ethernet address of an interface identified by its name. + * + * This function uses getifaddrs(). The interface type is not checked, so it + * is only safe to use this function for Ethernet type interfaces. + * + * @param[in] ifname The name of the interface. + * @parma[out] eaddr The Ethernet address of this interface. + * + * @retval 0 Successful operation. + * @retval -1 An error occurred. The errno is set to indicate the error. + */ +int +rtems_bsd_get_ethernet_addr(const char *ifname, uint8_t eaddr[ETHER_ADDR_LEN]); + #ifdef __cplusplus } #endif /* __cplusplus */ |