version 1.23.2.2, 2005/01/27 13:08:56
|
version 1.24, 2005/01/17 15:41:44
|
|
|
return dirname; | return dirname; |
} | } |
| |
|
String System::getHostIP(const String &hostName) |
|
{ |
|
struct hostent * phostent; |
|
struct in_addr inaddr; |
|
String ipAddress = String::EMPTY; |
|
|
|
if ((phostent = ::gethostbyname((const char *)hostName.getCString())) != NULL) |
|
{ |
|
::memcpy( &inaddr, phostent->h_addr,4); |
|
#ifdef PEGASUS_PLATFORM_ZOS_ZSERIES_IBM |
|
char * gottenIPAdress = NULL; |
|
gottenIPAdress = ::inet_ntoa( inaddr ); |
|
__etoa(gottenIPAdress); |
|
if (gottenIPAdress != NULL) |
|
{ |
|
ipAddress.assign(gottenIPAdress); |
|
} |
|
#else |
|
ipAddress = ::inet_ntoa( inaddr ); |
|
#endif |
|
} |
|
return ipAddress; |
|
} |
| |
// ------------------------------------------------------------------------ | // ------------------------------------------------------------------------ |
// Convert a hostname into a a single host unique integer representation | // Convert a hostname into a a single host unique integer representation |