int main ( int  argc,
char **  argv 
)

the client executable parameters are: -i ipAddress -p portNumber -c callbackPeriod -n networkTimeout -o operation -a operationArgument

Definition at line 22 of file client.cpp.

00023 {
00024         const char* DEFAULT_CONFIG_FOLDER = ".keyvil";
00025         const char* DEFAULT_CONFIG_FILE = "client.conf";
00026         const char* DEFAULT_CONFIG_CONTENT[] = {
00027                         "#-------------------------------------",
00028                         "# config file for the keyvil client",
00029                         "#-------------------------------------",
00030                         "",
00031                         "ip = 127.0.0.1",
00032                         "portNumber = 1322",
00033                         "callbackPeriode = 30",
00034                         "networkTimeout = 5",
00035                         "operation = service",
00036                         "operationArgument = none",
00037                         0
00038         };
00039         
00040         string personalConfig = DefaultConf::createIfNonExistent(DEFAULT_CONFIG_FOLDER, DEFAULT_CONFIG_FILE, DEFAULT_CONFIG_CONTENT);
00041         
00042         const char* CONFIG_FILES[] = {
00043                         "/etc/client_keyvil.conf",
00044                         personalConfig.c_str(),
00045                         0
00046         };
00047         
00048         //cout << personalConfig.c_str() << endl;
00049         
00050         clientConf cc;
00051         
00052         if (cc.readConf(argc,argv,CONFIG_FILES)) {
00053                 cout << "usage: " << argv[0]
00054                 << " -i ipAddress -p portNumber -c callbackPeriod -n networkTimeout -o operation -a operationArgument"
00055                 << endl;
00056                 return -1;
00057         }
00058         try {
00059                 ClientMain cm(cc.getIp(), cc.getPortNumber(), cc.getCallbackPeriode(), cc.getNetworkTimeout());
00060                 return cm.run(cc.getOperation(), cc.getOperationArgument());
00061         }
00062         catch (const char* errstr) {
00063                 cout << DateFormater::getDate() << errstr << endl;
00064                 return -1;
00065         }
00066         return 0;
00067 }


Generated on Wed Jun 25 14:46:43 2008 for keyvil by  doxygen 1.5.1