33 #ifndef GENERIC_SERVER_H
34 #define GENERIC_SERVER_H
45 #include "XEventLog.h"
52 #define MAX_THREADS 100
56 #define PLUGIN_NUMBER 3
57 #define SHARED_LIB_PATH 4
63 #define THREAD_COMPLETED 2
64 #define THREAD_ALLOCATED 1
66 #define MIN_REQUEST_NO 0
67 #define MAX_REQUEST_NO 100
94 int log(
unsigned int,
unsigned int,
char *);
96 int log(
unsigned int,
unsigned int,
string );
97 int get_log_size(
void);
99 int rollover_logs(
void);
104 int swap_bytes(
unsigned char *key);
112 int bb_getline(
char *sav_buffer,
size_t length,
size_t conn_s);
113 int bb_getline(
char *sav_buffer,
size_t length,
size_t conn_s,
int);
114 int get_status(
unsigned char *buff);
115 string get_cur_time(
void);
116 string trim(
const std::string&);
117 int socket_close(SOCKET);
118 int close_thread_ids(
void);
125 SOCKET create_socket(
int);
126 bool get_verify_client(
void);
127 int set_verify_client(
bool);
128 int check_enabled_plugin(
string);
129 int check_allocated_port(
string in_plugin_id,
string in_plugin_port);
130 int set_conf_file(
char *cfile);
131 int set_process_name(
char *cfile);
132 int reload_conf_file(
void);
133 int get_command_port(
void);
135 int syslog_msg(
unsigned int debug_level,
unsigned int verbose_level,
string data);
136 string get_framework_version(
void) {
return(
"0_0_0_9");};
137 int print_key_message();
139 int rel_thread_id(
int);
145 bool check_plugin_aliases(vector<string> &alias);
146 int set_plugins_path(vector<string> &plugin_parms);
147 string get_plugins_path();
148 int setnonblocking(SOCKET);
149 int setblocking(SOCKET);
150 int get_thread_sync_mutex(
void);
151 int rel_thread_sync_mutex(
void);
152 int ssl_async_write(SSL *ssl,
char *buf,
int size);
153 int ssl_async_read(SSL *ssl,
char *buf,
int size);
154 int ssl_async_accept(SSL *ssl);
156 BOOL get_exe_directory(TCHAR *obuf,
size_t osize);
158 vector<string> split(
const string& s,
const string& delim,
const bool keep_empty);
167 int unload_shared_lib(
string plugin_type);
168 vector <GENERIC_PLUGIN *>::iterator get_start_iterator(
void);
169 vector <GENERIC_PLUGIN *>::iterator get_end_iterator(
void);
170 vector <GENERIC_PLUGIN *>::iterator itr;
172 vector <GENERIC_PLUGIN *>
v;
174 unsigned int timeout_seconds;
175 int max_threads,command_port;
179 map <string,HANDLE> dll_handles;
182 map <string,void *> dll_handles;
184 map <int,THREAD_INFO> thread_ids;
193 map <string,bool> bootstrap_jobs;
198 int get_log_file_mutex(
void);
199 int rel_log_file_mutex(
void);
200 int get_server_params(
string,
int);
204 int remove_plugins(map <string,int> &new_ports);
205 int remove_all_aliases();
215 int tls_initialize();
216 int set_access_control(
char daemon_flag);
217 unsigned int iResult,tls_setup_reqd;
218 string conf_file,process_name,plugins_path;
221 HANDLE log_file_mutex,thread_cnt_mutex,thread_sync_mutex;
223 pthread_mutex_t log_file_mutex,thread_cnt_mutex,thread_sync_mutex;
225 unsigned long max_log_size;
string server_cert
TLS certificate stuff.
static generic_server * pinstance
Pointer to singleton framework instance.
Utility class for TLS. Please refer excellent documentation at: http://www.openssl.org/docs/ssl/ssl.html.
This is a singleton class and provides framework functionality.
This component provides functionality that are common across plug-ins. Framework would instantiate an...
OS agnostic thread handle.
struct thread_info THREAD_INFO
OS agnostic thread handle.
vector< GENERIC_PLUGIN * > v
Vector to hold all plug-ins.
map< string, create_fp > factory
Map that has function pointers to 'create_instance()' factory method for all plug-in libraries...
Utility class for TLS. Please refer excellent documentation at: http://www.openssl.org/docs/ssl/ssl.html.