version 1.45, 2006/11/20 13:53:41
|
version 1.46, 2006/12/13 09:47:39
|
|
|
// differentiate between a dotted IP address given | // differentiate between a dotted IP address given |
// and a real hostname given | // and a real hostname given |
CString csName = hostName.getCString(); | CString csName = hostName.getCString(); |
char * cc_hostname = strdup((const char*) csName); |
char cc_hostname[PEGASUS_MAXHOSTNAMELEN]; |
|
strcpy(cc_hostname, (const char*) csName); |
Uint32 tmp_addr = 0xFFFFFFFF; | Uint32 tmp_addr = 0xFFFFFFFF; |
Boolean hostNameIsIPNotation; | Boolean hostNameIsIPNotation; |
| |
|
|
{ | { |
// localhost ? | // localhost ? |
if (String::equalNoCase(hostName,String("localhost"))) return true; | if (String::equalNoCase(hostName,String("localhost"))) return true; |
char* localHostName = |
char localHostName[PEGASUS_MAXHOSTNAMELEN]; |
strdup((const char*) System::getHostName().getCString()); |
CString cstringLocalHostName = System::getHostName().getCString()); |
|
strcpy(localHostName, (const char*) cstringLocalHostName); |
// given hostname equals what system returns as local hostname ? | // given hostname equals what system returns as local hostname ? |
if (String::equalNoCase(hostName,localHostName)) return true; | if (String::equalNoCase(hostName,localHostName)) return true; |
Uint32 hostIP; | Uint32 hostIP; |