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
00032
00033
00034
00035
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
00070
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
00149
00150
00151
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__