Main Page | Class Hierarchy | Class List | File List | Class Members

CoreListener.h

00001 // tacppd core listener support
00002 // (c) Copyright 2000-2005 by tacppd team and contributors
00003 // see http://tacppd.org for more information
00004 
00005 //  This program is free software; you can redistribute it and/or modify
00006 //  it under the terms of the GNU General Public License as published by
00007 //  the Free Software Foundation; either version 2 of the License, or
00008 //  (at your option) any later version.
00009 //
00010 //  This program is distributed in the hope that it will be useful,
00011 //  but WITHOUT ANY WARRANTY; without even the implied warranty of
00012 //  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00013 //  GNU General Public License for more details.
00014 //
00015 //  You should have received a copy of the GNU General Public License
00016 //  along with this program; if not, write to the Free Software
00017 //  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00018 
00019 // all comments which start from /** - this is comments for KDoc
00020 //  for classes
00021 //    @short [short description of the class]
00022 //    @author [class author]
00023 //    @version [class version]
00024 //    @see [references to other classes or methods]
00025 //  for methods
00026 //    @see [references]
00027 //    @return [sentence describing the return value]
00028 //    @exception [list the exeptions that could be thrown]
00029 //    @param [name id] [description]    - can be multiple
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__

Generated on Thu Jul 21 23:09:45 2005 for tacppd.kdevelop by doxygen 1.3.5