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: LogTerm.h 00006 // description: logging to terminal 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 __LOGTERM_H__ 00038 #define __LOGTERM_H__ 00039 00040 #include "global.h" 00041 00042 namespace tacpp { 00043 00044 // identification of one logging terminal 00045 class LogTermAtom : public Packet { 00046 Logging *logging; 00047 public: 00050 int fh; 00053 list<int> fc; 00056 int output_id; 00059 LogTermAtom(Logging*,int); 00062 ~LogTermAtom(); 00065 void add_debug_fc(int); 00068 void del_debug_fc(int); 00071 void logwrite(); 00074 bool twrite(char*); 00075 }; 00076 00077 class LogTerm { 00078 list<LogTermAtom*> la; 00079 Logging *logging; 00080 pthread_mutex_t Mutex; 00081 void lock(); 00082 void unlock(); 00083 public: 00084 int output_id; 00085 LogTerm(Logging*); 00086 ~LogTerm(); 00087 void add(int); 00088 void del(int); 00091 void add_debug_fc(int,int); 00094 void del_debug_fc(int,int); 00097 void logwrite(); 00098 }; 00099 00100 }; 00101 00102 #endif //__LOGTERM_H__