version 1.88, 2010/04/09 08:23:14
|
version 1.92, 2012/09/05 11:10:33
|
|
|
#include <Pegasus/Common/Linkage.h> | #include <Pegasus/Common/Linkage.h> |
#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 <sys/stat.h> | #include <sys/stat.h> |
| |
| |
|
|
*/ | */ |
static void getCurrentTimeUsec(Uint32& seconds, Uint32& microseconds); | static void getCurrentTimeUsec(Uint32& seconds, Uint32& microseconds); |
| |
|
/** Similar to getCurrentTime() above but get the full time in microseconds |
|
*/ |
|
static Uint64 getCurrentTimeUsec(); |
|
|
/** getCurrentASCIITime Gets time/date in a fixed format. The format is | /** getCurrentASCIITime Gets time/date in a fixed format. The format is |
YY MM DD-HH:MM:SS | YY MM DD-HH:MM:SS |
@return Returns String with the ASCII time date. | @return Returns String with the ASCII time date. |
|
|
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; |
}; | }; |
| |
/** | /** |