open-license-manager
2014-09-16 1e166c13aaabe8d2aad1d604c77020a14dc577cd
src/library/os/linux/os-linux.c
@@ -1,4 +1,6 @@
#ifndef _GNU_SOURCE
#define _GNU_SOURCE     /* To get defns of NI_MAXSERV and NI_MAXHOST */
#endif
#include <arpa/inet.h>
#include <sys/socket.h>
#include <netdb.h>
@@ -20,7 +22,7 @@
#include <sys/ioctl.h>
#include <sys/stat.h>
#include "../os.h"
#include "../../base/public-key.h"
#include "public-key.h"
#include <openssl/evp.h>
#include <openssl/bio.h>
@@ -33,6 +35,7 @@
#include <dbus-1.0/dbus/dbus.h>
#include <sys/utsname.h>
static int ifname_position(char *ifnames, char * ifname, int ifnames_max) {
   int i, position;
@@ -47,7 +50,7 @@
}
FUNCTION_RETURN getAdapterInfos(AdapterInfo * adapterInfos,
FUNCTION_RETURN getAdapterInfos(OsAdapterInfo * adapterInfos,
      size_t * adapter_info_size) {
   FUNCTION_RETURN f_return = FUNC_RET_OK;
@@ -63,7 +66,7 @@
   }
   if (adapterInfos != NULL) {
      memset(adapterInfos, 0, (*adapter_info_size) * sizeof(AdapterInfo));
      memset(adapterInfos, 0, (*adapter_info_size) * sizeof(OsAdapterInfo));
   }
   /* count the maximum number of interfaces */
@@ -116,7 +119,7 @@
          sizeof(struct sockaddr_in) :
          sizeof(struct sockaddr_in6), host, NI_MAXHOST,
          NULL, 0, NI_NUMERICHOST);
          */
#ifdef _DEBUG
         s = getnameinfo(ifa->ifa_addr, sizeof(struct sockaddr_in), host,
               NI_MAXHOST,
@@ -126,7 +129,7 @@
         }
         printf("\t\taddress: <%s>\n", host);
#endif
*/
         if (adapterInfos != NULL && if_name_position < *adapter_info_size) {
            struct sockaddr_in *s1 = (struct sockaddr_in*) ifa->ifa_addr;
            in_addr_t iaddr = s1->sin_addr.s_addr;