Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members

inspircd_io.h

Go to the documentation of this file.
00001 /*       +------------------------------------+
00002  *       | Inspire Internet Relay Chat Daemon |
00003  *       +------------------------------------+
00004  *
00005  *  Inspire is copyright (C) 2002-2005 ChatSpike-Dev.
00006  *                       E-mail:
00007  *                <brain@chatspike.net>
00008  *                <Craig@chatspike.net>
00009  *     
00010  * Written by Craig Edwards, Craig McLure, and others.
00011  * This program is free but copyrighted software; see
00012  *            the file COPYING for details.
00013  *
00014  * ---------------------------------------------------
00015  */
00016 
00017 #ifndef __INSPIRCD_IO_H__
00018 #define __INSPIRCD_IO_H__
00019 
00020 #include <sstream>
00021 #include <string>
00022 #include <vector>
00023 #include "inspircd.h"
00024 #include "globals.h"
00025 #include "modules.h"
00026 
00029 #define DEBUG 10
00030 #define VERBOSE 20
00031 #define DEFAULT 30
00032 #define SPARSE 40
00033 #define NONE 50
00034 
00040 class ServerConfig : public classbase
00041 {
00042   private:
00048         std::vector<std::string> include_stack;
00049 
00056         int fgets_safe(char* buffer, size_t maxsize, FILE* &file);
00057 
00062         std::string ConfProcess(char* buffer, long linenumber, std::stringstream* errorstream, bool &error, std::string filename);
00063 
00064   public:
00065 
00069         char ServerName[MAXBUF];
00070         
00071         /* Holds the network name the local server
00072          * belongs to. This is an arbitary field defined
00073          * by the administrator.
00074          */
00075         char Network[MAXBUF];
00076 
00080         char ServerDesc[MAXBUF];
00081 
00085         char AdminName[MAXBUF];
00086 
00090         char AdminEmail[MAXBUF];
00091 
00095         char AdminNick[MAXBUF];
00096 
00099         char diepass[MAXBUF];
00100 
00103         char restartpass[MAXBUF];
00104 
00108         char motd[MAXBUF];
00109 
00113         char rules[MAXBUF];
00114 
00117         char PrefixQuit[MAXBUF];
00118 
00122         char DieValue[MAXBUF];
00123 
00126         char DNSServer[MAXBUF];
00127 
00132         char DisabledCommands[MAXBUF];
00133 
00139         char ModPath[1024];
00140 
00144         char MyExecutable[1024];
00145 
00152         FILE *log_file;
00153 
00159         bool nofork;
00160 
00167         bool unlimitcore;
00168 
00172         bool AllowHalfop;
00173 
00177         int dns_timeout;
00178 
00183         int NetBufferSize;
00184 
00188         int MaxConn;
00189 
00194         unsigned int SoftLimit;
00195 
00199         int MaxWhoResults;
00200 
00203         int debugging;
00204 
00207         int LogLevel;
00208 
00212         int DieDelay;
00213 
00217         char addrs[MAXBUF][255];
00218 
00221         file_cache MOTD;
00222 
00225         file_cache RULES;
00226 
00230         char PID[1024];
00231 
00239         std::stringstream config_f;
00240 
00243         ClassVector Classes;
00244 
00248         std::vector<std::string> module_names;
00249 
00252         int ports[255];
00253 
00256         std::map<int,Module*> IOHookModule;
00257 
00258         ServerConfig();
00259 
00263         void ClearStack();
00264 
00269         void Read(bool bail, userrec* user);
00270 
00271         bool LoadConf(const char* filename, std::stringstream *target, std::stringstream* errorstream);
00272         int ConfValue(char* tag, char* var, int index, char *result, std::stringstream *config);
00273         int ReadConf(std::stringstream *config_f,const char* tag, const char* var, int index, char *result);
00274         int ConfValueEnum(char* tag,std::stringstream *config);
00275         int EnumConf(std::stringstream *config_f,const char* tag);
00276         int EnumValues(std::stringstream *config, const char* tag, int index);
00277         Module* GetIOHook(int port);
00278         bool AddIOHook(int port, Module* iomod);
00279         bool DelIOHook(int port);
00280 };
00281 
00282 
00283 void Exit (int); 
00284 void Start (void); 
00285 int DaemonSeed (void); 
00286 bool FileExists (const char* file);
00287 int OpenTCPSocket (void); 
00288 int BindSocket (int sockfd, struct sockaddr_in client, struct sockaddr_in server, int port, char* addr);
00289 void WritePID(std::string filename);
00290 int BindPorts();
00291 
00292 #endif

Generated on Mon Dec 19 18:05:20 2005 for InspIRCd by  doxygen 1.4.4-20050815