Anope IRC Services  Version 2.0
Public Member Functions | Data Fields
SSLSocketIO Class Reference
Inheritance diagram for SSLSocketIO:
Inheritance graph
[legend]
Collaboration diagram for SSLSocketIO:
Collaboration graph
[legend]

Public Member Functions

 SSLSocketIO ()
 
int Recv (Socket *s, char *buf, size_t sz) anope_override
 
int Send (Socket *s, const char *buf, size_t sz) anope_override
 
ClientSocketAccept (ListenSocket *s) anope_override
 
SocketFlag FinishAccept (ClientSocket *cs) anope_override
 
void Connect (ConnectionSocket *s, const Anope::string &target, int port) anope_override
 
SocketFlag FinishConnect (ConnectionSocket *s) anope_override
 
void Destroy () anope_override
 
 SSLSocketIO ()
 
int Recv (Socket *s, char *buf, size_t sz) anope_override
 
int Send (Socket *s, const char *buf, size_t sz) anope_override
 
ClientSocketAccept (ListenSocket *s) anope_override
 
SocketFlag FinishAccept (ClientSocket *cs) anope_override
 
void Connect (ConnectionSocket *s, const Anope::string &target, int port) anope_override
 
SocketFlag FinishConnect (ConnectionSocket *s) anope_override
 
void Destroy () anope_override
 
- Public Member Functions inherited from SocketIO
virtual ~SocketIO ()
 
int Send (Socket *s, const Anope::string &buf)
 
virtual void Bind (Socket *s, const Anope::string &ip, int port=0)
 

Data Fields

gnutls_session_t sess
 
GnuTLS::X509CertCredentialsmycreds
 
SSL * sslsock
 

Detailed Description

Definition at line 35 of file m_ssl_gnutls.cpp.

Constructor & Destructor Documentation

SSLSocketIO::SSLSocketIO ( )

Constructor

Definition at line 632 of file m_ssl_gnutls.cpp.

References GnuTLS::X509CertCredentials::incrref().

SSLSocketIO::SSLSocketIO ( )

Constructor

Member Function Documentation

ClientSocket* SSLSocketIO::Accept ( ListenSocket s)
virtual

Accept a connection from a socket

Parameters
sThe socket
Returns
The new socket

Reimplemented from SocketIO.

ClientSocket * SSLSocketIO::Accept ( ListenSocket s)
virtual
void SSLSocketIO::Connect ( ConnectionSocket s,
const Anope::string target,
int  port 
)
virtual

Connect the socket

Parameters
sTHe socket
targetIP to connect to
portto connect to

Reimplemented from SocketIO.

void SSLSocketIO::Connect ( ConnectionSocket s,
const Anope::string target,
int  port 
)
virtual
void SSLSocketIO::Destroy ( )
virtual

Called when the socket is destructing

Reimplemented from SocketIO.

void SSLSocketIO::Destroy ( )
virtual

Called when the socket is destructing

Reimplemented from SocketIO.

Definition at line 619 of file m_ssl_gnutls.cpp.

References GnuTLS::X509CertCredentials::decrref().

SocketFlag SSLSocketIO::FinishAccept ( ClientSocket cs)
virtual

Finished accepting a connection from a socket

Parameters
sThe socket
Returns
SF_ACCEPTED if accepted, SF_ACCEPTING if still in process, SF_DEAD on error

Reimplemented from SocketIO.

SocketFlag SSLSocketIO::FinishAccept ( ClientSocket cs)
virtual

Finished accepting a connection from a socket

Parameters
sThe socket
Returns
SF_ACCEPTED if accepted, SF_ACCEPTING if still in process, SF_DEAD on error

Reimplemented from SocketIO.

Definition at line 481 of file m_ssl_gnutls.cpp.

References anope_dynamic_static_cast(), SocketEngine::Change(), Socket::flags, Socket::io, NormalSocketIO, ClientSocket::OnAccept(), ClientSocket::OnError(), sess, SF_ACCEPTED, SF_ACCEPTING, SF_DEAD, SF_READABLE, and SF_WRITABLE.

Referenced by Accept().

SocketFlag SSLSocketIO::FinishConnect ( ConnectionSocket s)
virtual

Called to potentially finish a pending connection

Parameters
sThe socket
Returns
SF_CONNECTED on success, SF_CONNECTING if still pending, and SF_DEAD on error.

Reimplemented from SocketIO.

SocketFlag SSLSocketIO::FinishConnect ( ConnectionSocket s)
virtual

Called to potentially finish a pending connection

Parameters
sThe socket
Returns
SF_CONNECTED on success, SF_CONNECTING if still pending, and SF_DEAD on error.

Reimplemented from SocketIO.

Definition at line 561 of file m_ssl_gnutls.cpp.

References anope_dynamic_static_cast(), SocketEngine::Change(), GnuTLSModule::cred, Socket::flags, Socket::GetFD(), Socket::io, NormalSocketIO, ConnectionSocket::OnConnect(), ConnectionSocket::OnError(), sess, GnuTLS::X509CertCredentials::SetupSession(), SF_CONNECTED, SF_CONNECTING, SF_DEAD, SF_READABLE, and SF_WRITABLE.

Referenced by Connect().

int SSLSocketIO::Recv ( Socket s,
char *  buf,
size_t  sz 
)
virtual

Really receive something from the buffer

Parameters
sThe socket
bufThe buf to read to
szHow much to read
Returns
Number of bytes received

Reimplemented from SocketIO.

int SSLSocketIO::Recv ( Socket s,
char *  buf,
size_t  sz 
)
virtual

Really receive something from the buffer

Parameters
sThe socket
bufThe buf to read to
szHow much to read
Returns
Number of bytes received

Reimplemented from SocketIO.

Definition at line 393 of file m_ssl_gnutls.cpp.

References SocketEngine::SetLastError(), TotalRead, and UplinkSock.

int SSLSocketIO::Send ( Socket s,
const char *  buf,
size_t  sz 
)
virtual

Write something to the socket

Parameters
sThe socket
bufThe data to write
sizeThe length of the data

Reimplemented from SocketIO.

int SSLSocketIO::Send ( Socket s,
const char *  buf,
size_t  sz 
)
virtual

Write something to the socket

Parameters
sThe socket
bufThe data to write
sizeThe length of the data

Reimplemented from SocketIO.

Definition at line 420 of file m_ssl_gnutls.cpp.

References SocketEngine::SetLastError(), TotalWritten, and UplinkSock.

Field Documentation

GnuTLS::X509CertCredentials* SSLSocketIO::mycreds

Definition at line 39 of file m_ssl_gnutls.cpp.

gnutls_session_t SSLSocketIO::sess

Definition at line 38 of file m_ssl_gnutls.cpp.

Referenced by Accept(), FinishAccept(), and FinishConnect().

SSL* SSLSocketIO::sslsock

Definition at line 31 of file m_ssl_openssl.cpp.


The documentation for this class was generated from the following files: