1 .TH "modules.cpp" 3 "2 May 2004" "InspIRCd" \" -*- nroff -*-
9 \fC#include 'inspircd.h'\fP
11 \fC#include 'inspircd_io.h'\fP
13 \fC#include 'inspircd_util.h'\fP
15 \fC#include 'inspircd_config.h'\fP
17 \fC#include <unistd.h>\fP
19 \fC#include <fcntl.h>\fP
21 \fC#include <sys/errno.h>\fP
23 \fC#include <sys/ioctl.h>\fP
25 \fC#include <sys/utsname.h>\fP
27 \fC#include <cstdio>\fP
29 \fC#include <time.h>\fP
31 \fC#include <string>\fP
33 \fC#include <hash_map>\fP
37 \fC#include <sstream>\fP
39 \fC#include <vector>\fP
41 \fC#include <errno.h>\fP
43 \fC#include <deque>\fP
45 \fC#include <sched.h>\fP
47 \fC#include 'connection.h'\fP
49 \fC#include 'users.h'\fP
51 \fC#include 'servers.h'\fP
53 \fC#include 'ctables.h'\fP
55 \fC#include 'globals.h'\fP
57 \fC#include 'modules.h'\fP
59 \fC#include 'dynamic.h'\fP
61 \fC#include 'wildcard.h'\fP
63 \fC#include 'message.h'\fP
65 \fC#include 'mode.h'\fP
67 \fC#include 'xline.h'\fP
69 \fC#include 'commands.h'\fP
76 .RI "namespace \fBnspace\fP"
83 .RI "class \fBExtMode\fP"
86 .RI "struct \fBInAddr_HashComp\fP"
89 .RI "struct \fBStrHashComp\fP"
96 .RI "#define \fBnspace\fP std"
103 .RI "typedef nspace::hash_map< std::string, \fBuserrec\fP *, nspace::hash< string >, \fBStrHashComp\fP > \fBuser_hash\fP"
106 .RI "typedef nspace::hash_map< std::string, \fBchanrec\fP *, nspace::hash< string >, \fBStrHashComp\fP > \fBchan_hash\fP"
109 .RI "typedef nspace::hash_map< in_addr, string *, nspace::hash< in_addr >, \fBInAddr_HashComp\fP > \fBaddress_cache\fP"
112 .RI "typedef std::deque< \fBcommand_t\fP > \fBcommand_table\fP"
115 .RI "typedef std::vector< \fBExtMode\fP > \fBExtModeList\fP"
118 .RI "typedef ExtModeList::iterator \fBExtModeListIter\fP"
125 .RI "bool \fBModeDefined\fP (char modechar, int type)"
128 .RI "bool \fBModeIsListMode\fP (char modechar, int type)"
131 .RI "bool \fBModeDefinedOper\fP (char modechar, int type)"
134 .RI "int \fBModeDefinedOn\fP (char modechar, int type)"
137 .RI "int \fBModeDefinedOff\fP (char modechar, int type)"
140 .RI "bool \fBDoAddExtendedMode\fP (char modechar, int type, bool requires_oper, int params_on, int params_off)"
143 .RI "void \fBModeMakeList\fP (char modechar)"
146 .RI "std::vector< \fBModule\fP * > \fBmodules\fP (255)"
149 .RI "std::vector< \fBircd_module\fP * > \fBfactory\fP (255)"
156 .RI "int \fBMODCOUNT\fP = -1"
159 .RI "vector< \fBModule\fP * > \fBmodules\fP"
162 .RI "vector< \fBircd_module\fP * > \fBfactory\fP"
165 .RI "int \fBLogLevel\fP"
168 .RI "char \fBServerName\fP [MAXBUF]"
171 .RI "char \fBNetwork\fP [MAXBUF]"
174 .RI "char \fBServerDesc\fP [MAXBUF]"
177 .RI "char \fBAdminName\fP [MAXBUF]"
180 .RI "char \fBAdminEmail\fP [MAXBUF]"
183 .RI "char \fBAdminNick\fP [MAXBUF]"
186 .RI "char \fBdiepass\fP [MAXBUF]"
189 .RI "char \fBrestartpass\fP [MAXBUF]"
192 .RI "char \fBmotd\fP [MAXBUF]"
195 .RI "char \fBrules\fP [MAXBUF]"
198 .RI "char \fBlist\fP [MAXBUF]"
201 .RI "char \fBPrefixQuit\fP [MAXBUF]"
204 .RI "char \fBDieValue\fP [MAXBUF]"
207 .RI "int \fBdebugging\fP"
210 .RI "int \fBWHOWAS_STALE\fP"
213 .RI "int \fBWHOWAS_MAX\fP"
216 .RI "int \fBDieDelay\fP"
219 .RI "time_t \fBstartup_time\fP"
222 .RI "int \fBNetBufferSize\fP"
225 .RI "int \fBMaxWhoResults\fP"
228 .RI "time_t \fBnb_start\fP"
231 .RI "std::vector< int > \fBfd_reap\fP"
234 .RI "std::vector< std::string > \fBmodule_names\fP"
237 .RI "char \fBbannerBuffer\fP [MAXBUF]"
240 .RI "int \fBboundPortCount\fP"
243 .RI "int \fBportCount\fP"
246 .RI "int \fBUDPportCount\fP"
249 .RI "int \fBports\fP [MAXSOCKS]"
252 .RI "int \fBdefaultRoute\fP"
255 .RI "std::vector< long > \fBauth_cookies\fP"
258 .RI "std::stringstream \fBconfig_f\fP"
261 .RI "\fBserverrec\fP * \fBme\fP [32]"
264 .RI "FILE * \fBlog_file\fP"
267 .RI "\fBuser_hash\fP \fBclientlist\fP"
270 .RI "\fBchan_hash\fP \fBchanlist\fP"
273 .RI "\fBuser_hash\fP \fBwhowas\fP"
276 .RI "\fBcommand_table\fP \fBcmdlist\fP"
279 .RI "\fBfile_cache\fP \fBMOTD\fP"
282 .RI "\fBfile_cache\fP \fBRULES\fP"
285 .RI "\fBaddress_cache\fP \fBIP\fP"
288 .RI "\fBExtModeList\fP \fBEMode\fP"
291 .SH "Define Documentation"
293 .SS "#define nspace std"
295 Definition at line 42 of file modules.cpp.
296 .SH "Typedef Documentation"
298 .SS "typedef nspace::hash_map<in_addr,string*, nspace::hash<in_addr>, \fBInAddr_HashComp\fP> address_cache"
300 Definition at line 151 of file modules.cpp.
301 .SS "typedef nspace::hash_map<std::string, \fBchanrec\fP*, nspace::hash<string>, \fBStrHashComp\fP> chan_hash"
303 Definition at line 150 of file modules.cpp.
304 .SS "typedef std::deque<\fBcommand_t\fP> command_table"
306 Definition at line 152 of file modules.cpp.
307 .SS "typedef std::vector<\fBExtMode\fP> ExtModeList"
309 Definition at line 178 of file modules.cpp.
310 .SS "typedef ExtModeList::iterator ExtModeListIter"
312 Definition at line 179 of file modules.cpp.
314 Referenced by ModeDefined(), ModeDefinedOff(), ModeDefinedOn(), ModeDefinedOper(), ModeIsListMode(), and ModeMakeList().
315 .SS "typedef nspace::hash_map<std::string, \fBuserrec\fP*, nspace::hash<string>, \fBStrHashComp\fP> user_hash"
317 Definition at line 149 of file modules.cpp.
318 .SH "Function Documentation"
320 .SS "bool DoAddExtendedMode (char modechar, int type, bool requires_oper, int params_on, int params_off)"
322 Definition at line 254 of file modules.cpp.
324 References EMode, and ModeDefined().
326 Referenced by Server::AddExtendedListMode(), and Server::AddExtendedMode().
330 256 if (ModeDefined(modechar,type)) {
333 259 EMode.push_back(ExtMode(modechar,type,requires_oper,params_on,params_off));
337 .SS "std::vector<\fBircd_module\fP*> factory (255)"
339 .SS "bool ModeDefined (char modechar, int type)"
341 Definition at line 185 of file modules.cpp.
343 References EMode, and ExtModeListIter.
345 Referenced by DoAddExtendedMode().
349 187 log(DEBUG,'Size of extmodes vector is %d',EMode.size());
350 188 for (ExtModeListIter i = EMode.begin(); i < EMode.end(); i++)
352 190 log(DEBUG,'i->modechar==%c, modechar=%c, i->type=%d, type=%d',i->modechar,modechar,i->type,type);
353 191 if ((i->modechar == modechar) && (i->type == type))
361 .SS "int ModeDefinedOff (char modechar, int type)"
363 Definition at line 241 of file modules.cpp.
365 References EMode, and ExtModeListIter.
369 243 for (ExtModeListIter i = EMode.begin(); i < EMode.end(); i++)
371 245 if ((i->modechar == modechar) && (i->type == type))
373 247 return i->params_when_off;
379 .SS "int ModeDefinedOn (char modechar, int type)"
381 Definition at line 228 of file modules.cpp.
383 References EMode, and ExtModeListIter.
387 230 for (ExtModeListIter i = EMode.begin(); i < EMode.end(); i++)
389 232 if ((i->modechar == modechar) && (i->type == type))
391 234 return i->params_when_on;
397 .SS "bool ModeDefinedOper (char modechar, int type)"
399 Definition at line 213 of file modules.cpp.
401 References EMode, and ExtModeListIter.
405 215 log(DEBUG,'Size of extmodes vector is %d',EMode.size());
406 216 for (ExtModeListIter i = EMode.begin(); i < EMode.end(); i++)
408 218 log(DEBUG,'i->modechar==%c, modechar=%c, i->type=%d, type=%d',i->modechar,modechar,i->type,type);
409 219 if ((i->modechar == modechar) && (i->type == type) && (i->needsoper == true))
417 .SS "bool ModeIsListMode (char modechar, int type)"
419 Definition at line 199 of file modules.cpp.
421 References EMode, and ExtModeListIter.
425 201 log(DEBUG,'Size of extmodes vector is %d',EMode.size());
426 202 for (ExtModeListIter i = EMode.begin(); i < EMode.end(); i++)
428 204 log(DEBUG,'i->modechar==%c, modechar=%c, i->type=%d, type=%d',i->modechar,modechar,i->type,type);
429 205 if ((i->modechar == modechar) && (i->type == type) && (i->list == true))
437 .SS "void ModeMakeList (char modechar)"
439 Definition at line 264 of file modules.cpp.
441 References EMode, ExtModeListIter, and MT_CHANNEL.
443 Referenced by Server::AddExtendedListMode().
447 266 for (ExtModeListIter i = EMode.begin(); i < EMode.end(); i++)
449 268 if ((i->modechar == modechar) && (i->type == MT_CHANNEL))
458 .SS "std::vector<\fBModule\fP*> modules (255)"
460 .SH "Variable Documentation"
462 .SS "char AdminEmail[MAXBUF]"
464 Definition at line 56 of file modules.cpp.
465 .SS "char AdminName[MAXBUF]"
467 Definition at line 55 of file modules.cpp.
468 .SS "char AdminNick[MAXBUF]"
470 Definition at line 57 of file modules.cpp.
471 .SS "std::vector<long> auth_cookies"
473 Definition at line 85 of file modules.cpp.
474 .SS "char bannerBuffer[MAXBUF]"
476 Definition at line 78 of file modules.cpp.
477 .SS "int boundPortCount"
479 Definition at line 79 of file modules.cpp.
480 .SS "\fBchan_hash\fP chanlist"
482 Definition at line 156 of file modules.cpp.
483 .SS "\fBuser_hash\fP clientlist"
485 Definition at line 155 of file modules.cpp.
487 Referenced by Server::GetUsers().
488 .SS "\fBcommand_table\fP cmdlist"
490 Definition at line 158 of file modules.cpp.
491 .SS "std::stringstream config_f"
493 Definition at line 86 of file modules.cpp.
496 Definition at line 66 of file modules.cpp.
497 .SS "int defaultRoute"
499 Definition at line 83 of file modules.cpp.
502 Definition at line 69 of file modules.cpp.
503 .SS "char diepass[MAXBUF]"
505 Definition at line 58 of file modules.cpp.
506 .SS "char DieValue[MAXBUF]"
508 Definition at line 64 of file modules.cpp.
509 .SS "\fBExtModeList\fP EMode"
511 Definition at line 182 of file modules.cpp.
513 Referenced by DoAddExtendedMode(), ModeDefined(), ModeDefinedOff(), ModeDefinedOn(), ModeDefinedOper(), ModeIsListMode(), and ModeMakeList().
514 .SS "vector<\fBircd_module\fP*> factory"
516 Definition at line 49 of file modules.cpp.
517 .SS "std::vector<int> fd_reap"
519 Definition at line 75 of file modules.cpp.
520 .SS "\fBaddress_cache\fP IP"
522 Definition at line 161 of file modules.cpp.
523 .SS "char list[MAXBUF]"
525 Definition at line 62 of file modules.cpp.
528 Definition at line 90 of file modules.cpp.
531 Definition at line 51 of file modules.cpp.
532 .SS "int MaxWhoResults"
534 Definition at line 72 of file modules.cpp.
535 .SS "\fBserverrec\fP* me[32]"
537 Definition at line 88 of file modules.cpp.
538 .SS "int MODCOUNT = -1"
540 Definition at line 714 of file modules.cpp.
541 .SS "std::vector<std::string> module_names"
543 Definition at line 76 of file modules.cpp.
544 .SS "vector<\fBModule\fP*> modules"
546 Definition at line 48 of file modules.cpp.
547 .SS "\fBfile_cache\fP MOTD"
549 Definition at line 159 of file modules.cpp.
550 .SS "char motd[MAXBUF]"
552 Definition at line 60 of file modules.cpp.
553 .SS "time_t nb_start"
555 Definition at line 73 of file modules.cpp.
556 .SS "int NetBufferSize"
558 Definition at line 71 of file modules.cpp.
559 .SS "char Network[MAXBUF]"
561 Definition at line 53 of file modules.cpp.
564 Definition at line 80 of file modules.cpp.
565 .SS "int ports[MAXSOCKS]"
567 Definition at line 82 of file modules.cpp.
568 .SS "char PrefixQuit[MAXBUF]"
570 Definition at line 63 of file modules.cpp.
571 .SS "char restartpass[MAXBUF]"
573 Definition at line 59 of file modules.cpp.
574 .SS "\fBfile_cache\fP RULES"
576 Definition at line 160 of file modules.cpp.
577 .SS "char rules[MAXBUF]"
579 Definition at line 61 of file modules.cpp.
580 .SS "char ServerDesc[MAXBUF]"
582 Definition at line 54 of file modules.cpp.
583 .SS "char ServerName[MAXBUF]"
585 Definition at line 52 of file modules.cpp.
586 .SS "time_t startup_time"
588 Definition at line 70 of file modules.cpp.
589 .SS "int UDPportCount"
591 Definition at line 81 of file modules.cpp.
592 .SS "\fBuser_hash\fP whowas"
594 Definition at line 157 of file modules.cpp.
597 Definition at line 68 of file modules.cpp.
598 .SS "int WHOWAS_STALE"
600 Definition at line 67 of file modules.cpp.
603 Generated automatically by Doxygen for InspIRCd from the source code.