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

Terminal.h

00001 // This is part of tacppd project (extended tacacs++ daemon)
00002 // (c) Copyright in 2000-2004 by tacppd team and contributors
00003 // see http://tacppd.org for more information
00004 //
00005 // file: Terminal.h
00006 // description:
00007 
00008 //  This program is free software; you can redistribute it and/or modify
00009 //  it under the terms of the GNU General Public License as published by
00010 //  the Free Software Foundation; either version 2 of the License, or
00011 //  (at your option) any later version.
00012 //
00013 //  This program is distributed in the hope that it will be useful,
00014 //  but WITHOUT ANY WARRANTY; without even the implied warranty of
00015 //  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00016 //  GNU General Public License for more details.
00017 //
00018 //  You should have received a copy of the GNU General Public License
00019 //  along with this program; if not, write to the Free Software
00020 //  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00021 
00022 // modifications:
00023 //
00024 
00025 // all comments which start from /** - this is comments for KDoc */
00026 //  for classes
00027 //    @short [short description of the class]
00028 //    @author [class author]
00029 //    @version [class version]
00030 //    @see [references to other classes or methods]
00031 //  for methods
00032 //    @see [references]
00033 //    @return [sentence describing the return value]
00034 //    @exception [list the exeptions that could be thrown]
00035 //    @param [name id] [description]    - can be multiple
00036 
00037 #ifndef __TERMINAL_H__
00038 #define __TERMINAL_H__
00039 
00040 #include "global.h"
00041 
00042 namespace tacpp {
00043 
00044 #define TERMINAL_TIMEOUT        10000
00045 class Command;
00046 class Vty;
00047 class Cli;
00048 
00054 class Terminal : public commandFacility {
00055   typedef commandStatus (Terminal::*MethodPointer)(char *const* mask,const string,const list<string> ,Command * up);
00056 
00057  private:
00060   int handle;
00063   struct in_addr in_address;
00064 
00065  protected:
00068   map<string,MethodPointer,less<string> > pM;
00069 //  string configKeyWord;
00070 //  string configKeyValue;
00073   Cli *cl;
00074 
00075  public:
00078   char username[100];
00081   char address[100];
00084   VtyTerm *vt;
00087   Terminal(int,struct in_addr);
00090   ~Terminal();
00093   void process();
00096   void process(string in) throw(VtyErr,CmdErr);
00099   void process(const char *) throw(VtyErr,CmdErr);
00102   commandStatus makeAction(char *const* mask,const string cmdname,const list<string>paramList,Command * up)throw (CmdErr);
00105   bool auth();
00108   commandStatus cmdExit(char *const* mask,const string cmdname, const list< string > paramlist,Command * up);
00111   commandStatus cmdHelp(char *const* mask,const string cmdname,const list<string>paramList,Command * up);
00114   commandStatus cmdShowUsr(char *const* mask,const string cmdID, const list <string> paramlist,Command * up);
00117   commandStatus cmdShowNas(char *const* mask,const string cmdID, const list <string> paramlist,Command * up);
00120   commandStatus cmdClearUsr(char *const* mask,const string cmdID, const list <string> paramlist,Command * up);
00123   commandStatus cmdClearNas(char *const* mask,const string cmdID, const list <string> paramlist,Command * up);
00126   commandStatus cmdDbCreate(char *const* mask,const string cmdID, const list <string> paramlist,Command * up);
00129   commandStatus cmdDbAdd(char *const* mask,const string cmdID, const list <string> paramlist,Command * up);
00132   commandStatus cmdDbDel(char *const* mask,const string cmdID, const list <string> paramlist,Command * up);
00135   commandStatus cmdDbMod(char *const* mask,const string cmdID, const list <string> paramlist,Command * up);
00138   commandStatus cmdDbShow(char *const* mask,const string cmdID, const list <string> paramlist,Command * up);
00141   commandStatus cmdNoDebug(char *const* mask,const string cmdID, const list <string> paramlist,Command * up);
00144   commandStatus cmdDebug(char *const* mask,const string cmdID, const list <string> paramlist,Command * up);
00147   commandStatus cmdConfig(char *const* mask,const string cmdID, const list <string> paramlist,Command * up);
00148 //  commandStatus cmdConfigNo(char * const * mask,const string cmdID, const list <string> paramlist,Command * up);
00149 //  commandStatus cmdConfigOther(char * const * mask,const string cmdID, const list <string> paramlist,Command * up);
00150 //  commandStatus cmdConfigOtherNo(char * const * mask,const string cmdID, const list <string> paramlist,Command * up);
00151 //  commandStatus cmdConfigSection(char * const * mask,const string cmdID, const list <string> paramlist,Command * up);
00154   commandStatus cmdConfigAccess(char * const * mask,const string cmdID, const list<string> paramlist,Command * up);
00157   commandStatus cmdConfigBilling(char * const * mask,const string cmdID, const list<string> paramlist,Command * up);
00160   commandStatus cmdConfigBundle(char * const * mask,const string cmdID, const list<string> paramlist,Command * up);
00163   commandStatus cmdConfigDb(char * const * mask,const string cmdID, const list<string> paramlist,Command * up);
00166   commandStatus cmdConfigDebug(char * const * mask,const string cmdID, const list<string> paramlist,Command * up);
00169   commandStatus cmdConfigDevice(char * const * mask,const string cmdID, const list<string> paramlist,Command * up);
00172   commandStatus cmdConfigListner(char * const * mask,const string cmdID, const list<string> paramlist,Command * up);
00175   commandStatus cmdConfigManager(char * const * mask,const string cmdID, const list<string> paramlist,Command * up);
00178   commandStatus cmdConfigPeer(char * const * mask,const string cmdID, const list<string> paramlist,Command * up);
00181   commandStatus cmdConfigPool(char * const * mask,const string cmdID, const list<string> paramlist,Command * up);
00182 };
00183 
00184 };
00185 
00186 #endif //__TERMINAL_H__

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