From 71bedf497cde8b0b38afbb366828b3df9c2803d6 Mon Sep 17 00:00:00 2001 From: brain Date: Mon, 19 Dec 2005 18:04:22 +0000 Subject: git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@2578 e03df62e-2008-0410-955e-edbf42e46eb7 --- docs/module-doc/modules_8h-source.html | 906 +++++++++++++++++---------------- 1 file changed, 462 insertions(+), 444 deletions(-) (limited to 'docs/module-doc/modules_8h-source.html') diff --git a/docs/module-doc/modules_8h-source.html b/docs/module-doc/modules_8h-source.html index a156711a2..554028446 100644 --- a/docs/module-doc/modules_8h-source.html +++ b/docs/module-doc/modules_8h-source.html @@ -63,475 +63,493 @@ 00062 #include <deque> 00063 #include <sstream> 00064 -00065 class Server; -00066 -00069 typedef std::deque<std::string> file_cache; -00070 typedef file_cache string_list; -00071 -00074 typedef std::deque<userrec*> chanuserlist; -00075 +00065 class Server; +00066 class ServerConfig; +00067 +00070 typedef std::deque<std::string> file_cache; +00071 typedef file_cache string_list; +00072 +00075 typedef std::deque<userrec*> chanuserlist; 00076 -00077 // This #define allows us to call a method in all -00078 // loaded modules in a readable simple way, e.g.: -00079 // 'FOREACH_MOD OnConnect(user);' -00080 -00081 #define FOREACH_MOD for (int _i = 0; _i <= MODCOUNT; _i++) modules[_i]-> -00082 -00083 // This define is similar to the one above but returns a result in MOD_RESULT. -00084 // The first module to return a nonzero result is the value to be accepted, -00085 // and any modules after are ignored. -00086 -00087 // ********************************************************************************************* -00088 -00089 #define FOREACH_RESULT(x) { MOD_RESULT = 0; \ -00090 for (int _i = 0; _i <= MODCOUNT; _i++) { \ -00091 int res = modules[_i]->x ; \ -00092 if (res != 0) { \ -00093 MOD_RESULT = res; \ -00094 break; \ -00095 } \ -00096 } \ -00097 } -00098 -00099 // ********************************************************************************************* -00100 -00101 #define FD_MAGIC_NUMBER -42 -00102 -00103 extern void createcommand(char* cmd, handlerfunc f, char flags, int minparams, char* source); -00104 extern void server_mode(char **parameters, int pcnt, userrec *user); +00077 +00078 // This #define allows us to call a method in all +00079 // loaded modules in a readable simple way, e.g.: +00080 // 'FOREACH_MOD OnConnect(user);' +00081 +00082 #define FOREACH_MOD for (int _i = 0; _i <= MODCOUNT; _i++) modules[_i]-> +00083 +00084 // This define is similar to the one above but returns a result in MOD_RESULT. +00085 // The first module to return a nonzero result is the value to be accepted, +00086 // and any modules after are ignored. +00087 +00088 // ********************************************************************************************* +00089 +00090 #define FOREACH_RESULT(x) { MOD_RESULT = 0; \ +00091 for (int _i = 0; _i <= MODCOUNT; _i++) { \ +00092 int res = modules[_i]->x ; \ +00093 if (res != 0) { \ +00094 MOD_RESULT = res; \ +00095 break; \ +00096 } \ +00097 } \ +00098 } +00099 +00100 // ********************************************************************************************* +00101 +00102 #define FD_MAGIC_NUMBER -42 +00103 +00104 // useful macros 00105 -00106 // class Version holds the version information of a Module, returned -00107 // by Module::GetVersion (thanks RD) -00108 -00113 class Version : public classbase -00114 { -00115 public: -00116 const int Major, Minor, Revision, Build, Flags; -00117 Version(int major, int minor, int revision, int build, int flags); -00118 }; -00119 -00125 class Admin : public classbase -00126 { -00127 public: -00128 const std::string Name, Email, Nick; -00129 Admin(std::string name, std::string email, std::string nick); -00130 }; -00131 -00132 -00133 // Forward-delacare module for ModuleMessage etc -00134 class Module; -00135 -00136 // Thanks to Rob (from anope) for the idea of this message passing API -00137 // (its been done before, but this seemed a very neat and tidy way... -00138 -00143 class ModuleMessage : public classbase +00106 #define IS_LOCAL(x) (x->fd > -1) +00107 #define IS_REMOTE(x) (x->fd < 0) +00108 #define IS_MODULE_CREATED(x) (x->fd == FD_MAGIC_NUMBER) +00109 +00110 // flags for use with WriteMode +00111 +00112 #define WM_AND 1 +00113 #define WM_OR 2 +00114 +00115 // flags for use with OnUserPreMessage and OnUserPreNotice +00116 +00117 #define TYPE_USER 1 +00118 #define TYPE_CHANNEL 2 +00119 #define TYPE_SERVER 3 +00120 +00121 /*extern void createcommand(char* cmd, handlerfunc f, char flags, int minparams, char* source); +00122 extern void server_mode(char **parameters, int pcnt, userrec *user);*/ +00123 +00124 // class Version holds the version information of a Module, returned +00125 // by Module::GetVersion (thanks RD) +00126 +00131 class Version : public classbase +00132 { +00133 public: +00134 const int Major, Minor, Revision, Build, Flags; +00135 Version(int major, int minor, int revision, int build, int flags); +00136 }; +00137 +00143 class Admin : public classbase 00144 { 00145 public: -00148 virtual char* Send() = 0; -00149 virtual ~ModuleMessage() {}; -00150 }; -00151 -00157 class Request : public ModuleMessage -00158 { -00159 protected: -00162 char* data; -00166 Module* source; -00169 Module* dest; -00170 public: -00173 Request(char* anydata, Module* src, Module* dst); -00176 char* GetData(); -00179 Module* GetSource(); -00182 Module* GetDest(); -00188 char* Send(); -00189 }; -00190 -00191 -00197 class Event : public ModuleMessage -00198 { -00199 protected: -00202 char* data; -00206 Module* source; -00211 std::string id; -00212 public: -00215 Event(char* anydata, Module* src, std::string eventid); -00218 char* GetData(); -00221 Module* GetSource(); -00225 std::string GetEventID(); -00230 char* Send(); -00231 }; -00232 -00236 class ExtMode : public classbase -00237 { -00238 public: -00239 char modechar; -00240 int type; -00241 bool needsoper; -00242 int params_when_on; -00243 int params_when_off; -00244 bool list; -00245 ExtMode(char mc, int ty, bool oper, int p_on, int p_off) : modechar(mc), type(ty), needsoper(oper), params_when_on(p_on), params_when_off(p_off) { }; -00246 }; -00247 -00248 -00254 class Module : public classbase +00146 const std::string Name, Email, Nick; +00147 Admin(std::string name, std::string email, std::string nick); +00148 }; +00149 +00150 +00151 // Forward-delacare module for ModuleMessage etc +00152 class Module; +00153 +00154 // Thanks to Rob (from anope) for the idea of this message passing API +00155 // (its been done before, but this seemed a very neat and tidy way... +00156 +00161 class ModuleMessage : public classbase +00162 { +00163 public: +00166 virtual char* Send() = 0; +00167 virtual ~ModuleMessage() {}; +00168 }; +00169 +00175 class Request : public ModuleMessage +00176 { +00177 protected: +00180 char* data; +00184 Module* source; +00187 Module* dest; +00188 public: +00191 Request(char* anydata, Module* src, Module* dst); +00194 char* GetData(); +00197 Module* GetSource(); +00200 Module* GetDest(); +00206 char* Send(); +00207 }; +00208 +00209 +00215 class Event : public ModuleMessage +00216 { +00217 protected: +00220 char* data; +00224 Module* source; +00229 std::string id; +00230 public: +00233 Event(char* anydata, Module* src, std::string eventid); +00236 char* GetData(); +00239 Module* GetSource(); +00243 std::string GetEventID(); +00248 char* Send(); +00249 }; +00250 +00254 class ExtMode : public classbase 00255 { 00256 public: -00257 -00262 Module(Server* Me); -00263 -00267 virtual ~Module(); -00268 -00273 virtual Version GetVersion(); -00274 -00279 virtual void OnUserConnect(userrec* user); -00280 -00288 virtual void OnUserQuit(userrec* user, std::string message); -00289 -00296 virtual void OnUserDisconnect(userrec* user); -00297 -00304 virtual void OnUserJoin(userrec* user, chanrec* channel); -00305 -00312 virtual void OnUserPart(userrec* user, chanrec* channel); -00313 -00321 virtual void OnRehash(std::string parameter); -00322 -00334 virtual void OnServerRaw(std::string &raw, bool inbound, userrec* user); -00335 -00351 virtual int OnExtendedMode(userrec* user, void* target, char modechar, int type, bool mode_on, string_list &params); -00352 -00369 virtual int OnUserPreJoin(userrec* user, chanrec* chan, const char* cname); +00257 char modechar; +00258 int type; +00259 bool needsoper; +00260 int params_when_on; +00261 int params_when_off; +00262 bool list; +00263 ExtMode(char mc, int ty, bool oper, int p_on, int p_off) : modechar(mc), type(ty), needsoper(oper), params_when_on(p_on), params_when_off(p_off) { }; +00264 }; +00265 +00266 +00272 class Module : public classbase +00273 { +00274 public: +00275 +00280 Module(Server* Me); +00281 +00285 virtual ~Module(); +00286 +00291 virtual Version GetVersion(); +00292 +00297 virtual void OnUserConnect(userrec* user); +00298 +00306 virtual void OnUserQuit(userrec* user, std::string message); +00307 +00314 virtual void OnUserDisconnect(userrec* user); +00315 +00322 virtual void OnUserJoin(userrec* user, chanrec* channel); +00323 +00330 virtual void OnUserPart(userrec* user, chanrec* channel); +00331 +00339 virtual void OnRehash(std::string parameter); +00340 +00352 virtual void OnServerRaw(std::string &raw, bool inbound, userrec* user); +00353 +00369 virtual int OnExtendedMode(userrec* user, void* target, char modechar, int type, bool mode_on, string_list &params); 00370 -00381 virtual int OnUserPreKick(userrec* source, userrec* user, chanrec* chan, std::string reason); -00382 -00391 virtual void OnUserKick(userrec* source, userrec* user, chanrec* chan, std::string reason); -00392 -00399 virtual void OnOper(userrec* user, std::string opertype); -00400 -00411 virtual void OnInfo(userrec* user); -00412 -00419 virtual void OnWhois(userrec* source, userrec* dest); -00420 -00430 virtual int OnUserPreInvite(userrec* source,userrec* dest,chanrec* channel); -00431 -00439 virtual void OnUserInvite(userrec* source,userrec* dest,chanrec* channel); -00440 -00454 virtual int OnUserPreMessage(userrec* user,void* dest,int target_type, std::string &text); -00455 -00472 virtual int OnUserPreNotice(userrec* user,void* dest,int target_type, std::string &text); -00473 -00484 virtual int OnUserPreNick(userrec* user, std::string newnick); -00485 -00494 virtual void OnUserMessage(userrec* user, void* dest, int target_type, std::string text); -00495 -00504 virtual void OnUserNotice(userrec* user, void* dest, int target_type, std::string text); -00505 -00515 virtual void OnMode(userrec* user, void* dest, int target_type, std::string text); -00516 -00525 virtual void OnGetServerDescription(std::string servername,std::string &description); -00526 -00539 virtual void OnSyncUser(userrec* user, Module* proto, void* opaque); -00540 -00556 virtual void OnSyncChannel(chanrec* chan, Module* proto, void* opaque); -00557 -00558 /* Allows modules to syncronize metadata related to channels over the network during a netburst. -00559 * Whenever the linking module wants to send out data, but doesnt know what the data -00560 * represents (e.g. it is Extensible metadata, added to a userrec or chanrec by a module) then -00561 * this method is called.You should use the ProtoSendMetaData function after you've -00562 * correctly decided how the data should be represented, to send the metadata on its way if it belongs -00563 * to your module. For a good example of how to use this method, see src/modules/m_swhois.cpp. -00564 * @param chan The channel whos metadata is being syncronized -00565 * @param proto A pointer to the module handling network protocol -00566 * @param opaque An opaque pointer set by the protocol module, should not be modified! -00567 * @param extname The extensions name which is being searched for -00568 */ -00569 virtual void OnSyncChannelMetaData(chanrec* chan, Module* proto,void* opaque, std::string extname); -00570 -00571 /* Allows modules to syncronize metadata related to users over the network during a netburst. -00572 * Whenever the linking module wants to send out data, but doesnt know what the data -00573 * represents (e.g. it is Extensible metadata, added to a userrec or chanrec by a module) then -00574 * this method is called. You should use the ProtoSendMetaData function after you've -00575 * correctly decided how the data should be represented, to send the metadata on its way if -00576 * if it belongs to your module. -00577 * @param user The user whos metadata is being syncronized -00578 * @param proto A pointer to the module handling network protocol -00579 * @param opaque An opaque pointer set by the protocol module, should not be modified! -00580 * @param extname The extensions name which is being searched for -00581 */ -00582 virtual void OnSyncUserMetaData(userrec* user, Module* proto,void* opaque, std::string extname); -00583 -00591 virtual void OnDecodeMetaData(int target_type, void* target, std::string extname, std::string extdata); -00592 -00606 virtual void ProtoSendMode(void* opaque, int target_type, void* target, std::string modeline); -00607 -00622 virtual void ProtoSendMetaData(void* opaque, int target_type, void* target, std::string extname, std::string extdata); -00623 -00628 virtual void OnWallops(userrec* user, std::string text); -00629 -00635 virtual void OnChangeHost(userrec* user, std::string newhost); -00636 -00642 virtual void OnChangeName(userrec* user, std::string gecos); -00643 -00651 virtual void OnAddGLine(long duration, userrec* source, std::string reason, std::string hostmask); -00652 -00660 virtual void OnAddZLine(long duration, userrec* source, std::string reason, std::string ipmask); +00387 virtual int OnUserPreJoin(userrec* user, chanrec* chan, const char* cname); +00388 +00399 virtual int OnUserPreKick(userrec* source, userrec* user, chanrec* chan, std::string reason); +00400 +00409 virtual void OnUserKick(userrec* source, userrec* user, chanrec* chan, std::string reason); +00410 +00417 virtual void OnOper(userrec* user, std::string opertype); +00418 +00429 virtual void OnInfo(userrec* user); +00430 +00437 virtual void OnWhois(userrec* source, userrec* dest); +00438 +00448 virtual int OnUserPreInvite(userrec* source,userrec* dest,chanrec* channel); +00449 +00457 virtual void OnUserInvite(userrec* source,userrec* dest,chanrec* channel); +00458 +00472 virtual int OnUserPreMessage(userrec* user,void* dest,int target_type, std::string &text); +00473 +00490 virtual int OnUserPreNotice(userrec* user,void* dest,int target_type, std::string &text); +00491 +00502 virtual int OnUserPreNick(userrec* user, std::string newnick); +00503 +00512 virtual void OnUserMessage(userrec* user, void* dest, int target_type, std::string text); +00513 +00522 virtual void OnUserNotice(userrec* user, void* dest, int target_type, std::string text); +00523 +00533 virtual void OnMode(userrec* user, void* dest, int target_type, std::string text); +00534 +00543 virtual void OnGetServerDescription(std::string servername,std::string &description); +00544 +00557 virtual void OnSyncUser(userrec* user, Module* proto, void* opaque); +00558 +00574 virtual void OnSyncChannel(chanrec* chan, Module* proto, void* opaque); +00575 +00576 /* Allows modules to syncronize metadata related to channels over the network during a netburst. +00577 * Whenever the linking module wants to send out data, but doesnt know what the data +00578 * represents (e.g. it is Extensible metadata, added to a userrec or chanrec by a module) then +00579 * this method is called.You should use the ProtoSendMetaData function after you've +00580 * correctly decided how the data should be represented, to send the metadata on its way if it belongs +00581 * to your module. For a good example of how to use this method, see src/modules/m_swhois.cpp. +00582 * @param chan The channel whos metadata is being syncronized +00583 * @param proto A pointer to the module handling network protocol +00584 * @param opaque An opaque pointer set by the protocol module, should not be modified! +00585 * @param extname The extensions name which is being searched for +00586 */ +00587 virtual void OnSyncChannelMetaData(chanrec* chan, Module* proto,void* opaque, std::string extname); +00588 +00589 /* Allows modules to syncronize metadata related to users over the network during a netburst. +00590 * Whenever the linking module wants to send out data, but doesnt know what the data +00591 * represents (e.g. it is Extensible metadata, added to a userrec or chanrec by a module) then +00592 * this method is called. You should use the ProtoSendMetaData function after you've +00593 * correctly decided how the data should be represented, to send the metadata on its way if +00594 * if it belongs to your module. +00595 * @param user The user whos metadata is being syncronized +00596 * @param proto A pointer to the module handling network protocol +00597 * @param opaque An opaque pointer set by the protocol module, should not be modified! +00598 * @param extname The extensions name which is being searched for +00599 */ +00600 virtual void OnSyncUserMetaData(userrec* user, Module* proto,void* opaque, std::string extname); +00601 +00609 virtual void OnDecodeMetaData(int target_type, void* target, std::string extname, std::string extdata); +00610 +00624 virtual void ProtoSendMode(void* opaque, int target_type, void* target, std::string modeline); +00625 +00640 virtual void ProtoSendMetaData(void* opaque, int target_type, void* target, std::string extname, std::string extdata); +00641 +00646 virtual void OnWallops(userrec* user, std::string text); +00647 +00653 virtual void OnChangeHost(userrec* user, std::string newhost); +00654 +00660 virtual void OnChangeName(userrec* user, std::string gecos); 00661 -00669 virtual void OnAddKLine(long duration, userrec* source, std::string reason, std::string hostmask); +00669 virtual void OnAddGLine(long duration, userrec* source, std::string reason, std::string hostmask); 00670 -00678 virtual void OnAddQLine(long duration, userrec* source, std::string reason, std::string nickmask); +00678 virtual void OnAddZLine(long duration, userrec* source, std::string reason, std::string ipmask); 00679 -00687 virtual void OnAddELine(long duration, userrec* source, std::string reason, std::string hostmask); +00687 virtual void OnAddKLine(long duration, userrec* source, std::string reason, std::string hostmask); 00688 -00694 virtual void OnDelGLine(userrec* source, std::string hostmask); -00695 -00701 virtual void OnDelZLine(userrec* source, std::string ipmask); -00702 -00708 virtual void OnDelKLine(userrec* source, std::string hostmask); -00709 -00715 virtual void OnDelQLine(userrec* source, std::string nickmask); -00716 -00722 virtual void OnDelELine(userrec* source, std::string hostmask); -00723 -00733 virtual void OnCleanup(int target_type, void* item); +00696 virtual void OnAddQLine(long duration, userrec* source, std::string reason, std::string nickmask); +00697 +00705 virtual void OnAddELine(long duration, userrec* source, std::string reason, std::string hostmask); +00706 +00712 virtual void OnDelGLine(userrec* source, std::string hostmask); +00713 +00719 virtual void OnDelZLine(userrec* source, std::string ipmask); +00720 +00726 virtual void OnDelKLine(userrec* source, std::string hostmask); +00727 +00733 virtual void OnDelQLine(userrec* source, std::string nickmask); 00734 -00744 virtual void OnUserPostNick(userrec* user, std::string oldnick); -00745 -00771 virtual int OnAccessCheck(userrec* source,userrec* dest,chanrec* channel,int access_type); -00772 -00777 virtual void On005Numeric(std::string &output); -00778 -00792 virtual int OnKill(userrec* source, userrec* dest, std::string reason); -00793 -00799 virtual void OnRemoteKill(userrec* source, userrec* dest, std::string reason); -00800 -00813 virtual void OnLoadModule(Module* mod,std::string name); -00814 -00827 virtual void OnUnloadModule(Module* mod,std::string name); -00828 -00835 virtual void OnBackgroundTimer(time_t curtime); -00836 -00847 virtual void OnSendList(userrec* user, chanrec* channel, char mode); -00848 -00864 virtual int OnPreCommand(std::string command, char **parameters, int pcnt, userrec *user); -00865 -00876 virtual bool OnCheckReady(userrec* user); -00877 -00886 virtual void OnUserRegister(userrec* user); -00887 -00900 virtual int OnRawMode(userrec* user, chanrec* chan, char mode, std::string param, bool adding, int pcnt); -00901 -00910 virtual int OnCheckInvite(userrec* user, chanrec* chan); -00911 -00921 virtual int OnCheckKey(userrec* user, chanrec* chan, std::string keygiven); -00922 -00931 virtual int OnCheckLimit(userrec* user, chanrec* chan); -00932 -00941 virtual int OnCheckBan(userrec* user, chanrec* chan); -00942 -00947 virtual void OnStats(char symbol); -00948 -00955 virtual int OnChangeLocalUserHost(userrec* user, std::string newhost); -00956 -00963 virtual int OnChangeLocalUserGECOS(userrec* user, std::string newhost); -00964 -00972 virtual int OnLocalTopicChange(userrec* user, chanrec* chan, std::string topic); -00973 -00980 virtual void OnPostLocalTopicChange(userrec* user, chanrec* chan, std::string topic); -00981 -00988 virtual void OnEvent(Event* event); -00989 -00997 virtual char* OnRequest(Request* request); -00998 -01008 virtual int OnOperCompare(std::string password, std::string input); -01009 -01016 virtual void OnGlobalOper(userrec* user); -01017 -01023 virtual void OnGlobalConnect(userrec* user); -01024 -01032 virtual int OnAddBan(userrec* source, chanrec* channel,std::string banmask); -01033 -01041 virtual int OnDelBan(userrec* source, chanrec* channel,std::string banmask); +00740 virtual void OnDelELine(userrec* source, std::string hostmask); +00741 +00751 virtual void OnCleanup(int target_type, void* item); +00752 +00762 virtual void OnUserPostNick(userrec* user, std::string oldnick); +00763 +00789 virtual int OnAccessCheck(userrec* source,userrec* dest,chanrec* channel,int access_type); +00790 +00795 virtual void On005Numeric(std::string &output); +00796 +00810 virtual int OnKill(userrec* source, userrec* dest, std::string reason); +00811 +00817 virtual void OnRemoteKill(userrec* source, userrec* dest, std::string reason); +00818 +00831 virtual void OnLoadModule(Module* mod,std::string name); +00832 +00845 virtual void OnUnloadModule(Module* mod,std::string name); +00846 +00853 virtual void OnBackgroundTimer(time_t curtime); +00854 +00865 virtual void OnSendList(userrec* user, chanrec* channel, char mode); +00866 +00882 virtual int OnPreCommand(std::string command, char **parameters, int pcnt, userrec *user); +00883 +00894 virtual bool OnCheckReady(userrec* user); +00895 +00904 virtual void OnUserRegister(userrec* user); +00905 +00918 virtual int OnRawMode(userrec* user, chanrec* chan, char mode, std::string param, bool adding, int pcnt); +00919 +00928 virtual int OnCheckInvite(userrec* user, chanrec* chan); +00929 +00939 virtual int OnCheckKey(userrec* user, chanrec* chan, std::string keygiven); +00940 +00949 virtual int OnCheckLimit(userrec* user, chanrec* chan); +00950 +00959 virtual int OnCheckBan(userrec* user, chanrec* chan); +00960 +00965 virtual void OnStats(char symbol); +00966 +00973 virtual int OnChangeLocalUserHost(userrec* user, std::string newhost); +00974 +00981 virtual int OnChangeLocalUserGECOS(userrec* user, std::string newhost); +00982 +00990 virtual int OnLocalTopicChange(userrec* user, chanrec* chan, std::string topic); +00991 +00998 virtual void OnPostLocalTopicChange(userrec* user, chanrec* chan, std::string topic); +00999 +01006 virtual void OnEvent(Event* event); +01007 +01015 virtual char* OnRequest(Request* request); +01016 +01026 virtual int OnOperCompare(std::string password, std::string input); +01027 +01034 virtual void OnGlobalOper(userrec* user); +01035 +01041 virtual void OnGlobalConnect(userrec* user); 01042 -01052 virtual void OnRawSocketAccept(int fd, std::string ip, int localport); -01053 -01064 virtual int OnRawSocketWrite(int fd, char* buffer, int count); -01065 -01070 virtual void OnRawSocketClose(int fd); +01050 virtual int OnAddBan(userrec* source, chanrec* channel,std::string banmask); +01051 +01059 virtual int OnDelBan(userrec* source, chanrec* channel,std::string banmask); +01060 +01070 virtual void OnRawSocketAccept(int fd, std::string ip, int localport); 01071 -01087 virtual int OnRawSocketRead(int fd, char* buffer, unsigned int count, int &readresult); -01088 }; +01082 virtual int OnRawSocketWrite(int fd, char* buffer, int count); +01083 +01088 virtual void OnRawSocketClose(int fd); 01089 -01090 -01096 class Server : public classbase -01097 { -01098 public: -01102 Server(); -01106 virtual ~Server(); -01111 ServerConfig* GetConfig(); -01115 virtual void SendOpers(std::string s); -01118 std::string GetVersion(); -01123 virtual void Log(int level, std::string s); -01128 virtual void Send(int Socket, std::string s); -01133 virtual void SendServ(int Socket, std::string s); -01137 virtual void SendChannelServerNotice(std::string ServName, chanrec* Channel, std::string text); -01142 virtual void SendFrom(int Socket, userrec* User, std::string s); -01157 virtual void SendTo(userrec* Source, userrec* Dest, std::string s); -01164 virtual void SendChannel(userrec* User, chanrec* Channel, std::string s,bool IncludeSender); -01169 virtual bool CommonChannels(userrec* u1, userrec* u2); -01177 virtual void SendCommon(userrec* User, std::string text,bool IncludeSender); -01182 virtual void SendWallops(userrec* User, std::string text); -01183 -01187 virtual bool IsNick(std::string nick); -01191 virtual int CountUsers(chanrec* c); -01195 virtual userrec* FindNick(std::string nick); -01199 virtual userrec* FindDescriptor(int socket); -01203 virtual chanrec* FindChannel(std::string channel); -01208 virtual std::string ChanMode(userrec* User, chanrec* Chan); -01212 virtual bool IsOnChannel(userrec* User, chanrec* Chan); -01215 virtual std::string GetServerName(); -01218 virtual std::string GetNetworkName(); -01221 virtual std::string GetServerDescription(); -01227 virtual Admin GetAdmin(); -01246 virtual bool AddExtendedMode(char modechar, int type, bool requires_oper, int params_when_on, int params_when_off); -01247 -01269 virtual bool AddExtendedListMode(char modechar); -01270 -01288 virtual void AddCommand(char* cmd, handlerfunc f, char flags, int minparams, char* source); -01289 -01311 virtual void SendMode(char **parameters, int pcnt, userrec *user); -01312 -01325 virtual void SendToModeMask(std::string modes, int flags, std::string text); -01326 -01332 virtual chanrec* JoinUserToChannel(userrec* user, std::string cname, std::string key); -01333 -01339 virtual chanrec* PartUserFromChannel(userrec* user, std::string cname, std::string reason); -01340 -01346 virtual void ChangeUserNick(userrec* user, std::string nickname); -01347 -01358 virtual void QuitUser(userrec* user, std::string reason); -01359 -01364 virtual bool MatchText(std::string sliteral, std::string spattern); +01105 virtual int OnRawSocketRead(int fd, char* buffer, unsigned int count, int &readresult); +01106 }; +01107 +01108 +01114 class Server : public classbase +01115 { +01116 public: +01120 Server(); +01124 virtual ~Server(); +01129 ServerConfig* GetConfig(); +01133 virtual void SendOpers(std::string s); +01136 std::string GetVersion(); +01141 virtual void Log(int level, std::string s); +01146 virtual void Send(int Socket, std::string s); +01151 virtual void SendServ(int Socket, std::string s); +01155 virtual void SendChannelServerNotice(std::string ServName, chanrec* Channel, std::string text); +01160 virtual void SendFrom(int Socket, userrec* User, std::string s); +01175 virtual void SendTo(userrec* Source, userrec* Dest, std::string s); +01182 virtual void SendChannel(userrec* User, chanrec* Channel, std::string s,bool IncludeSender); +01187 virtual bool CommonChannels(userrec* u1, userrec* u2); +01195 virtual void SendCommon(userrec* User, std::string text,bool IncludeSender); +01200 virtual void SendWallops(userrec* User, std::string text); +01201 +01205 virtual bool IsNick(std::string nick); +01209 virtual int CountUsers(chanrec* c); +01213 virtual userrec* FindNick(std::string nick); +01217 virtual userrec* FindDescriptor(int socket); +01221 virtual chanrec* FindChannel(std::string channel); +01226 virtual std::string ChanMode(userrec* User, chanrec* Chan); +01230 virtual bool IsOnChannel(userrec* User, chanrec* Chan); +01233 virtual std::string GetServerName(); +01236 virtual std::string GetNetworkName(); +01239 virtual std::string GetServerDescription(); +01245 virtual Admin GetAdmin(); +01264 virtual bool AddExtendedMode(char modechar, int type, bool requires_oper, int params_when_on, int params_when_off); +01265 +01287 virtual bool AddExtendedListMode(char modechar); +01288 +01306 virtual void AddCommand(command_t *f); +01307 +01329 virtual void SendMode(char **parameters, int pcnt, userrec *user); +01330 +01343 virtual void SendToModeMask(std::string modes, int flags, std::string text); +01344 +01350 virtual chanrec* JoinUserToChannel(userrec* user, std::string cname, std::string key); +01351 +01357 virtual chanrec* PartUserFromChannel(userrec* user, std::string cname, std::string reason); +01358 +01364 virtual void ChangeUserNick(userrec* user, std::string nickname); 01365 -01377 virtual void CallCommandHandler(std::string commandname, char** parameters, int pcnt, userrec* user); -01378 -01379 virtual bool IsValidModuleCommand(std::string commandname, int pcnt, userrec* user); -01380 -01386 virtual void ChangeHost(userrec* user, std::string host); -01387 -01393 virtual void ChangeGECOS(userrec* user, std::string gecos); -01394 -01403 virtual bool IsUlined(std::string server); -01404 -01408 virtual chanuserlist GetUsers(chanrec* chan); -01409 -01416 virtual bool UserToPseudo(userrec* user,std::string message); -01417 -01424 virtual bool PseudoToUser(userrec* alive,userrec* zombie,std::string message); -01425 -01433 virtual void AddGLine(long duration, std::string source, std::string reason, std::string hostmask); -01434 -01442 virtual void AddQLine(long duration, std::string source, std::string reason, std::string nickname); +01376 virtual void QuitUser(userrec* user, std::string reason); +01377 +01382 virtual bool MatchText(std::string sliteral, std::string spattern); +01383 +01395 virtual void CallCommandHandler(std::string commandname, char** parameters, int pcnt, userrec* user); +01396 +01397 virtual bool IsValidModuleCommand(std::string commandname, int pcnt, userrec* user); +01398 +01404 virtual void ChangeHost(userrec* user, std::string host); +01405 +01411 virtual void ChangeGECOS(userrec* user, std::string gecos); +01412 +01421 virtual bool IsUlined(std::string server); +01422 +01426 virtual chanuserlist GetUsers(chanrec* chan); +01427 +01434 virtual bool UserToPseudo(userrec* user,std::string message); +01435 +01442 virtual bool PseudoToUser(userrec* alive,userrec* zombie,std::string message); 01443 -01451 virtual void AddZLine(long duration, std::string source, std::string reason, std::string ipaddr); +01451 virtual void AddGLine(long duration, std::string source, std::string reason, std::string hostmask); 01452 -01460 virtual void AddKLine(long duration, std::string source, std::string reason, std::string hostmask); +01460 virtual void AddQLine(long duration, std::string source, std::string reason, std::string nickname); 01461 -01469 virtual void AddELine(long duration, std::string source, std::string reason, std::string hostmask); +01469 virtual void AddZLine(long duration, std::string source, std::string reason, std::string ipaddr); 01470 -01473 virtual bool DelGLine(std::string hostmask); -01474 -01477 virtual bool DelQLine(std::string nickname); -01478 -01481 virtual bool DelZLine(std::string ipaddr); -01482 -01485 virtual bool DelKLine(std::string hostmask); -01486 -01489 virtual bool DelELine(std::string hostmask); -01490 -01496 virtual long CalcDuration(std::string duration); -01497 -01500 virtual bool IsValidMask(std::string mask); -01501 -01506 virtual Module* FindModule(std::string name); -01507 -01510 virtual void AddSocket(InspSocket* sock); -01511 -01514 virtual void DelSocket(InspSocket* sock); +01478 virtual void AddKLine(long duration, std::string source, std::string reason, std::string hostmask); +01479 +01487 virtual void AddELine(long duration, std::string source, std::string reason, std::string hostmask); +01488 +01491 virtual bool DelGLine(std::string hostmask); +01492 +01495 virtual bool DelQLine(std::string nickname); +01496 +01499 virtual bool DelZLine(std::string ipaddr); +01500 +01503 virtual bool DelKLine(std::string hostmask); +01504 +01507 virtual bool DelELine(std::string hostmask); +01508 +01514 virtual long CalcDuration(std::string duration); 01515 -01516 virtual void RehashServer(); -01517 }; -01518 +01518 virtual bool IsValidMask(std::string mask); 01519 -01520 #define CONF_NOT_A_NUMBER 0x000010 -01521 #define CONF_NOT_UNSIGNED 0x000080 -01522 #define CONF_VALUE_NOT_FOUND 0x000100 -01523 #define CONF_FILE_NOT_FOUND 0x000200 -01524 +01524 virtual Module* FindModule(std::string name); 01525 -01532 class ConfigReader : public classbase -01533 { -01534 protected: -01540 std::stringstream *cache; -01541 std::stringstream *errorlog; -01544 bool readerror; -01545 long error; -01546 -01547 public: -01552 ConfigReader(); // default constructor reads ircd.conf -01556 ConfigReader(std::string filename); // read a module-specific config -01560 ~ConfigReader(); -01565 std::string ReadValue(std::string tag, std::string name, int index); -01571 bool ReadFlag(std::string tag, std::string name, int index); -01580 long ReadInteger(std::string tag, std::string name, int index, bool needs_unsigned); -01585 long GetError(); -01592 int Enumerate(std::string tag); -01597 bool Verify(); -01604 void DumpErrors(bool bail,userrec* user); -01605 -01611 int EnumerateValues(std::string tag, int index); -01612 }; -01613 -01614 -01615 -01621 class FileReader : public classbase -01622 { -01623 file_cache fc; -01624 public: -01629 FileReader(); -01630 -01636 FileReader(std::string filename); -01637 -01641 ~FileReader(); -01642 -01648 void LoadFile(std::string filename); -01649 -01653 bool Exists(); -01654 -01659 std::string GetLine(int x); +01528 virtual void AddSocket(InspSocket* sock); +01529 +01532 virtual void DelSocket(InspSocket* sock); +01533 +01534 virtual void RehashServer(); +01535 }; +01536 +01537 +01538 #define CONF_NOT_A_NUMBER 0x000010 +01539 #define CONF_NOT_UNSIGNED 0x000080 +01540 #define CONF_VALUE_NOT_FOUND 0x000100 +01541 #define CONF_FILE_NOT_FOUND 0x000200 +01542 +01543 +01550 class ConfigReader : public classbase +01551 { +01552 protected: +01558 std::stringstream *cache; +01559 std::stringstream *errorlog; +01562 bool readerror; +01563 long error; +01564 +01565 public: +01570 ConfigReader(); // default constructor reads ircd.conf +01574 ConfigReader(std::string filename); // read a module-specific config +01578 ~ConfigReader(); +01583 std::string ReadValue(std::string tag, std::string name, int index); +01589 bool ReadFlag(std::string tag, std::string name, int index); +01598 long ReadInteger(std::string tag, std::string name, int index, bool needs_unsigned); +01603 long GetError(); +01610 int Enumerate(std::string tag); +01615 bool Verify(); +01622 void DumpErrors(bool bail,userrec* user); +01623 +01629 int EnumerateValues(std::string tag, int index); +01630 }; +01631 +01632 +01633 +01639 class FileReader : public classbase +01640 { +01641 file_cache fc; +01642 public: +01647 FileReader(); +01648 +01654 FileReader(std::string filename); +01655 +01659 ~FileReader(); 01660 -01666 int FileSize(); -01667 }; -01668 -01669 -01676 class ModuleFactory : public classbase -01677 { -01678 public: -01679 ModuleFactory() { } -01680 virtual ~ModuleFactory() { } -01685 virtual Module * CreateModule(Server* Me) = 0; -01686 }; +01666 void LoadFile(std::string filename); +01667 +01671 bool Exists(); +01672 +01677 std::string GetLine(int x); +01678 +01684 int FileSize(); +01685 }; +01686 01687 -01688 -01689 typedef DLLFactory<ModuleFactory> ircd_module; -01690 -01691 bool ModeDefined(char c, int i); -01692 bool ModeDefinedOper(char c, int i); -01693 int ModeDefinedOn(char c, int i); -01694 int ModeDefinedOff(char c, int i); -01695 void ModeMakeList(char modechar); -01696 bool ModeIsListMode(char modechar, int type); -01697 -01698 #endif -
Generated on Thu Dec 15 11:14:14 2005 for InspIRCd by  +01694 class ModuleFactory : public classbase +01695 { +01696 public: +01697 ModuleFactory() { } +01698 virtual ~ModuleFactory() { } +01703 virtual Module * CreateModule(Server* Me) = 0; +01704 }; +01705 +01706 +01707 typedef DLLFactory<ModuleFactory> ircd_module; +01708 +01709 bool ModeDefined(char c, int i); +01710 bool ModeDefinedOper(char c, int i); +01711 int ModeDefinedOn(char c, int i); +01712 int ModeDefinedOff(char c, int i); +01713 void ModeMakeList(char modechar); +01714 bool ModeIsListMode(char modechar, int type); +01715 +01716 #endif +
Generated on Mon Dec 19 18:02:13 2005 for InspIRCd by  doxygen 1.4.4-20050815
-- cgit v1.2.3