|
|||
|
|||
|


Public Member Functions | |
| ModuleXMLSocket (InspIRCd *Me) | |
| bool | isin (const std::string &host, int port, const std::vector< std::string > &portlist) |
| virtual void | OnRehash (User *user, const std::string ¶m) |
| Called on rehash. | |
| virtual | ~ModuleXMLSocket () |
| virtual void | OnUnloadModule (Module *mod, const std::string &name) |
| Called whenever a module is unloaded. | |
| virtual void | OnCleanup (int target_type, void *item) |
| Called before your module is unloaded to clean up Extensibles. | |
| virtual Version | GetVersion () |
| Returns the version number of a Module. | |
| virtual void | OnHookUserIO (User *user, const std::string &targetip) |
| virtual int | OnRawSocketRead (int fd, char *buffer, unsigned int count, int &readresult) |
| Called immediately before any read() operation on a client socket in the core. | |
| virtual int | OnRawSocketWrite (int fd, const char *buffer, int count) |
| Called immediately before any write() operation on a user's socket in the core. | |
Private Attributes | |
| ConfigReader * | Conf |
| std::vector< std::string > | listenports |
Definition at line 18 of file m_xmlsocket.cpp.
|
|
Definition at line 25 of file m_xmlsocket.cpp. References ModuleManager::Attach(), I_OnCleanup, I_OnHookUserIO, I_OnRawSocketRead, I_OnRawSocketWrite, I_OnRehash, I_OnUnloadModule, InspIRCd::Modules, OnRehash(), and Module::ServerInstance. |
|
|
Definition at line 83 of file m_xmlsocket.cpp. |
|
|
Returns the version number of a Module. The method should return a Version object with its version information assigned via Version::Version Reimplemented from Module. Definition at line 110 of file m_xmlsocket.cpp. References API_VERSION, and VF_VENDOR. |
|
||||||||||||||||
|
Definition at line 33 of file m_xmlsocket.cpp. References ConvToStr(). Referenced by OnHookUserIO(). |
|
||||||||||||
|
Called before your module is unloaded to clean up Extensibles. This method is called once for every user and channel on the network, so that when your module unloads it may clear up any remaining data in the form of Extensibles added using Extensible::Extend(). If the target_type variable is TYPE_USER, then void* item refers to a User*, otherwise it refers to a Channel*.
Reimplemented from Module. Definition at line 100 of file m_xmlsocket.cpp. References EventHandler::DelIOHook(), EventHandler::GetIOHook(), and TYPE_USER. |
|
||||||||||||
|
Reimplemented from Module. Definition at line 115 of file m_xmlsocket.cpp. References EventHandler::AddIOHook(), EventHandler::GetIOHook(), User::GetPort(), isin(), and listenports. |
|
||||||||||||||||||||
|
Called immediately before any read() operation on a client socket in the core. This occurs AFTER the select() or poll() so there is always data waiting to be read when this event occurs. Your event should return 1 if it has handled the reading itself, which prevents the core just using read(). You should place any data read into buffer, up to but NOT GREATER THAN the value of count. The value of readresult must be identical to an actual result that might be returned from the read() system call, for example, number of bytes read upon success, 0 upon EOF or closed socket, and -1 for error. If your function returns a nonzero value, you MUST set readresult.
Reimplemented from Module. Definition at line 124 of file m_xmlsocket.cpp. References InspIRCd::FindDescriptor, User::ReadData(), and Module::ServerInstance. |
|
||||||||||||||||
|
Called immediately before any write() operation on a user's socket in the core. Because this event is a low level event no user information is associated with it. It is intended for use by modules which may wrap connections within another API such as SSL for example. return a non-zero result if you have handled the write operation, in which case the core will not call write().
Reimplemented from Module. Definition at line 152 of file m_xmlsocket.cpp. References User::AddWriteBuf(), InspIRCd::FindDescriptor, and Module::ServerInstance. |
|
||||||||||||
|
Called on rehash. This method is called prior to a /REHASH or when a SIGHUP is received from the operating system. You should use it to reload any files so that your module keeps in step with the rest of the application. If a parameter is given, the core has done nothing. The module receiving the event can decide if this parameter has any relevence to it.
Reimplemented from Module. Definition at line 44 of file m_xmlsocket.cpp. References Conf, InspIRCd::Config, ConvToStr(), DEFAULT, CoreException::GetReason(), irc::portparser::GetToken(), listenports, LogManager::Log(), InspIRCd::Logs, ServerConfig::ports, ConfigReader::ReadFlag(), ConfigReader::ReadValue(), and Module::ServerInstance. Referenced by ModuleXMLSocket(). |
|
||||||||||||
|
Called whenever a module is unloaded. mod will contain a pointer to the module, and string will contain its name, for example m_widgets.so. This function is primary for dependency checking, your module may decide to enable some extra features if it sees that you have for example loaded "m_killwidgets.so" with "m_makewidgets.so". It is highly recommended that modules do *NOT* bail if they cannot satisfy dependencies, but instead operate under reduced functionality, unless the dependency is absolutely neccessary (e.g. a module that extends the features of another module).
Reimplemented from Module. Definition at line 87 of file m_xmlsocket.cpp. References InspIRCd::Config, ConvToStr(), listenports, ServerConfig::ports, and Module::ServerInstance. |
|
|
Definition at line 20 of file m_xmlsocket.cpp. Referenced by OnRehash(). |
|
|
Definition at line 21 of file m_xmlsocket.cpp. Referenced by OnHookUserIO(), OnRehash(), and OnUnloadModule(). |