~n-muench/ubuntu/precise/open-vm-tools/open-vm-tools.march-merge

« back to all changes in this revision

Viewing changes to lib/misc/machineID.c

  • Committer: Nate Muench
  • Date: 2012-03-22 17:50:13 UTC
  • mfrom: (1.4.7)
  • Revision ID: nowiwilldestroyabydos@gmail.com-20120322175013-0jh30wfk7ut20rdj
Tags: 2012.03.13-651368-0ubuntu1
* Merge latest upstream git tag.
* debian/rules: Removed glib2.0 compatibility CFLAG.
  - Packaging can now build without it.

Show diffs side-by-side

added added

removed removed

Lines of Context:
248
248
#elif defined(__APPLE__)        // MacOS X
249
249
#include <sys/socket.h>
250
250
#include <ifaddrs.h>
 
251
#include <net/if_dl.h>
 
252
#include <net/ethernet.h>
251
253
 
252
254
 
253
255
/*
337
339
      p = CheckEthernet(ifp, i);
338
340
 
339
341
      if (p != NULL) {
340
 
         union bytes {
341
 
            uint64 data;
342
 
            char   bytes[8];
343
 
         } x;
344
 
 
345
 
         x.bytes[0] = p->ifa_addr->sa_data[9]  & 0xFF;  //XXX: hack!
346
 
         x.bytes[1] = p->ifa_addr->sa_data[10] & 0xFF;  //XXX: hack!
347
 
         x.bytes[2] = p->ifa_addr->sa_data[11] & 0xFF;  //XXX: hack!
348
 
         x.bytes[3] = p->ifa_addr->sa_data[12] & 0xFF;  //XXX: hack!
349
 
         x.bytes[4] = p->ifa_addr->sa_data[13] & 0xFF;  //XXX: hack!
350
 
         x.bytes[5] = p->ifa_addr->sa_data[14] & 0xFF;  //XXX: hack!
351
 
         x.bytes[6] = '\0';
352
 
         x.bytes[7] = '\0';
353
 
 
354
 
         *hardwareID = x.data;
355
 
 
 
342
         memcpy(hardwareID, LLADDR((struct sockaddr_dl *)p->ifa_addr), ETHER_ADDR_LEN);
356
343
         break;
357
344
      }
358
345
   }
361
348
 
362
349
   return 0;
363
350
}
364
 
#elif defined(linux)            // Linux
 
351
#elif defined(linux) || defined __ANDROID__
365
352
#include <unistd.h>
366
353
#include <sys/ioctl.h>
367
354
#include <net/if.h>
368
355
#include <sys/time.h>
 
356
#if defined __ANDROID__
 
357
#include <sys/socket.h>  // For SOCK_DGRAM etc.
 
358
#endif
369
359
 
370
360
 
371
361
/*