(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.65 and 1.68.4.3

version 1.65, 2006/10/04 19:37:09 version 1.68.4.3, 2007/10/16 18:57:18
Line 47 
Line 47 
 #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
Line 125 
Line 126 
     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.       */
       static Boolean isIpOnNetworkInterface(Uint32 inIP);
   
       /**
           Attempts to resolve a given hostname
           this function possibly can take some as it can request information
           from the DNS
   
           @param resolvedNameIP On successful hostname resolution, this output
           parameter contains the IP address that was determined.
           @return true if successful, false if not successful.
        */
       static Boolean resolveHostNameAtDNS(
           const char* hostname,
           Uint32* resolvedNameIP);
  
         @param  hostName  the host name to validate      /**
           Attempts to resolve a given IP address
           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);
  
         @return  True if the input hostName can be validated to represent the      /**
                  same host;          Bundling function used to determine if a given hostname or IP address
                  False otherwise          belongs to the local host
           this function has the potential to take some time as it will possibly
           use the DNS
      */      */
     static Boolean sameHost (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 160 
Line 197 
  
     /**     /**
     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 190 
Line 227 
  
     /**     /**
     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 200 
Line 236 
     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 227 
Line 260 
 #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 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 #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
  
     /**     /**
     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();
Line 314 
Line 350 
         Uint32 severity,         Uint32 severity,
         const char* message);         const char* message);
  
       static void openlog(
           const char *ident,
           int logopt,
           int facility);
   
       static void closelog();
   
     // 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;
  


Legend:
Removed from v.1.65  
changed lines
  Added in v.1.68.4.3

No CVS admin address has been configured
Powered by
ViewCVS 0.9.2