32 #include "XEventLog.h"
34 #include <sys/socket.h>
35 #include <arpa/inet.h>
37 #include <netinet/in.h>
50 extern "C" __declspec(dllexport)
sample_plugin *create_instance(
void);
62 sample_plugin::sample_plugin(
char *plugin_name,
int plugin_port) :
generic_plugin(plugin_name,plugin_port)
70 extern "C" __declspec(dllexport)
sample_plugin *create_instance(
void)
85 oss <<
" Thr.ID:" << thread_no <<
" Plugin:" << plugin_name <<
" Successfully initialized session.";
86 log(LOG_HI,oss.str());
89 catch(
const exception& er)
91 oss <<
" Thr.ID:" << thread_no <<
" Plugin:" << plugin_name <<
" " << er.what();
92 log(LOG_HI,oss.str());
102 generic_plugin::operator= (rhs);
103 db_name = rhs.db_name;
104 db_passwd = rhs.db_passwd;
118 oss <<
" Thr.ID:" << thread_id <<
" Plugin:" << plugin_name <<
" Successfully shutdown session.";
119 log(LOG_HI,oss.str());
121 catch(
const exception& er)
123 oss <<
" Thr.ID: MAIN Plugin:" << plugin_name <<
" " << er.what();
124 log(LOG_HI,oss.str());
137 oss <<
" Thr.ID: MAIN Plugin:" << plugin_name <<
" Successfully initialized sample server.";
138 log(LOG_HI,oss.str());
141 catch(
const exception& er)
143 oss <<
" Thr.ID: MAIN Plugin:" << plugin_name <<
" " << er.what();
144 log(LOG_HI,oss.str());
156 oss <<
" Thr.ID: MAIN Plugin:" << plugin_name <<
" Successfully shutdown sample server.";
157 log(LOG_HI,oss.str());
160 catch(
const exception& er)
162 oss <<
" Thr.ID: MAIN Plugin:" << plugin_name <<
" " << er.what();
163 log(LOG_HI,oss.str());
174 memset(out_buff,0,MAX_SZ);
175 oss <<
" Thr.ID:" << thread_id <<
" Plugin:" << plugin_name <<
" Received: " << string((
char *)buffer,size);
176 log(LOG_LOW,oss.str());
177 if(!memcmp(buffer,
"QUIT",4))
180 memcpy((
char *)out_buff,
"00 TERMINATE",size);
181 return(TERMINATE_SESSION);
184 memcpy((
char *)out_buff,
"response from plugin..",size);
185 return(CONTINUE_SESSION);
189 string sample_plugin::get_plugin_version(
void)
191 return(PLUGIN_VERSION);
198 if (line.size() > 8 && line.compare(0,8,
"DB_NAME=") == 0)
200 db_name = line.substr(8);
203 if (line.size() > 10 && line.compare(0,10,
"DB_PASSWD=") == 0)
205 db_passwd = line.substr(10);
214 return(
string(
"INIT_SMART_CARD"));
int process_request(void *, void *, unsigned int &)
Singleton class to manage framework state and provide utility functions. This class stores master Vec...
int get_plugin_params(string line)
This is a singleton class and provides framework functionality.
string bootstrap_name(void)
Derived from GENERIC_PLUGIN. Implements virtual functions and all plug-in specific functionality...
This component provides functionality that are common across plug-ins. Framework would instantiate an...
bool bootstrap_init(string)
bool bootstrap_terminate(string)
int shutdown_plugin(void)
int server_shutdown(void)
This is the base class for all plugins. All plug-ins should derive from this class. This class has a bunch of virtual functions that all plug-in could/should implement. In addition to virtual functions, this class also provides a lot of utility functions for all plug-ins.
This is a plug-in to demostrate usage of generic_server. This class is derived from GENERIC_PLUGIN...
unsigned long pinstance
Pointer to 'framework' object.
virtual int get_plugin_params(string line)