Network

Includes:
"APSCommonServices.h"
"APSDebugServices.h"
<netdb.h>
<sys/types.h>
<arpa/inet.h>
<fcntl.h>
<ifaddrs.h>
<sys/socket.h>
<sys/uio.h>

Introduction

Platform APIs for network and interfaces.



Functions

GetInterfaceMACAddress

Returns Ethernet MAC address of interface

GetPrimaryMACAddressPlatform

Gets the 6-byte MAC address of the primary network interface.


GetInterfaceMACAddress


Returns Ethernet MAC address of interface

OSStatus GetInterfaceMACAddress(
    const char *inInterfaceName,
    uint8_t *outMACAddress );  
Parameters
inInterfaceName

interface name (i.e., "eth0")

outMACAddress

6-byte Ethernet address of interface


GetPrimaryMACAddressPlatform


Gets the 6-byte MAC address of the primary network interface.

extern OSStatus GetPrimaryMACAddressPlatform(
    uint8_t outMAC[ 6 ] );  
Return Value

Scalar version of the 6-byte MAC address.

Discussion

Accessories with a WiFi interface should always return the MAC address of the WiFi interface as the primary MAC address, even when the WiFi interface is inactive.