version 1.90, 2010/07/05 08:58:36
|
version 1.90.2.2, 2013/07/20 18:32:39
|
|
|
#include <Pegasus/Common/Logger.h> | #include <Pegasus/Common/Logger.h> |
#include <Pegasus/Common/Network.h> | #include <Pegasus/Common/Network.h> |
#include <Pegasus/Common/Mutex.h> | #include <Pegasus/Common/Mutex.h> |
|
#include <Pegasus/Common/Pegasus_inl.h> |
#include <sys/stat.h> | #include <sys/stat.h> |
| |
| |
|
|
char* buf = 0, | char* buf = 0, |
size_t buflen = 0); | size_t buflen = 0); |
| |
#if defined(PEGASUS_OS_ZOS) || \ |
|
defined(PEGASUS_OS_VMS) || \ |
|
defined(PEGASUS_ENABLE_IPV6) |
|
| |
// The following 2 methods are wrappers around system functions | // The following 2 methods are wrappers around system functions |
// getaddrinfo/getnameinfo. | // getaddrinfo/getnameinfo. |
// In addition to calling corresponding system functions, these | // In addition to calling corresponding system functions, these |
// methods introduce re-tries on EAI_AGAIN error returns. | // methods introduce re-tries on EAI_AGAIN error returns. |
|
// |
|
// Callers are expected to call freeaddrinfo when using System::getAddrInfo |
static int getAddrInfo( | static int getAddrInfo( |
const char *hostname, | const char *hostname, |
const char *servname, | const char *servname, |
|
|
size_t servlen, | size_t servlen, |
int flags); | int flags); |
| |
#endif |
|
|
|
// Gets IP address assosiated with hostName. af indicates the | // Gets IP address assosiated with hostName. af indicates the |
// type of address (ipv4 or ipv6) returned. | // type of address (ipv4 or ipv6) returned. |
static Boolean getHostIP(const String &hostName, int *af, String &hostIP); | static Boolean getHostIP(const String &hostName, int *af, String &hostIP); |
|
|
| |
static void closelog(); | static void closelog(); |
| |
|
/** Function to set hostname and thus override system supplied value */ |
|
static void setHostName(const String & hostName); |
|
|
|
/** Function to set fully qualified hostname and thus override system |
|
supplied value */ |
|
static void setFullyQualifiedHostName(const String & fullHostName); |
|
|
// System ID constants for Logger::put and Logger::trace | // System ID constants for Logger::put and Logger::trace |
static const String CIMSERVER; | static const String CIMSERVER; |
| |
|
|
static const String CIMLISTENER; | static const String CIMLISTENER; |
| |
// mutex used for synchronising threads calling getHostName. | // mutex used for synchronising threads calling getHostName. |
static MutexType _mutexForGetHostName; |
static Mutex _mutexForGetHostName; |
| |
// mutex used for synchronising threads calling getFullyQualifiedHostName | // mutex used for synchronising threads calling getFullyQualifiedHostName |
static MutexType _mutexForGetFQHN; |
static Mutex _mutexForGetFQHN; |
| |
|
private: |
|
// Strings caching hostnames to avoid repeated resolver lookups and to |
|
// enable setting by configuration |
|
static String _hostname; |
|
static String _fullyQualifiedHostname; |
}; | }; |
| |
/** | /** |