|
|||
|
|||
|


Public Member Functions | |
| ModuleSSLGnuTLS (InspIRCd *Me) | |
| virtual void | OnRehash (User *user, const std::string ¶m) |
| Called on rehash. | |
| void | GenerateDHParams () |
| virtual | ~ModuleSSLGnuTLS () |
| virtual void | OnCleanup (int target_type, void *item) |
| Called before your module is unloaded to clean up Extensibles. | |
| virtual void | OnUnloadModule (Module *mod, const std::string &name) |
| Called whenever a module is unloaded. | |
| virtual Version | GetVersion () |
| Returns the version number of a Module. | |
| virtual void | On005Numeric (std::string &output) |
| Called when a 005 numeric is about to be output. | |
| virtual void | OnHookUserIO (User *user, const std::string &targetip) |
| virtual const char * | OnRequest (Request *request) |
| Called whenever a Request class is sent to your module by another module. | |
| virtual void | OnRawSocketAccept (int fd, const std::string &ip, int localport) |
| Called immediately after any connection is accepted. | |
| virtual void | OnRawSocketConnect (int fd) |
| Called immediately upon connection of an outbound BufferedSocket which has been hooked by a module. | |
| virtual void | OnRawSocketClose (int fd) |
| Called immediately before any socket is closed. | |
| 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. | |
| virtual void | OnWhois (User *source, User *dest) |
| Called whenever a /WHOIS is performed on a local user. | |
| virtual void | OnSyncUserMetaData (User *user, Module *proto, void *opaque, const std::string &extname, bool displayable) |
| virtual void | OnDecodeMetaData (int target_type, void *target, const std::string &extname, const std::string &extdata) |
| Allows module data, sent via ProtoSendMetaData, to be decoded again by a receiving module. | |
| bool | Handshake (issl_session *session) |
| virtual void | OnPostConnect (User *user) |
| Called after a user has fully connected and all modules have executed OnUserConnect This event is informational only. | |
| void | MakePollWrite (issl_session *session) |
| virtual void | OnBufferFlushed (User *user) |
| Called whenever a user's write buffer has been completely sent. | |
| void | CloseSession (issl_session *session) |
| void | VerifyCertificate (issl_session *session, Extensible *user) |
| void | OnEvent (Event *ev) |
| Called whenever an Event class is sent to all module by another module. | |
| void | Prioritize () |
Private Attributes | |
| ConfigReader * | Conf |
| char * | dummy |
| std::vector< std::string > | listenports |
| int | inbufsize |
| issl_session * | sessions |
| gnutls_certificate_credentials | x509_cred |
| gnutls_dh_params | dh_params |
| std::string | keyfile |
| std::string | certfile |
| std::string | cafile |
| std::string | crlfile |
| std::string | sslports |
| int | dh_bits |
| int | clientactive |
| bool | cred_alloc |
| CommandStartTLS * | starttls |
Definition at line 94 of file m_ssl_gnutls.cpp.
|
|
|
Definition at line 287 of file m_ssl_gnutls.cpp. References dh_params, InspIRCd::Modules, Module::ServerInstance, sessions, ModuleManager::UnpublishInterface(), and x509_cred. |
|
|
Definition at line 770 of file m_ssl_gnutls.cpp. References issl_session::inbuf, ISSL_NONE, issl_session::outbuf, issl_session::sess, and issl_session::status. Referenced by Handshake(), OnRawSocketClose(), OnRawSocketRead(), and OnRawSocketWrite(). |
|
|
Definition at line 274 of file m_ssl_gnutls.cpp. References DEFAULT, dh_bits, dh_params, LogManager::Log(), InspIRCd::Logs, and Module::ServerInstance. Referenced by OnRehash(). |
|
|
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 332 of file m_ssl_gnutls.cpp. References API_VERSION, and VF_VENDOR. |
|
|
Definition at line 680 of file m_ssl_gnutls.cpp. References CloseSession(), dummy, Extensible::Extend(), issl_session::fd, InspIRCd::FindDescriptor, Extensible::GetExt(), ISSL_CLOSING, ISSL_HANDSHAKEN, ISSL_HANDSHAKING_READ, ISSL_HANDSHAKING_WRITE, MakePollWrite(), Module::ServerInstance, issl_session::sess, and issl_session::status. Referenced by OnRawSocketAccept(), OnRawSocketConnect(), OnRawSocketRead(), and OnRawSocketWrite(). |
|
|
Definition at line 752 of file m_ssl_gnutls.cpp. References issl_session::fd, InspIRCd::FindDescriptor, InspIRCd::SE, Module::ServerInstance, and SocketEngine::WantWrite(). Referenced by Handshake(), OnRawSocketRead(), and OnRawSocketWrite(). |
|
|
Called when a 005 numeric is about to be output. The module should modify the 005 numeric if needed to indicate its features.
Reimplemented from Module. Definition at line 338 of file m_ssl_gnutls.cpp. References sslports. |
|
|
Called whenever a user's write buffer has been completely sent. This is called when the user's write buffer is completely empty, and there are no more pending bytes to be written and no pending write events in the socket engine's queue. This may be used to refill the buffer with data which is being spooled in a controlled manner, e.g. LIST lines.
Reimplemented from Module. Definition at line 760 of file m_ssl_gnutls.cpp. References Extensible::GetExt(), EventHandler::GetFd(), OnRawSocketWrite(), issl_session::outbuf, and sessions. |
|
||||||||||||
|
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 296 of file m_ssl_gnutls.cpp. References EventHandler::DelIOHook(), dummy, Extensible::GetExt(), EventHandler::GetIOHook(), UserManager::QuitUser(), Module::ServerInstance, Extensible::Shrink(), TYPE_USER, and InspIRCd::Users. |
|
||||||||||||||||||||
|
Allows module data, sent via ProtoSendMetaData, to be decoded again by a receiving module. Please see src/modules/m_swhois.cpp for a working example of how to use this method call.
Reimplemented from Module. Definition at line 666 of file m_ssl_gnutls.cpp. References dummy, Extensible::Extend(), Extensible::GetExt(), and TYPE_USER. |
|
|
Called whenever an Event class is sent to all module by another module. Please see the documentation of Event::Send() for further information. The Event sent can always be assumed to be non-NULL, you should *always* check the value of Event::GetEventID() before doing anything to the event data, and you should *not* change the event data in any way!
Reimplemented from Module. Definition at line 916 of file m_ssl_gnutls.cpp. References GenericCapHandler(). |
|
||||||||||||
|
Reimplemented from Module. Definition at line 343 of file m_ssl_gnutls.cpp. References EventHandler::AddIOHook(), EventHandler::GetIOHook(), User::GetPort(), isin(), and listenports. |
|
|
Called after a user has fully connected and all modules have executed OnUserConnect This event is informational only. You should not change any user information in this event. To do so, use the OnUserConnect method to change the state of local users. This is called for both local and remote users.
Reimplemented from Module. Definition at line 732 of file m_ssl_gnutls.cpp. References dummy, Extensible::GetExt(), IS_LOCAL, InspIRCd::PI, ProtocolInterface::SendMetaData(), Module::ServerInstance, sessions, TYPE_USER, and VerifyCertificate(). |
|
||||||||||||||||
|
Called immediately after any connection is accepted. This is intended for raw socket processing (e.g. modules which wrap the tcp connection within another library) and provides no information relating to a user record as the connection has not been assigned yet. There are no return values from this call as all modules get an opportunity if required to process the connection.
Reimplemented from Module. Definition at line 403 of file m_ssl_gnutls.cpp. References dh_bits, issl_session::fd, SocketEngine::GetMaxFds(), Handshake(), issl_session::inbuf, issl_session::inbufoffset, inbufsize, InspIRCd::SE, Module::ServerInstance, issl_session::sess, sessions, and x509_cred. |
|
|
Called immediately before any socket is closed. When this event is called, shutdown() has not yet been called on the socket.
Reimplemented from Module. Definition at line 462 of file m_ssl_gnutls.cpp. References CloseSession(), dummy, Extensible::GetExt(), SocketEngine::GetMaxFds(), SocketEngine::GetRef(), InspIRCd::SE, Module::ServerInstance, sessions, and Extensible::Shrink(). |
|
|
Called immediately upon connection of an outbound BufferedSocket which has been hooked by a module.
Reimplemented from Module. Definition at line 440 of file m_ssl_gnutls.cpp. References dh_bits, issl_session::fd, SocketEngine::GetMaxFds(), Handshake(), issl_session::inbuf, issl_session::inbufoffset, inbufsize, InspIRCd::SE, Module::ServerInstance, issl_session::sess, sessions, and x509_cred. |
|
||||||||||||||||||||
|
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 481 of file m_ssl_gnutls.cpp. References CloseSession(), SocketEngine::GetMaxFds(), Handshake(), issl_session::inbuf, issl_session::inbufoffset, inbufsize, ISSL_CLOSING, ISSL_HANDSHAKEN, ISSL_HANDSHAKING_READ, ISSL_HANDSHAKING_WRITE, MakePollWrite(), InspIRCd::SE, Module::ServerInstance, issl_session::sess, sessions, and issl_session::status. |
|
||||||||||||||||
|
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 576 of file m_ssl_gnutls.cpp. References CloseSession(), SocketEngine::GetMaxFds(), Handshake(), ISSL_HANDSHAKEN, ISSL_HANDSHAKING_WRITE, MakePollWrite(), issl_session::outbuf, InspIRCd::SE, Module::ServerInstance, issl_session::sess, sessions, and issl_session::status. Referenced by OnBufferFlushed(). |
|
||||||||||||
|
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 149 of file m_ssl_gnutls.cpp. References cafile, certfile, clientactive, Conf, InspIRCd::Config, InspIRCd::ConfigFileName, ConvToStr(), cred_alloc, crlfile, DEFAULT, dh_bits, dh_params, ConfigReader::Enumerate(), GenerateDHParams(), CoreException::GetReason(), irc::portparser::GetToken(), keyfile, listenports, LogManager::Log(), InspIRCd::Logs, ServerConfig::ports, ConfigReader::ReadInteger(), ConfigReader::ReadValue(), Module::ServerInstance, sslports, ServerConfig::StartsWithWindowsDriveLetter(), and x509_cred. Referenced by ModuleSSLGnuTLS(). |
|
|
Called whenever a Request class is sent to your module by another module. Please see the documentation of Request::Send() for further information. The Request sent can always be assumed to be non-NULL, you should not change the request object or its data. Your method may return arbitary data in the char* result which the requesting module may be able to use for pre-determined purposes (e.g. the results of an SQL query, etc).
Reimplemented from Module. Definition at line 352 of file m_ssl_gnutls.cpp. References EventHandler::AddIOHook(), EventHandler::DelIOHook(), InspIRCd::FindDescriptor, EventHandler::GetFd(), Request::GetId(), ISSL_HANDSHAKING_READ, ISSL_HANDSHAKING_WRITE, Module::ServerInstance, issl_session::sess, sessions, ISHRequest::Sock, issl_session::status, and VerifyCertificate(). |
|
||||||||||||||||||||||||
|
Reimplemented from Module. Definition at line 651 of file m_ssl_gnutls.cpp. References dummy, Extensible::GetExt(), Module::ProtoSendMetaData(), and TYPE_USER. |
|
||||||||||||
|
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 319 of file m_ssl_gnutls.cpp. References InspIRCd::Config, ConvToStr(), listenports, ServerConfig::ports, and Module::ServerInstance. |
|
||||||||||||
|
Called whenever a /WHOIS is performed on a local user. The source parameter contains the details of the user who issued the WHOIS command, and the dest parameter contains the information of the user they are whoising.
Reimplemented from Module. Definition at line 639 of file m_ssl_gnutls.cpp. References clientactive, dummy, Extensible::GetExt(), IS_LOCAL, User::nick, InspIRCd::SendWhoisLine(), and Module::ServerInstance. |
|
|
Reimplemented from Module. Definition at line 921 of file m_ssl_gnutls.cpp. References ModuleManager::Find(), I_OnPostConnect, InspIRCd::Modules, PRIO_AFTER, Module::ServerInstance, and ModuleManager::SetPriority(). |
|
||||||||||||
|
Definition at line 789 of file m_ssl_gnutls.cpp. References ConvToStr(), ssl_cert::data, Extensible::Extend(), irc::hex(), MAXBUF, Module::ServerInstance, issl_session::sess, and InspIRCd::Time(). Referenced by OnPostConnect(), and OnRequest(). |
|
|
Definition at line 111 of file m_ssl_gnutls.cpp. Referenced by OnRehash(). |
|
|
Definition at line 110 of file m_ssl_gnutls.cpp. Referenced by OnRehash(). |
|
|
Definition at line 116 of file m_ssl_gnutls.cpp. Referenced by OnRehash(), and OnWhois(). |
|
|
Definition at line 97 of file m_ssl_gnutls.cpp. Referenced by OnRehash(). |
|
|
Definition at line 117 of file m_ssl_gnutls.cpp. Referenced by ModuleSSLGnuTLS(), and OnRehash(). |
|
|
Definition at line 112 of file m_ssl_gnutls.cpp. Referenced by OnRehash(). |
|
|
Definition at line 114 of file m_ssl_gnutls.cpp. Referenced by GenerateDHParams(), OnRawSocketAccept(), OnRawSocketConnect(), and OnRehash(). |
|
|
Definition at line 107 of file m_ssl_gnutls.cpp. Referenced by GenerateDHParams(), ModuleSSLGnuTLS(), OnRehash(), and ~ModuleSSLGnuTLS(). |
|
|
Definition at line 99 of file m_ssl_gnutls.cpp. Referenced by Handshake(), OnCleanup(), OnDecodeMetaData(), OnPostConnect(), OnRawSocketClose(), OnSyncUserMetaData(), and OnWhois(). |
|
|
Definition at line 103 of file m_ssl_gnutls.cpp. Referenced by ModuleSSLGnuTLS(), OnRawSocketAccept(), OnRawSocketConnect(), and OnRawSocketRead(). |
|
|
Definition at line 109 of file m_ssl_gnutls.cpp. Referenced by OnRehash(). |
|
|
Definition at line 101 of file m_ssl_gnutls.cpp. Referenced by OnHookUserIO(), OnRehash(), and OnUnloadModule(). |
|
|
Definition at line 104 of file m_ssl_gnutls.cpp. Referenced by ModuleSSLGnuTLS(), OnBufferFlushed(), OnPostConnect(), OnRawSocketAccept(), OnRawSocketClose(), OnRawSocketConnect(), OnRawSocketRead(), OnRawSocketWrite(), OnRequest(), and ~ModuleSSLGnuTLS(). |
|
|
Definition at line 113 of file m_ssl_gnutls.cpp. Referenced by On005Numeric(), and OnRehash(). |
|
|
Definition at line 119 of file m_ssl_gnutls.cpp. Referenced by ModuleSSLGnuTLS(). |
|
|
Definition at line 106 of file m_ssl_gnutls.cpp. Referenced by ModuleSSLGnuTLS(), OnRawSocketAccept(), OnRawSocketConnect(), OnRehash(), and ~ModuleSSLGnuTLS(). |