Files
dial-reference/server/LinuxInterfaces.h
Chintan Parikh ac3e488924 Compile DIAL client and server for macOS.
Changes:
* Added method to get mac and ip address for OSX. Current Linux method
of query via SIOCGIFCONF doesn't work. Added code to read via getifaddrs() API.
* Put non OSX specific code under #ifdef flags.
* Removed few linker libraries which are not required (lcares and lrt).
* Fixed many warnings.

Tested on: OSX 10.12
2017-12-26 21:16:24 -08:00

30 lines
526 B
C

#ifndef LINUXINTERFACES_H_
#define LINUXINTERFACES_H_
#ifndef __APPLE__
#include <linux/limits.h>
#include <linux/wireless.h>
#endif
#include <arpa/inet.h>
#include <dirent.h>
#include <netinet/in.h>
#include <string.h>
#include <sys/ioctl.h>
#include <sys/socket.h>
#include <unistd.h>
#include <stdio.h>
/* Fetch the MACAddress of a network interface */
#define MACBUFSIZE 32
#define WAKEUPTIMEOUT 15
typedef struct
{
char macAddress[MACBUFSIZE];
}NetInterface;
NetInterface getDefaultNetworkInterfaces();
#endif