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

modules.cpp File Reference

#include "inspircd.h"
#include "inspircd_io.h"
#include "inspircd_util.h"
#include "inspircd_config.h"
#include <unistd.h>
#include <fcntl.h>
#include <sys/errno.h>
#include <sys/ioctl.h>
#include <sys/utsname.h>
#include <cstdio>
#include <time.h>
#include <string>
#include <hash_map>
#include <map>
#include <sstream>
#include <vector>
#include <errno.h>
#include <deque>
#include <sched.h>
#include "connection.h"
#include "users.h"
#include "servers.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"

Go to the source code of this file.

Namespaces

namespace  nspace

Compounds

class  ExtMode
struct  InAddr_HashComp
struct  StrHashComp

Defines

#define nspace   std

Typedefs

typedef nspace::hash_map<
std::string, userrec *, nspace::hash<
string >, StrHashComp
user_hash
typedef nspace::hash_map<
std::string, chanrec *, nspace::hash<
string >, StrHashComp
chan_hash
typedef nspace::hash_map<
in_addr, string *, nspace::hash<
in_addr >, InAddr_HashComp
address_cache
typedef nspace::hash_map<
std::string, WhoWasUser *,
nspace::hash< string >, 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

int MODCOUNT = -1
std::vector< Module * > modules
std::vector< ircd_module * > factory
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< int > fd_reap
std::vector< std::string > module_names
int boundPortCount
int portCount
int SERVERportCount
int ports [MAXSOCKS]
int defaultRoute
std::vector< long > auth_cookies
std::stringstream config_f
serverrecme [32]
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


Define Documentation

#define nspace   std
 

Definition at line 64 of file modules.cpp.


Typedef Documentation

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

Definition at line 187 of file modules.cpp.

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

Definition at line 186 of file modules.cpp.

typedef std::deque<command_t> command_table
 

Definition at line 189 of file modules.cpp.

typedef std::vector<ExtMode> ExtModeList
 

Definition at line 215 of file modules.cpp.

typedef ExtModeList::iterator ExtModeListIter
 

Definition at line 216 of file modules.cpp.

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

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

Definition at line 185 of file modules.cpp.

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

Definition at line 188 of file modules.cpp.


Function Documentation

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

Definition at line 285 of file modules.cpp.

References EMode, and ModeDefined().

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

00286 {
00287         if (ModeDefined(modechar,type)) {
00288                 return false;
00289         }
00290         EMode.push_back(ExtMode(modechar,type,requires_oper,params_on,params_off));
00291         return true;
00292 }

std::vector<ircd_module*> factory 255   ) 
 

bool ModeDefined char  modechar,
int  type
 

Definition at line 222 of file modules.cpp.

References EMode, and ExtModeListIter.

Referenced by DoAddExtendedMode().

00223 {
00224         for (ExtModeListIter i = EMode.begin(); i < EMode.end(); i++)
00225         {
00226                 if ((i->modechar == modechar) && (i->type == type))
00227                 {
00228                         return true;
00229                 }
00230         }
00231         return false;
00232 }

int ModeDefinedOff char  modechar,
int  type
 

Definition at line 272 of file modules.cpp.

References EMode, and ExtModeListIter.

00273 {
00274         for (ExtModeListIter i = EMode.begin(); i < EMode.end(); i++)
00275         {
00276                 if ((i->modechar == modechar) && (i->type == type))
00277                 {
00278                         return i->params_when_off;
00279                 }
00280         }
00281         return 0;
00282 }

int ModeDefinedOn char  modechar,
int  type
 

Definition at line 259 of file modules.cpp.

References EMode, and ExtModeListIter.

00260 {
00261         for (ExtModeListIter i = EMode.begin(); i < EMode.end(); i++)
00262         {
00263                 if ((i->modechar == modechar) && (i->type == type))
00264                 {
00265                         return i->params_when_on;
00266                 }
00267         }
00268         return 0;
00269 }

bool ModeDefinedOper char  modechar,
int  type
 

Definition at line 246 of file modules.cpp.

References EMode, and ExtModeListIter.

00247 {
00248         for (ExtModeListIter i = EMode.begin(); i < EMode.end(); i++)
00249         {
00250                 if ((i->modechar == modechar) && (i->type == type) && (i->needsoper == true))
00251                 {
00252                         return true;
00253                 }
00254         }
00255         return false;
00256 }

bool ModeIsListMode char  modechar,
int  type
 

Definition at line 234 of file modules.cpp.

References EMode, and ExtModeListIter.

