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

Debug.h

00001 // This is part of tacppd project (extended tacacs++ server)
00002 // (c) Copyright 2000-2004 by tacppd team and contributors
00003 // see http://tacppd.org for more information
00004 //
00005 // file: Debug.h
00006 // description: debugging
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 __DEBUG_H__
00038 #define __DEBUG_H__
00039 
00040 #include "global.h"
00041 
00042 namespace tacpp {
00043 
00044 // Debug Facilities 1-250
00045 #define LOG_TACACS    1     // tacacs+ protocol events
00046 #define LOG_BILLING   2     // billing subsytem
00047 #define LOG_AAA       3     // AAA
00048 #define LOG_DB        4     // database system activity
00049 #define LOG_SNMP      5     // snmp system activity
00050 #define LOG_NETFLOW   6     // netflow collector
00051 #define LOG_SERVER    7     // tcp/udp server
00052 #define LOG_CC        8     // cryptocard
00053 #define LOG_POOL      9     // address pool system
00054 #define LOG_TRACK     10    // user track system
00055 #define LOG_HTTP      11    // http interface
00056 #define LOG_TIP       12    // bundle protocol
00057 #define LOG_TEP       13    // external protocol
00058 
00064 class DebugFacility {
00067   pthread_mutex_t mutex_;
00070   void lock();
00073   void unlock();
00076   int num_;
00079   string name_;
00082   string description_;
00083  public:
00087   int getNum();
00091   string getName();
00095   string getDescription();
00098   DebugFacility(int,const string,const string);
00101   ~DebugFacility();
00102 };
00103 
00109 class Debug {
00112   pthread_mutex_t mutex_;
00115   void lock();
00118   void unlock();
00121   list<DebugFacility*> ddf_;
00122  public:
00125   Debug();
00128   ~Debug();
00132   string fname(int);
00136   string fdescr(int);
00140   int fnum(const char*);
00141 };
00142 
00143 };
00144 
00145 #endif // __DEBUG_H__

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