mirror of
https://git.rtems.org/rtems-libbsd/
synced 2025-10-15 11:55:36 +08:00
Add rtems_bsd_get_ethernet_addr()
This commit is contained in:
@@ -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 */
|
||||
|
Reference in New Issue
Block a user