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

modules.cpp File Reference

#include "inspircd_config.h"
#include "inspircd.h"
#include "inspircd_io.h"
#include "inspircd_util.h"
#include <unistd.h>
#include <sys/errno.h>
#include <time.h>
#include <string>
#include <hash_map>
#include <map>
#include <sstream>
#include <vector>
#include <deque>
#include "users.h"
#include "ctables.h"
#include "globals.h"
#include "modules.h"
#include "dynamic.h"
#include "wildcard.h"
#include "message.h"
#include "mode.h"
#include "xline.h"
#include "commands.h"
#include "inspstring.h"
#include "helperfuncs.h"
#include "hashcomp.h"
#include "socket.h"
#include "socketengine.h"

Include dependency graph for modules.cpp:

Go to the source code of this file.

Classes

class  ExtMode

Typedefs

typedef nspace::hash_map<
std::string, userrec *, nspace::hash<
string >, irc::StrHashComp
user_hash
typedef nspace::hash_map<
std::string, chanrec *, nspace::hash<
string >, irc::StrHashComp
chan_hash
typedef nspace::hash_map<
in_addr, string *, nspace::hash<
in_addr >, irc::InAddr_HashComp
address_cache
typedef nspace::hash_map<
std::string, WhoWasUser *,
nspace::hash< string >, irc::StrHashComp
whowas_hash
typedef std::deque< command_tcommand_table
typedef std::vector< ExtModeExtModeList
typedef ExtModeList::iterator ExtModeListIter

Functions

bool ModeDefined (char modechar, int type)
bool ModeIsListMode (char modechar, int type)
bool ModeDefinedOper (char modechar, int type)
int ModeDefinedOn (char modechar, int type)
int ModeDefinedOff (char modechar, int type)
bool DoAddExtendedMode (char modechar, int type, bool requires_oper, int params_on, int params_off)
void ModeMakeList (char modechar)
std::vector< Module * > modules (255)
std::vector< ircd_module * > factory (255)

Variables

SocketEngineSE
int MODCOUNT = -1
std::vector< Module * > modules
std::vector< ircd_module * > factory
std::vector< std::stringinclude_stack
std::vector< InspSocket * > module_sockets
time_t TIME
int LogLevel
char ServerName [MAXBUF]
char Network [MAXBUF]
char ServerDesc [MAXBUF]
char AdminName [MAXBUF]
char AdminEmail [MAXBUF]
char AdminNick [MAXBUF]
char diepass [MAXBUF]
char restartpass [MAXBUF]
char motd [MAXBUF]
char rules [MAXBUF]
char list [MAXBUF]
char PrefixQuit [MAXBUF]
char DieValue [MAXBUF]
int debugging
int WHOWAS_STALE
int WHOWAS_MAX
int DieDelay
time_t startup_time
int NetBufferSize
int MaxWhoResults
time_t nb_start
std::vector< std::stringmodule_names
int boundPortCount
int portCount
int ports [MAXSOCKS]
std::stringstream config_f
FILE * log_file
userrecfd_ref_table [65536]
user_hash clientlist
chan_hash chanlist
whowas_hash whowas
command_table cmdlist
file_cache MOTD
file_cache RULES
address_cache IP
ExtModeList EMode


Typedef Documentation

typedef nspace::hash_map<in_addr,string*, nspace::hash<in_addr>, irc::InAddr_HashComp> address_cache
 

Definition at line 117 of file modules.cpp.

typedef nspace::hash_map<std::string, chanrec*, nspace::hash<string>, irc::StrHashComp> chan_hash
 

Definition at line 116 of file modules.cpp.

typedef std::deque<command_t> command_table
 

Definition at line 119 of file modules.cpp.

typedef std::vector<ExtMode> ExtModeList
 

Definition at line 145 of file modules.cpp.

typedef ExtModeList::iterator ExtModeListIter
 

Definition at line 146 of file modules.cpp.

typedef nspace::hash_map<std::string, userrec*, nspace::hash<string>, irc::StrHashComp> user_hash
 

Definition at line 115 of file modules.cpp.

typedef nspace::hash_map<std::string, WhoWasUser*, nspace::hash<string>, irc::StrHashComp> whowas_hash
 

Definition at line 118 of file modules.cpp.


Function Documentation

bool DoAddExtendedMode char  modechar,
int  type,
bool  requires_oper,
int  params_on,
int  params_off
 

Definition at line 215 of file modules.cpp.

References EMode, and ModeDefined().

Referenced by Server::AddExtendedListMode(), and Server::AddExtendedMode().

00216 {
00217         if (ModeDefined(modechar,type)) {
00218                 return false;
00219         }
00220         EMode.push_back(ExtMode(modechar,type,requires_oper,params_on,params_off));
00221         return true;
00222 }

