Networking_GetHardwareAddress Function

Header: #include <applibs/networking.h>

Retrieves the hardware address of the given network interface.

static int Networking_GetHardwareAddress(const char *networkInterfaceName, Networking_Interface_HardwareAddress *outAddress);

Parameters

  • networkInterfaceName The name of the network interface to retrieve.
  • outAddress A pointer to a HardwareAddress that receives the network interface's hardware address.

Errors

Returns -1 if an error is encountered and sets errno to the error value.

  • ENOINT: the network interface does not exist.

  • EPERM: this function is not allowed on the interface.

  • EAGAIN: the networking stack isn't ready.

  • EINVAL: the outAddress is invalid.

Any other errno may be specified; such errors aren't deterministic and there is no guarantee that the same behavior will be returned through the system.

Return value

Returns the number of network interfaces, or -1 for failure, in which case errno is set to the error value.

Concepts and samples