(file) Return to cimserver_windows.cpp CVS log (file) (dir) Up to [Pegasus] / pegasus / src / WMIMapper / WMIServer / Attic

Diff for /pegasus/src/WMIMapper/WMIServer/Attic/cimserver_windows.cpp between version 1.6 and 1.14

version 1.6, 2004/02/03 13:04:14 version 1.14, 2005/04/04 10:52:26
Line 1 
Line 1 
 //%2003////////////////////////////////////////////////////////////////////////  //%2005////////////////////////////////////////////////////////////////////////
 // //
 // Copyright (c) 2000, 2001, 2002  BMC Software, Hewlett-Packard Development  // Copyright (c) 2000, 2001, 2002 BMC Software; Hewlett-Packard Development
 // Company, L. P., IBM Corp., The Open Group, Tivoli Systems.  // Company, L.P.; IBM Corp.; The Open Group; Tivoli Systems.
 // Copyright (c) 2003 BMC Software; Hewlett-Packard Development Company, L. P.; // Copyright (c) 2003 BMC Software; Hewlett-Packard Development Company, L. P.;
 // IBM Corp.; EMC Corporation, The Open Group. // IBM Corp.; EMC Corporation, The Open Group.
   // Copyright (c) 2004 BMC Software; Hewlett-Packard Development Company, L.P.;
   // IBM Corp.; EMC Corporation; VERITAS Software Corporation; The Open Group.
   // Copyright (c) 2005 Hewlett-Packard Development Company, L.P.; IBM Corp.;
   // EMC Corporation; VERITAS Software Corporation; The Open Group.
 // //
 // Permission is hereby granted, free of charge, to any person obtaining a copy // Permission is hereby granted, free of charge, to any person obtaining a copy
 // of this software and associated documentation files (the "Software"), to // of this software and associated documentation files (the "Software"), to
Line 32 
Line 36 
 //              Roger Kumpf, Hewlett-Packard Company (roger_kumpf@hp.com) //              Roger Kumpf, Hewlett-Packard Company (roger_kumpf@hp.com)
 //              Jair Santos, Hewlett-Packard Company (jair.santos@hp.com) //              Jair Santos, Hewlett-Packard Company (jair.santos@hp.com)
 //              Dan Gorey, IBM (djgorey@us.ibm.com) //              Dan Gorey, IBM (djgorey@us.ibm.com)
   //              Mateus Baur, Hewlett-Packard Company (mateus.baur@hp.com)
   //              Josephine Eskaline Joyce, IBM (jojustin@in.ibm.com) for Bug#2031
 // //
 //%///////////////////////////////////////////////////////////////////////////// //%/////////////////////////////////////////////////////////////////////////////
  
Line 39 
Line 45 
 #include <process.h>    /* _beginthread, _endthread */ #include <process.h>    /* _beginthread, _endthread */
 #include <tchar.h> #include <tchar.h>
 #include <direct.h> #include <direct.h>
   #include <Pegasus/Common/MessageLoader.h> //l10n
   #include <Pegasus/Common/Thread.h>  // l10n
  
 #include "service.cpp" #include "service.cpp"
  
Line 55 
Line 63 
 //------------------------------------------------------------------------- //-------------------------------------------------------------------------
 // GLOBALS // GLOBALS
 //------------------------------------------------------------------------- //-------------------------------------------------------------------------
 CIMServer *server_windows;  static Mutex _cimserverLock;
   static CIMServer *server_windows = 0;
   static bool _shutdown = false;
 static Service pegasus_service(PEGASUS_SERVICE_NAME); static Service pegasus_service(PEGASUS_SERVICE_NAME);
 static HANDLE pegasus_service_event;  static HANDLE pegasus_service_event = NULL;
 static LPCSTR g_cimservice_key  = TEXT("SYSTEM\\CurrentControlSet\\Services\\%s"); static LPCSTR g_cimservice_key  = TEXT("SYSTEM\\CurrentControlSet\\Services\\%s");
 static LPCSTR g_cimservice_home = TEXT("home"); static LPCSTR g_cimservice_home = TEXT("home");
  
