00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031 #ifndef __CORE_LISTENER_H__
00032 #define __CORE_LISTENER_H__
00033
00034 #include "global.h"
00035
00036 namespace tacpp {
00037
00043 class Listener_data {
00046 pthread_mutex_t Mutex_;
00049 pthread_mutex_t mutex2_;
00052 int qDescrNum_;
00055 bool created_;
00058 string servname_;
00061 int maxconnect_;
00064 int acl_;
00067 unsigned int port_;
00070 int servertype_;
00073 pthread_mutex_t *lmutex_;
00074 public:
00077 void lock();
00080 void unlock();
00083 void lock2();
00086 void unlock2();
00089 void llock();
00092 void lunlock();
00095 bool isCreated();
00098 void setCreated(bool);
00101 void add_session();
00104 void del_session();
00107 int con_session();
00110 void setServname(string);
00113 string getServname();
00116 void setMaxconnect(int);
00119 int getMaxconnect();
00122 void setAcl(int);
00125 int getAcl();
00128 void (*UsersFunction)(int,struct in_addr,int,char*);
00131 void setPort(unsigned int);
00134 unsigned int getPort();
00137 void setServertype(int);
00140 int getServertype();
00143 Listener_data(unsigned int,int,int,void(*)(int,struct in_addr,int,char*),int,pthread_mutex_t*);
00146 void create();
00149 ~Listener_data();
00152 void destroy();
00153 };
00154
00160 class CoreListener : public Core_data {
00163 list<Listener_data*> srv_;
00166 pthread_mutex_t Mutex_;
00169 pthread_mutex_t LMutex_;
00172 void lock();
00175 void unlock();
00176 public:
00179 void init();
00182 CoreListener(const string,const string);
00185 ~CoreListener();
00188 void add(unsigned int);
00191 void add(unsigned int,int,const char*,int);
00194 void del(unsigned int);
00197 bool check(unsigned int,const char*);
00200 void modify1(unsigned int,const char*);
00203 void modify2(unsigned int,int);
00206 void modify3(unsigned int,int);
00209 string buildcfstr(int);
00212 string applycf(char * const*mask,const string cmdname,const list<string>paramList,Command * cmd=NULL)throw (CmdErr);
00213 };
00214
00215 };
00216
00217 #endif // __CORE_LISTENER_H__