version 1.17, 2001/06/07 12:24:21
|
version 1.23, 2001/06/16 15:58:19
|
|
|
// Author: Mike Brasher (mbrasher@bmc.com) | // Author: Mike Brasher (mbrasher@bmc.com) |
// | // |
// Modified By: Mike Day (mdday@us.ibm.com) | // Modified By: Mike Day (mdday@us.ibm.com) |
======= |
// ======= |
// Modified By: Karl Schopmeyer (k.schopmeyer@opengroup.org) | // Modified By: Karl Schopmeyer (k.schopmeyer@opengroup.org) |
// | // |
//%///////////////////////////////////////////////////////////////////////////// | //%///////////////////////////////////////////////////////////////////////////// |
|
|
#include <Pegasus/Common/System.h> | #include <Pegasus/Common/System.h> |
| |
| |
|
|
#if defined(PEGASUS_OS_TYPE_WINDOWS) | #if defined(PEGASUS_OS_TYPE_WINDOWS) |
# include "cimserver_windows.cpp" | # include "cimserver_windows.cpp" |
#elif defined(PEGASUS_OS_TYPE_UNIX) | #elif defined(PEGASUS_OS_TYPE_UNIX) |
|
|
{ | { |
static struct OptionRow optionsTable[] = | static struct OptionRow optionsTable[] = |
{ | { |
{"port", "8888", false, Option::WHOLE_NUMBER, 0, 0, "port", |
{"port", "5988", false, Option::WHOLE_NUMBER, 0, 0, "port", |
"specifies port number to listen on" }, | "specifies port number to listen on" }, |
{"trace", "false", false, Option::BOOLEAN, 0, 0, "t", | {"trace", "false", false, Option::BOOLEAN, 0, 0, "t", |
"turns on trace of Client IO to console "}, | "turns on trace of Client IO to console "}, |
|
|
"Directory for log files"}, | "Directory for log files"}, |
{"cleanlogs", "false", false, Option::BOOLEAN, 0, 0, "clean", | {"cleanlogs", "false", false, Option::BOOLEAN, 0, 0, "clean", |
"Clears the log files at startup"}, | "Clears the log files at startup"}, |
{"daemon", "false", false, Option::BOOLEAN, 0, 0, "d", |
|
"Not Used "}, |
|
{"version", "false", false, Option::BOOLEAN, 0, 0, "v", | {"version", "false", false, Option::BOOLEAN, 0, 0, "v", |
"Displays Pegasus Version "}, | "Displays Pegasus Version "}, |
{"help", "false", false, Option::BOOLEAN, 0, 0, "h", | {"help", "false", false, Option::BOOLEAN, 0, 0, "h", |
|
|
{"remove", "false", false, Option::BOOLEAN, 0, 0, "remove", | {"remove", "false", false, Option::BOOLEAN, 0, 0, "remove", |
"Removes Pegasus as a Windows NT Service "}, | "Removes Pegasus as a Windows NT Service "}, |
{"debug", "false", false, Option::BOOLEAN, 0, 0, "d", | {"debug", "false", false, Option::BOOLEAN, 0, 0, "d", |
"Not Used "} |
"Not Used "}, |
|
{"slp", "true", false, Option::BOOLEAN, 0, 0, "slp", |
|
"Register Pegasus as a Service with SLP"} |
}; | }; |
const Uint32 NUM_OPTIONS = sizeof(optionsTable) / sizeof(optionsTable[0]); | const Uint32 NUM_OPTIONS = sizeof(optionsTable) / sizeof(optionsTable[0]); |
| |
om.registerOptions(optionsTable, NUM_OPTIONS); | om.registerOptions(optionsTable, NUM_OPTIONS); |
| |
String configFile = pegasusHome + "/cimserver.conf"; |
String configFile = pegasusHome + "/testclient.conf"; |
| |
cout << "Config file from " << configFile << endl; | cout << "Config file from " << configFile << endl; |
| |
|
|
////////////////////////////////////////////////////////////////////////// | ////////////////////////////////////////////////////////////////////////// |
int main(int argc, char** argv) | int main(int argc, char** argv) |
{ | { |
|
|
// on Windows NT if there are no command-line options, run as a service | // on Windows NT if there are no command-line options, run as a service |
|
|
if (argc == 1 ) | if (argc == 1 ) |
cim_server_service(argc, argv) ; | cim_server_service(argc, argv) ; |
| |
|
|
address, | address, |
(pegasusIOTrace ? " Tracing": " ")); | (pegasusIOTrace ? " Tracing": " ")); |
| |
|
Boolean useSLP = false;; |
|
|
|
if(om.valueEquals("slp", "true")) |
|
useSLP = true; |
|
|
// do we need to run as a daemon ? | // do we need to run as a daemon ? |
String daemonOption; | String daemonOption; |
if(om.lookupValue("daemon", daemonOption) && daemonOption == "true") | if(om.lookupValue("daemon", daemonOption) && daemonOption == "true") |
|
|
{ | { |
Selector selector; | Selector selector; |
CIMServer server(&selector, pegasusHome); | CIMServer server(&selector, pegasusHome); |
|
server.setSLP(useSLP); |
| |
// bind throws an exception of the bind fails | // bind throws an exception of the bind fails |
server.bind(address); | server.bind(address); |
|
|
| |
return 0; | return 0; |
} | } |
|
|