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 #ifndef __global_H__
00026 #define __global_H__
00027
00028
00029
00030 #ifndef _PTHREADS
00031 #define _PTHREADS // enable STL pthread-safe code
00032 #endif //_PTHREADS
00033
00034
00035 #ifndef _REENTRANT
00036 #define _REENTRANT
00037 #endif //_REENTRANT
00038
00039
00040
00041
00042
00043
00044
00045
00046
00047
00048
00049
00050 #ifdef FREEBSD
00051 typedef int socken_t;
00052 #include <sys/param.h>
00053 #endif //FREEBSD
00054
00055 #define MAINDIR_LEN 200
00056
00057 #ifndef MAINDIR_DEF
00058 #define MAINDIR_DEF "."
00059 #endif //MAINDIR_DEF
00060
00061 #define DEF_CONFIG_FILE "etc/tacpp.conf"
00062 #define DEF_ERROR_FILE "log/debug.log"
00063
00064 #define PATH_TO_DB_MODULES "db"
00065 #define PATH_TO_TMP "tmp"
00066
00067 const int MAX_AVP = 100;
00068
00069 const int USERNAME_LEN = 32;
00070 const int AUTHTYPE_LEN = 5;
00071 const int PASSWORD_LEN = 50;
00072 const int PORT_LEN = 32;
00073 const int REM_ADDR_LEN = 32;
00074 const int DATA_LEN = 254;
00075 const int IP_LEN = 16;
00076 const int SERVICE_LEN = 15;
00077 const int PROTOCOL_LEN = 15;
00078 const int TIMECHECK_LEN = 50;
00079 const int MAX_FROM = 32;
00080 const int RESATTR_LEN = 32;
00081 const int RESVAL_LEN = 32;
00082 const int CRYPTOKEY_LEN = 32;
00083
00084
00085
00086 #include <cstdio>
00087 #include <locale.h>
00088 #include <pthread.h>
00089 #include <iostream>
00090
00091
00092 #include <string>
00093
00094 #include <fstream>
00095
00096
00097 #ifdef HAVE_SSTREAM
00098 #include <sstream>
00099 #else
00100 #include <strstream>
00101 #endif
00102
00103 #ifdef SOLARIS
00104 #include <strings.h>
00105 #include <netinet/in.h>
00106 #include <netinet/ip.h>
00107 #include <netinet/in_systm.h>
00108 #endif
00109
00110 #ifdef WITH_XMLRPC
00111 #include <XmlRpc.h>
00112 using namespace XmlRpc;
00113 #endif //WITH_XMLRPC
00114
00115 #include <vector>
00116 #include <stack>
00117 #include <list>
00118 #include <map>
00119
00120 namespace tacpp {};
00121 using namespace tacpp;
00122
00123 using std::list;
00124 using std::cerr;
00125 using std::cout;
00126 using std::endl;
00127 using std::string;
00128 using std::vector;
00129 using std::less;
00130 using std::map;
00131 using std::ifstream;
00132 using std::istringstream;
00133
00134 #include "ipaddr.h"
00135
00136 #include <sys/stat.h>
00137 #include <ctype.h>
00138 #include <fcntl.h>
00139 #include <signal.h>
00140 #include <sys/types.h>
00141 #include <sys/wait.h>
00142 #include <errno.h>
00143 #include <sys/time.h>
00144 #include <cstdarg>
00145 #include <netinet/in.h>
00146
00147 #ifdef FREEBSD
00148 #include <netinet/in_systm.h>
00149 #include <netinet/ip.h>
00150 #endif //FREEBSD
00151
00152 #include <netinet/ip_icmp.h>
00153 #include <netdb.h>
00154 #include <sys/socket.h>
00155 #include <arpa/inet.h>
00156 #include <dlfcn.h>
00157 #include <regex.h>
00158 #include <syslog.h>
00159
00160 #ifdef FREEBSD
00161 #include <sys/types.h>
00162 #include <netinet/in_systm.h>
00163 #include <netinet/in.h>
00164 #include <netinet/ip.h>
00165 #endif //FREEBSD
00166
00167
00168
00169
00170 #define MD5_LEN 16
00171 #include <openssl/md5.h>
00172
00173
00174 #ifdef WITH_CCARD
00175 #ifdef HAVE_DES_H
00176 #include <des.h>
00177 #else
00178 #include <unistd.h>
00179 #endif //HAVE_DES_H
00180 #endif //WITH_CCARD
00181
00182 #include <expat.h>
00183
00184 #include "Errors.h"
00185 #include "Utils.h"
00186 #include "Debug.h"
00187 #include "Packet.h"
00188 #include "ServerTrack.h"
00189 #include "Logging.h"
00190 #include "LogTerm.h"
00191 #include "Vty.h"
00192 #include "Command.h"
00193 #include "Terminal.h"
00194 #include "Cli.h"
00195 #include "LogFile.h"
00196 #include "LogSyslog.h"
00197 #include "DLoad.h"
00198 #include "db_module.h"
00199
00200 #include "NetFlow.h"
00201 #include "TacDb.h"
00202 #include "AAA.h"
00203 #include "Tacacs.h"
00204 #include "Tci.h"
00205 #include "App.h"
00206 #include "Listener.h"
00207 #include "CoreData.h"
00208 #include "CoreAccess.h"
00209 #include "CorePool.h"
00210 #include "CoreDb.h"
00211 #include "CoreDebug.h"
00212 #include "CoreManager.h"
00213 #include "CoreDevice.h"
00214 #include "CoreListener.h"
00215 #include "CorePeer.h"
00216 #include "CoreBundle.h"
00217 #include "CoreBilling.h"
00218 #include "Daemon.h"
00219 #include "Icmp.h"
00220 #include "Snmp.h"
00221 #include "Http.h"
00222 #include "XmlServer.h"
00223 #include "UserTrack.h"
00224 #include "AModify.h"
00225 #include "Tiep.h"
00226
00227 typedef char* char_ptr;
00228
00229 namespace tacpp {
00230 extern CoreData *coreData;
00231 extern char MAINDIR[MAINDIR_LEN];
00232 extern Logging logSystem;
00233 extern LogFile *logFileSystem;
00234 extern LogSyslog *logSyslogSystem;
00235 extern LogTerm *logTermSystem;
00236 extern Snmp snmpSystem;
00237 extern UserTrack userTrack;
00238
00239
00240 extern ServerTrack serverTrack;
00241 extern NfAggregator nfAggregator;
00242 };
00243
00244 #define TLOG ::logSystem.log
00245 #define TLOG2 ::logSystem
00246 #define endlog ::logSystem.Logging_end_endlog()
00247 #define setlog(a) ::logSystem.Logging_set_setlog(a)
00248 #define startlog(a) TLOG2<<setlog(a)
00249
00250 #endif //__global_H__