std::vector<ircd_module*> factory 255   ) 
 

bool ModeDefined char  modechar,
int  type
 

Definition at line 152 of file modules.cpp.

References EMode.

Referenced by DoAddExtendedMode().

00153 {
00154         for (ExtModeListIter i = EMode.begin(); i < EMode.end(); i++)
00155         {
00156                 if ((i->modechar == modechar) && (i->type == type))
00157                 {
00158                         return true;
00159                 }
00160         }
00161         return false;
00162 }

int ModeDefinedOff char  modechar,
int  type
 

Definition at line 202 of file modules.cpp.

References EMode.

00203 {
00204         for (ExtModeListIter i = EMode.begin(); i < EMode.end(); i++)
00205         {
00206                 if ((i->modechar == modechar) && (i->type == type))
00207                 {
00208                         return i->params_when_off;
00209                 }
00210         }
00211         return 0;
00212 }

int ModeDefinedOn char  modechar,
int  type
 

Definition at line 189 of file modules.cpp.

References EMode.

00190 {
00191         for (ExtModeListIter i = EMode.begin(); i < EMode.end(); i++)
00192         {
00193                 if ((i->modechar == modechar) && (i->type == type))
00194                 {
00195                         return i->params_when_on;
00196                 }
00197         }
00198         return 0;
00199 }

bool ModeDefinedOper char  modechar,
int  type
 

Definition at line 176 of file modules.cpp.

References EMode.

00177 {
00178         for (ExtModeListIter i = EMode.begin(); i < EMode.end(); i++)
00179         {
00180                 if ((i->modechar == modechar) && (i->type == type) && (i->needsoper == true))
00181                 {
00182                         return true;
00183                 }
00184         }
00185         return false;
00186 }

bool ModeIsListMode char  modechar,
int  type
 

Definition at line 164 of file modules.cpp.

References EMode.

00165 {
00166         for (ExtModeListIter i = EMode.begin(); i < EMode.end(); i++)
00167         {
00168                 if ((i->modechar == modechar) && (i->type == type) && (i->list == true))
00169                 {
00170                         return true;
00171                 }
00172         }
00173         return false;
00174 }

void ModeMakeList char  modechar  ) 
 

Definition at line 225 of file modules.cpp.

References EMode, and MT_CHANNEL.

Referenced by Server::AddExtendedListMode().

00226 {
00227         for (ExtModeListIter i = EMode.begin(); i < EMode.end(); i++)
00228         {
00229                 if ((i->modechar == modechar) && (i->type == MT_CHANNEL))
00230                 {
00231                         i->list = true;
00232                         return;
00233                 }
00234         }
00235         return;
00236 }

std::vector<Module*> modules 255   ) 
 


Variable Documentation

char AdminEmail[MAXBUF]
 

char AdminName[MAXBUF]
 

char AdminNick[MAXBUF]
 

int boundPortCount
 

chan_hash chanlist
 

user_hash clientlist
 

command_table cmdlist
 

std::stringstream config_f
 

int debugging
 

int DieDelay
 

char diepass[MAXBUF]
 

char DieValue[MAXBUF]
 

ExtModeList EMode
 

Definition at line 149 of file modules.cpp.

Referenced by DoAddExtendedMode(), ModeDefined(), ModeDefinedOff(), ModeDefinedOn(), ModeDefinedOper(), ModeIsListMode(), and ModeMakeList().

std::vector<ircd_module*> factory
 

userrec* fd_ref_table[65536]
 

std::vector<std::string> include_stack
 

Referenced by ConfigReader::ConfigReader().

address_cache IP
 

char list[MAXBUF]
 

FILE* log_file
 

int LogLevel
 

int MaxWhoResults
 

Definition at line 81 of file channels.cpp.

int MODCOUNT = -1
 

Definition at line 1005 of file modules.cpp.

std::vector<std::string> module_names
 

std::vector<InspSocket*> module_sockets
 

Referenced by Server::AddSocket(), and Server::DelSocket().

std::vector<Module*> modules
 

file_cache MOTD
 

char motd[MAXBUF]
 

time_t nb_start
 

int NetBufferSize
 

char Network[MAXBUF]
 

int portCount
 

int ports[MAXSOCKS]
 

char PrefixQuit[MAXBUF]
 

char restartpass[MAXBUF]
 

file_cache RULES
 

char rules[MAXBUF]
 

SocketEngine* SE
 

char ServerDesc[MAXBUF]
 

char ServerName[MAXBUF]
 

time_t startup_time
 

time_t TIME
 

whowas_hash whowas
 

int WHOWAS_MAX
 

int WHOWAS_STALE
 


Generated on Mon Dec 12 13:31:10 2005 for InspIRCd by  doxygen 1.4.4-20050815