00235 {
00236         for (ExtModeListIter i = EMode.begin(); i < EMode.end(); i++)
00237         {
00238                 if ((i->modechar == modechar) && (i->type == type) && (i->list == true))
00239                 {
00240                         return true;
00241                 }
00242         }
00243         return false;
00244 }

void ModeMakeList char  modechar  ) 
 

Definition at line 295 of file modules.cpp.

References EMode, ExtModeListIter, and MT_CHANNEL.

Referenced by Server::AddExtendedListMode().

00296 {
00297         for (ExtModeListIter i = EMode.begin(); i < EMode.end(); i++)
00298         {
00299                 if ((i->modechar == modechar) && (i->type == MT_CHANNEL))
00300                 {
00301                         i->list = true;
00302                         return;
00303                 }
00304         }
00305         return;
00306 }

std::vector<Module*> modules 255   ) 
 


Variable Documentation

char AdminEmail[MAXBUF]
 

Definition at line 84 of file modules.cpp.

char AdminName[MAXBUF]
 

Definition at line 83 of file modules.cpp.

char AdminNick[MAXBUF]
 

Definition at line 85 of file modules.cpp.

std::vector<long> auth_cookies
 

Definition at line 112 of file modules.cpp.

int boundPortCount
 

Definition at line 106 of file modules.cpp.

chan_hash chanlist
 

Definition at line 193 of file modules.cpp.

user_hash clientlist
 

Definition at line 192 of file modules.cpp.

command_table cmdlist
 

Definition at line 195 of file modules.cpp.

std::stringstream config_f
 

Definition at line 113 of file modules.cpp.

int debugging
 

Definition at line 94 of file modules.cpp.

int defaultRoute
 

Definition at line 110 of file modules.cpp.

int DieDelay
 

Definition at line 97 of file modules.cpp.

char diepass[MAXBUF]
 

Definition at line 86 of file modules.cpp.

char DieValue[MAXBUF]
 

Definition at line 92 of file modules.cpp.

ExtModeList EMode
 

Definition at line 219 of file modules.cpp.

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

std::vector<ircd_module*> factory
 

Definition at line 75 of file modules.cpp.

std::vector<int> fd_reap
 

Definition at line 103 of file modules.cpp.

userrec* fd_ref_table[65536]
 

Definition at line 119 of file modules.cpp.

Referenced by Server::FindDescriptor(), and Server::PseudoToUser().

address_cache IP
 

Definition at line 198 of file modules.cpp.

char list[MAXBUF]
 

Definition at line 90 of file modules.cpp.

FILE* log_file
 

Definition at line 117 of file modules.cpp.

int LogLevel
 

Definition at line 79 of file modules.cpp.

int MaxWhoResults
 

Definition at line 100 of file modules.cpp.

serverrec* me[32]
 

Definition at line 115 of file modules.cpp.

int MODCOUNT = -1
 

Definition at line 1067 of file modules.cpp.

std::vector<std::string> module_names
 

Definition at line 104 of file modules.cpp.

std::vector<Module*> modules
 

Definition at line 74 of file modules.cpp.

file_cache MOTD
 

Definition at line 196 of file modules.cpp.

char motd[MAXBUF]
 

Definition at line 88 of file modules.cpp.

time_t nb_start
 

Definition at line 101 of file modules.cpp.

int NetBufferSize
 

Definition at line 99 of file modules.cpp.

char Network[MAXBUF]
 

Definition at line 81 of file modules.cpp.

int portCount
 

Definition at line 107 of file modules.cpp.

int ports[MAXSOCKS]
 

Definition at line 109 of file modules.cpp.

char PrefixQuit[MAXBUF]
 

Definition at line 91 of file modules.cpp.

char restartpass[MAXBUF]
 

Definition at line 87 of file modules.cpp.

file_cache RULES
 

Definition at line 197 of file modules.cpp.

char rules[MAXBUF]
 

Definition at line 89 of file modules.cpp.

char ServerDesc[MAXBUF]
 

Definition at line 82 of file modules.cpp.

char ServerName[MAXBUF]
 

Definition at line 80 of file modules.cpp.

int SERVERportCount
 

Definition at line 108 of file modules.cpp.

time_t startup_time
 

Definition at line 98 of file modules.cpp.

time_t TIME
 

Definition at line 77 of file modules.cpp.

whowas_hash whowas
 

Definition at line 194 of file modules.cpp.

int WHOWAS_MAX
 

Definition at line 96 of file modules.cpp.

int WHOWAS_STALE
 

Definition at line 95 of file modules.cpp.


Generated on Thu May 12 22:59:00 2005 for InspIRCd by doxygen 1.3.3