|
|
@@ -5,6 +5,8 @@ extern "C" {
|
|
|
|
|
|
#include "evutils.h"
|
|
|
|
|
|
+#include <iostream>
|
|
|
+
|
|
|
#include <string.h>
|
|
|
#include <netdb.h>
|
|
|
#include <unistd.h>
|
|
|
@@ -22,12 +24,22 @@ unsigned int hostlookup(const char *hostname)
|
|
|
|
|
|
static unsigned int getlocalIP(void)
|
|
|
{
|
|
|
- char hostname[257];
|
|
|
+ unsigned int const hostname_len = 257+50;
|
|
|
+ char hostname[hostname_len];
|
|
|
if (gethostname(hostname, 256)) {
|
|
|
// Could not determine hostname
|
|
|
return 0;
|
|
|
}
|
|
|
hostname[256] = '\0';
|
|
|
+#if defined(RIPPLE)
|
|
|
+ // Use the 4*40Gbps bonded interface on RIPPLE
|
|
|
+ strcat(hostname, "-data0");
|
|
|
+#elif defined(GRAHAM)
|
|
|
+ // Use the Infiniband interface on GRAHAM
|
|
|
+ char temp_hostname[hostname_len];
|
|
|
+ strcpy(temp_hostname, hostname);
|
|
|
+ snprintf(hostname, sizeof(hostname), "%s%s", "ic-", temp_hostname);
|
|
|
+#endif
|
|
|
return hostlookup(hostname);
|
|
|
}
|
|
|
|