Line 98 
Line 108 
   ConfigManager::setPegasusHome(pegasusHome);   ConfigManager::setPegasusHome(pegasusHome);
  
   ConfigManager* configManager = ConfigManager::getInstance();   ConfigManager* configManager = ConfigManager::getInstance();
     configManager->useConfigFiles = true;
   int dummy = 0;   int dummy = 0;
  
   try   try
Line 113 
Line 124 
     configManager->getCurrentValue("enableHttpConnection"), "true");     configManager->getCurrentValue("enableHttpConnection"), "true");
   Boolean enableHttpsConnection = String::equal(   Boolean enableHttpsConnection = String::equal(
     configManager->getCurrentValue("enableHttpsConnection"), "true");     configManager->getCurrentValue("enableHttpsConnection"), "true");
           Boolean enableSSLExportClientVerification = String::equal(
                   configManager->getCurrentValue("enableSSLExportClientVerification"), "true");
  
   if (!enableHttpConnection && !enableHttpsConnection)   if (!enableHttpConnection && !enableHttpsConnection)
   {   {
Line 128 
Line 141 
  
   Uint32 portNumberHttps;   Uint32 portNumberHttps;
   Uint32 portNumberHttp;   Uint32 portNumberHttp;
     Uint32 portNumberExportHttps;
  
   if (enableHttpsConnection)   if (enableHttpsConnection)
   {   {
Line 157 
Line 171 
     portNumberHttp = System::lookupPort(WBEM_HTTP_SERVICE_NAME, port);     portNumberHttp = System::lookupPort(WBEM_HTTP_SERVICE_NAME, port);
   }   }
  
     if (enableSSLExportClientVerification)
     {
          //
          // No config property is looked up to get the default port number.
          // Lookup the port defined in /etc/services for the service name
          // wbem-exp-https and bind to that port. If the service is  not defined
          // then log a warning message and do not start the cimserver.
          //
          Uint32 port = 0;
   
          portNumberExportHttps = System::lookupPort(WBEM_EXPORT_HTTPS_SERVICE_NAME, port);
   
          if (portNumberExportHttps == 0)
          {
              Logger::put_l(Logger::STANDARD_LOG, System::CIMSERVER, Logger::WARNING,
                  "src.Server.cimserver.EXPORT_HTTPS_PORT_NOT_DEFINED",
                  "Port not defined for the service wbem-exp-https. CIMServer will not be started.");
   
              MessageLoaderParms parms("src.Server.cimserver.EXPORT_HTTPS_PORT_NOT_DEFINED",
                  "Port not defined for the service wbem-exp-https. CIMServer will not be started.");
   
              cerr << MessageLoader::getMessage(parms) << endl;
          }
     }
   
   // Set up the Logger   // Set up the Logger
   String logsDirectory = String::EMPTY;   String logsDirectory = String::EMPTY;
   logsDirectory = configManager->getCurrentValue("logdir");   logsDirectory = configManager->getCurrentValue("logdir");
Line 166 
Line 205 
  
   // Put server start message to the logger   // Put server start message to the logger
   Logger::put(Logger::STANDARD_LOG, PEGASUS_SERVICE_NAME, Logger::INFORMATION,   Logger::put(Logger::STANDARD_LOG, PEGASUS_SERVICE_NAME, Logger::INFORMATION,
               "Started $0 version $1.", PEGASUS_NAME, PEGASUS_VERSION);        "Started $0 version $1.", PEGASUS_PRODUCT_NAME, PEGASUS_PRODUCT_VERSION);
  
    // try loop to bind the address, and run the server    // try loop to bind the address, and run the server
   try   try
   {   {
     #ifdef PEGASUS_USE_23HTTPMONITOR_CLIENT      Monitor monitor;
     Monitor monitor(true);  
     #else  
     monitor_2 monitor();  
     #endif  
  
     CIMServer server(&monitor);     CIMServer server(&monitor);
     server_windows = &server;     server_windows = &server;
  
     if (enableHttpConnection)     if (enableHttpConnection)
     {     {
       server_windows->addAcceptor(false, portNumberHttp, false);        server_windows->addAcceptor(false, portNumberHttp, false, false);
       Logger::put(Logger::STANDARD_LOG, "CIMServer", Logger::INFORMATION,       Logger::put(Logger::STANDARD_LOG, "CIMServer", Logger::INFORMATION,
                   "Listening on HTTP port $0.", portNumberHttp);                   "Listening on HTTP port $0.", portNumberHttp);
     }     }
     if (enableHttpsConnection)     if (enableHttpsConnection)
     {     {
       server_windows->addAcceptor(false, portNumberHttps, true);        server_windows->addAcceptor(false, portNumberHttps, true, false);
       Logger::put(Logger::STANDARD_LOG, "CIMServer", Logger::INFORMATION,       Logger::put(Logger::STANDARD_LOG, "CIMServer", Logger::INFORMATION,
                   "Listening on HTTPS port $0.", portNumberHttps);                   "Listening on HTTPS port $0.", portNumberHttps);
     }     }
       if (enableSSLExportClientVerification)
       {
         server_windows->addAcceptor(false, portNumberExportHttps, true, true);
         Logger::put(Logger::STANDARD_LOG, "CIMServer", Logger::INFORMATION,
                     "Listening on HTTPS port $0.", portNumberExportHttps);
       }
  
     server_windows->bind();     server_windows->bind();
  
Line 290 
Line 331 
       sprintf(displayname, "%s - %s", PEGASUS_DISPLAY_NAME, service_name);       sprintf(displayname, "%s - %s", PEGASUS_DISPLAY_NAME, service_name);
     }     }
  
   GetModuleFileName(NULL, filename, sizeof(filename));    if(0 != GetModuleFileName(NULL, filename, sizeof(filename)))
     {
   status = pegasus_service.Install(displayname, PEGASUS_DESCRIPTION, filename);   status = pegasus_service.Install(displayname, PEGASUS_DESCRIPTION, filename);
  
   // Upon success, set home in registry   // Upon success, set home in registry
Line 304 
Line 346 
       pegasus_homepath[strlen(pegasus_homepath)-1] = '\0';       pegasus_homepath[strlen(pegasus_homepath)-1] = '\0';
       _setRegInfo(g_cimservice_home, pegasus_homepath);       _setRegInfo(g_cimservice_home, pegasus_homepath);
     }     }
     }
     else
     {
       status = (Service::ReturnCode) GetLastError();
     }
  
   return (status == Service::SERVICE_RETURN_SUCCESS) ? true : false;   return (status == Service::SERVICE_RETURN_SUCCESS) ? true : false;
 } }
Line 444 
Line 491 
   // Determine the absolute path to the running program   // Determine the absolute path to the running program
   char exe_pathname[_MAX_PATH] = {0};   char exe_pathname[_MAX_PATH] = {0};
   char home_pathname[_MAX_PATH] = {0};   char home_pathname[_MAX_PATH] = {0};
   GetModuleFileName(NULL, exe_pathname, sizeof(exe_pathname));    if(0 != GetModuleFileName(NULL, exe_pathname, sizeof(exe_pathname)))
     {
  
   // Pegasus home search rules:   // Pegasus home search rules:
   // - look in registry (if set)   // - look in registry (if set)
Line 488 
Line 536 
         }         }
     }     }
 } }
   }
  


Legend:
Removed from v.1.6  
changed lines
  Added in v.1.14

No CVS admin address has been configured
Powered by
ViewCVS 0.9.2