(file) Return to System.h CVS log (file) (dir) Up to [Pegasus] / pegasus / src / Pegasus / Common

Diff for /pegasus/src/Pegasus/Common/System.h between version 1.67 and 1.70.2.2

version 1.67, 2006/11/08 20:38:30 version 1.70.2.2, 2007/06/12 09:31:58
Line 48 
Line 48 
 #endif #endif
  
 #if defined (PEGASUS_OS_TYPE_UNIX) || (PEGASUS_OS_VMS) #if defined (PEGASUS_OS_TYPE_UNIX) || (PEGASUS_OS_VMS)
 # ifndef PEGASUS_OS_OS400  
 #  include <unistd.h> #  include <unistd.h>
 # endif  
 # include <fcntl.h>  // File locking # include <fcntl.h>  // File locking
 # define PEGASUS_UID_T uid_t # define PEGASUS_UID_T uid_t
 # define PEGASUS_GID_T gid_t # define PEGASUS_GID_T gid_t
Line 125 
Line 123 
     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);
  
     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          Attempts to find the given IP address(32bit) on any of the local defined
         the host represented by the value returned by the          network interfaces
         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  
      *  network interfaces  
      */      */
     static Boolean isIpOnNetworkInterface(Uint32 inIP);     static Boolean isIpOnNetworkInterface(Uint32 inIP);
  
     /**     /**
      *  Attempts to resolve a given hostname          Attempts to resolve a given hostname
      *  this function possibly can take some as it can request information          this function possibly can take some as it can request information
      *  from the DNS          from the DNS
      *  
      *  Return: return value == true if successful, false if not successful          @param resolvedNameIP On successful hostname resolution, this output
      *          the IP address that was determined resides in resolvedNameIP          parameter contains the IP address that was determined.
      */          @return true if successful, false if not successful.
     static Boolean resolveHostNameAtDNS(const char* hostname, Uint32 * resolvedNameIP);       */
       static Boolean resolveHostNameAtDNS(
     /**          const char* hostname,
      *  Attempts to resolve a given IP address          Uint32* resolvedNameIP);
      *  this function possibly can take some as it can request information  
      *  from the DNS      /**
      *  Return: return value == true if successful, false if not successful          Attempts to resolve a given IP address
      *          the IP address that was determined resides in resolvedNameIP          this function possibly can take some as it can request information
           from the DNS
           @param resolvedIP On successful hostname resolution, this output
           parameter contains the IP address that was determined.
           @return true if successful, false if not successful.
      */      */
     static Boolean resolveIPAtDNS(Uint32 ip_addr, Uint32 * resolvedIP);     static Boolean resolveIPAtDNS(Uint32 ip_addr, Uint32 * resolvedIP);
  
     /**     /**
      * Bundling function used to determine if a given hostname or IP address          Bundling function used to determine if a given hostname or IP address
      * belongs to the local host          belongs to the local host
      * this function has the potential to take some time as it will possibly          this function has the potential to take some time as it will possibly
      * use the DNS          use the DNS
      */      */
     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();
  
     /**     /**
Line 193 
Line 194 
  
     /**     /**
     This function is used to encrypt the user's password.     This function is used to encrypt the user's password.
     The encryption is compatible with Apache's  password file (generated using          The encryption is compatible with Apache's password file (generated
     the htpasswd command )          using the htpasswd command)
  
     @param password     Password to be encrypted.     @param password     Password to be encrypted.
     @param salt         Two character string chosen from the set [a-zA-Z0-9./].     @param salt         Two character string chosen from the set [a-zA-Z0-9./].
Line 223 
Line 224 
  
     /**     /**
     This function returns the privileged user name on the system.     This function returns the privileged user name on the system.
   
     @return             the privileged user name     @return             the privileged user name
     */     */
     static String getPrivilegedUserName();     static String getPrivilegedUserName();
Line 233 
Line 233 
     of the specified user group.     of the specified user group.
  
     @param userName     User name to be verified.     @param userName     User name to be verified.
   
     @param groupName    User group name.     @param groupName    User group name.
  
     @return             true if the user is a member of the user group,          @return true if the user is a member of the user group, false otherwise.
                         false otherwise.          @throw InternalSystemError - If there is an error accessing the
           specified user or group information.
     @throw              InternalSystemError - If there is an error  
                         accessing the specified user or group information.  
     */     */
     static Boolean isGroupMember(const char* userName, const char* groupName);     static Boolean isGroupMember(const char* userName, const char* groupName);
  
Line 252 
Line 249 
         @return          True if the user and group IDs were retrieved         @return          True if the user and group IDs were retrieved
                          successfully, false otherwise.                          successfully, false otherwise.
     */     */
 #ifndef PEGASUS_OS_OS400  
     static Boolean lookupUserId(     static Boolean lookupUserId(
         const char* userName,         const char* userName,
         PEGASUS_UID_T& uid,         PEGASUS_UID_T& uid,
         PEGASUS_GID_T& gid);         PEGASUS_GID_T& gid);
 #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 uses non-reentrant functions and 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      static Boolean changeUserContext_SingleThreaded(
     static Boolean changeUserContext(          const char* userName,
         const PEGASUS_UID_T& uid,         const PEGASUS_UID_T& uid,
         const PEGASUS_GID_T& gid);         const PEGASUS_GID_T& gid);
 #endif  
  
     /**     /**
     This function is used to get the process ID of the calling process.     This function is used to get the process ID of the calling process.
   
     @return             Process ID     @return             Process ID
     */     */
     static Uint32 getPID();     static Uint32 getPID();


Legend:
Removed from v.1.67  
changed lines
  Added in v.1.70.2.2

No CVS admin address has been configured
Powered by
ViewCVS 0.9.2