8065
|
1 |
--- scorched/src/client/client/SecureID.cpp Tue Jul 20 02:28:59 2010
|
|
2 |
+++ scorched/src/client/client/SecureID.cpp Fri Dec 30 09:34:48 2011
|
|
3 |
@@ -75,6 +75,11 @@
|
2595
|
4 |
|
|
5 |
#include <sys/ioctl.h>
|
|
6 |
#include <net/if.h>
|
|
7 |
+#if defined(__sun) || defined (__sun__)
|
|
8 |
+#include <sys/sockio.h>
|
|
9 |
+#include <unistd.h>
|
|
10 |
+#include <stropts.h>
|
|
11 |
+#endif
|
|
12 |
|
|
13 |
std::string SecureID::GetPrivateKey(void)
|
|
14 |
{
|
8065
|
15 |
@@ -110,7 +115,11 @@
|
2595
|
16 |
if_freenameindex(NameList); //free the memory
|
|
17 |
|
|
18 |
strcpy (dev.ifr_name, InterfaceName.c_str()); //select from the name
|
|
19 |
+#if defined(__sun) || defined (__sun__)
|
|
20 |
+ if (ioctl(sock, SIOCGENADDR, &dev) < 0) //get the interface data
|
|
21 |
+#else
|
|
22 |
if (ioctl(sock, SIOCGIFHWADDR, &dev) < 0) //get the interface data
|
|
23 |
+#endif
|
|
24 |
{
|
|
25 |
close(sock);
|
|
26 |
return ""; //cannot list the interfaces
|
8065
|
27 |
@@ -118,7 +127,11 @@
|
2595
|
28 |
|
|
29 |
for (int i=0; i<6; i++)
|
|
30 |
{
|
|
31 |
+#if defined(__sun) || defined (__sun__)
|
|
32 |
+ Key += (((unsigned int)dev.ifr_ifru.ifru_enaddr[i])&255);
|
|
33 |
+#else
|
|
34 |
Key += (((unsigned int)dev.ifr_hwaddr.sa_data[i])&255);
|
|
35 |
+#endif
|
|
36 |
if (i != 5) Key += ':';
|
|
37 |
}
|
|
38 |
close(sock);
|