version 1.68, 2006/11/10 18:14:58
|
version 1.68.4.5, 2008/02/08 19:43:54
|
|
|
#endif | #endif |
#endif | #endif |
| |
#if defined (PEGASUS_OS_TYPE_UNIX) || (PEGASUS_OS_VMS) |
#if defined (PEGASUS_OS_TYPE_UNIX) || \ |
|
defined (PEGASUS_OS_VMS) |
# ifndef PEGASUS_OS_OS400 | # ifndef PEGASUS_OS_OS400 |
# include <unistd.h> | # include <unistd.h> |
# endif | # endif |
|
|
static String getHostName(); | static String getHostName(); |
static String getFullyQualifiedHostName (); | static String getFullyQualifiedHostName (); |
static String getSystemCreationClassName (); | static String getSystemCreationClassName (); |
static String getHostIP(const String &hostName); |
|
| |
static Uint32 _acquireIP(const char* hostname); |
// Gets IP address assosiated with hostName. af indicates the |
|
// type of address (ipv4 or ipv6) returned. |
|
static Boolean getHostIP(const String &hostName, int *af, String &hostIP); |
|
|
|
// Gets IP address in binary form. af indicates the type of |
|
// address (ipv4 or ipv6) returned. Address will be copied to dst. |
|
static Boolean _acquireIP(const char* hostname, int *af, void *dst); |
|
|
|
/** |
|
Returns true if IPv6 stack is active by checking return code from |
|
Socket::createSocket() and getSocketError() calls. |
|
|
|
ATTN: We return true if some error other than |
|
PEGASUS_INVALID_ADDRESS_FAMILY is returned while creating the socket |
|
because we will not be sure whether the IPv6 stack is active or not |
|
from the returned error code. Return value of "true" from this method |
|
should not be trusted absolutely. |
|
*/ |
|
#ifdef PEGASUS_ENABLE_IPV6 |
|
static Boolean isIPv6StackActive(); |
|
#endif |
| |
static Uint32 lookupPort( | static Uint32 lookupPort( |
const char * serviceName, | const char * serviceName, |
Uint32 defaultPort); | Uint32 defaultPort); |
| |
/** | /** |
Attempts to validate that the input hostName represents the same host as |
|
the host represented by the value returned by the |
|
getFullyQualifiedHostName() method. |
|
|
|
@param hostName the host name to validate |
|
|
|
@return True if the input hostName can be validated to represent the |
|
same host; |
|
False otherwise |
|
*/ |
|
static Boolean sameHost (const String & hostName); |
|
|
|
/** |
|
Attempts to find the given IP address(32bit) on any of the local defined | Attempts to find the given IP address(32bit) on any of the local defined |
network interfaces | network interfaces |
*/ | */ |
|
|
*/ | */ |
static Boolean isLocalHost(const String& hostName); | static Boolean isLocalHost(const String& hostName); |
| |
|
/** |
|
Checks binIPAddress represented by address family and returns true |
|
if binary representation matches with loopback ip address. binIPAddress |
|
must be in host-byte order. |
|
*/ |
|
static Boolean isLoopBack(int af, void *binIPAddress); |
|
|
static String getEffectiveUserName(); | static String getEffectiveUserName(); |
| |
/** | /** |
|
|
#endif | #endif |
| |
/** | /** |
Changes the process user context to the specified user and group ID. |
Changes the process user context to the specified user and group. |
|
IMPORTANT: This method is not reentrant and not async signal safe. |
|
It should only be called in a single-threaded program. |
|
@param userName User name to set as the process user context. |
@param uid User ID to set as the process user context. | @param uid User ID to set as the process user context. |
@param gid Group ID to set as the process group context. | @param gid Group ID to set as the process group context. |
@return True if the user context is successfully changed, | @return True if the user context is successfully changed, |
false otherwise. | false otherwise. |
*/ | */ |
#ifndef PEGASUS_OS_OS400 | #ifndef PEGASUS_OS_OS400 |
static Boolean changeUserContext( |
static Boolean changeUserContext_SingleThreaded( |
|
const char* userName, |
const PEGASUS_UID_T& uid, | const PEGASUS_UID_T& uid, |
const PEGASUS_GID_T& gid); | const PEGASUS_GID_T& gid); |
#endif | #endif |