OpenSDN source code
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
SslServer Class Referenceabstract

#include <ssl_server.h>

Inheritance diagram for SslServer:
Collaboration diagram for SslServer:

Public Types

typedef
boost::asio::ssl::stream
< boost::asio::ip::tcp::socket > 
SslSocket
 
- Public Types inherited from TcpServer
typedef
boost::asio::ip::tcp::endpoint 
Endpoint
 
typedef
boost::asio::ip::tcp::socket 
Socket
 
typedef
boost::asio::ip::tcp::socket::native_handle_type 
NativeSocketType
 

Public Member Functions

 SslServer (EventManager *evm, boost::asio::ssl::context::method m, bool ssl_enabled=true, bool ssl_handshake_delayed=false)
 
virtual ~SslServer ()
 
- Public Member Functions inherited from TcpServer
 TcpServer (EventManager *evm)
 
virtual ~TcpServer ()
 
virtual bool Initialize (unsigned short port)
 
virtual bool Initialize (unsigned short port, const IpAddress &host_ip, int intf_id=-1)
 
bool InitializeInternal (boost::asio::ip::tcp::endpoint localaddr)
 
const std::string ToString () const
 
void SetAcceptor ()
 
void ResetAcceptor ()
 
void Shutdown ()
 
void ClearSessions ()
 
void UpdateSessionsDscp (uint8_t dscp)
 
virtual TcpSessionCreateSession ()
 
virtual void DeleteSession (TcpSession *session)
 
virtual void Connect (TcpSession *session, Endpoint remote)
 
virtual bool DisableSandeshLogMessages () const
 
int GetPort () const
 
const io::SocketStatsGetSocketStats () const
 
size_t GetSessionCount () const
 
EventManagerevent_manager ()
 
bool HasSessionReadAvailable () const
 
bool HasSessions () const
 
TcpSessionGetSession (Endpoint remote)
 
void WaitForEmpty ()
 
void GetRxSocketStats (SocketIOStats *socket_stats) const
 
void GetTxSocketStats (SocketIOStats *socket_stats) const
 
void GetRxSocketStats (SocketIOStats &socket_stats) const
 
void GetTxSocketStats (SocketIOStats &socket_stats) const
 
int SetMd5SocketOption (NativeSocketType fd, uint32_t peer_ip, const std::string &md5_password)
 
int SetListenSocketMd5Option (uint32_t peer_ip, const std::string &md5_password)
 
int SetDscpSocketOption (NativeSocketType fd, uint8_t value)
 
uint8_t GetDscpValue (NativeSocketType fd) const
 
int SetListenSocketDscp (uint8_t value)
 
int SetSocketOptions (const SandeshConfig &sandesh_config)
 
int SetKeepAliveSocketOption (int fd, const SandeshConfig &sandesh_config)
 

Protected Member Functions

virtual SslSessionAllocSession (SslSocket *socket)=0
 
boost::asio::ssl::context * context ()
 
- Protected Member Functions inherited from TcpServer
virtual bool AcceptSession (TcpSession *session)
 
void set_socket_open_failure (bool flag)
 
bool socket_open_failure () const
 
Endpoint LocalEndpoint () const
 

Private Member Functions

TcpSessionAllocSession (Socket *socket)
 
TcpSessionAllocSession (bool server_session)
 
virtual void AcceptHandlerComplete (TcpSessionPtr session)
 
void ConnectHandlerComplete (TcpSessionPtr session)
 
Socketaccept_socket () const
 
void set_accept_socket ()
 
 DISALLOW_COPY_AND_ASSIGN (SslServer)
 

Static Private Member Functions

static void AcceptHandShakeHandler (TcpServerPtr server, TcpSessionPtr session, const boost::system::error_code &error)
 
static void ConnectHandShakeHandler (TcpServerPtr server, TcpSessionPtr session, const boost::system::error_code &error)
 

Private Attributes

boost::asio::ssl::context context_
 
std::unique_ptr< SslSocketso_ssl_accept_
 
bool ssl_enabled_
 
bool ssl_handshake_delayed_
 

Friends

class SslSession
 

Additional Inherited Members

- Protected Types inherited from TcpServer
typedef boost::intrusive_ptr
< TcpServer
TcpServerPtr
 
typedef boost::intrusive_ptr
< TcpSession
TcpSessionPtr
 

Detailed Description

Definition at line 14 of file ssl_server.h.

Member Typedef Documentation

typedef boost::asio::ssl::stream<boost::asio::ip::tcp::socket> SslServer::SslSocket

Definition at line 16 of file ssl_server.h.

Constructor & Destructor Documentation

SslServer::SslServer ( EventManager evm,
boost::asio::ssl::context::method  m,
bool  ssl_enabled = true,
bool  ssl_handshake_delayed = false 
)
explicit

Definition at line 15 of file ssl_server.cc.

SslServer::~SslServer ( )
virtual

Definition at line 38 of file ssl_server.cc.

Member Function Documentation

TcpServer::Socket * SslServer::accept_socket ( ) const
privatevirtual

Reimplemented from TcpServer.

Definition at line 139 of file ssl_server.cc.

void SslServer::AcceptHandlerComplete ( TcpSessionPtr  session)
privatevirtual

Reimplemented from TcpServer.

Definition at line 63 of file ssl_server.cc.

Here is the call graph for this function:

void SslServer::AcceptHandShakeHandler ( TcpServerPtr  server,
TcpSessionPtr  session,
const boost::system::error_code &  error 
)
staticprivate

Definition at line 79 of file ssl_server.cc.

Here is the call graph for this function:

virtual SslSession* SslServer::AllocSession ( SslSocket socket)
protectedpure virtual
TcpSession* SslServer::AllocSession ( Socket socket)
inlineprivatevirtual

Implements TcpServer.

Definition at line 42 of file ssl_server.h.

TcpSession * SslServer::AllocSession ( bool  server_session)
privatevirtual

Reimplemented from TcpServer.

Definition at line 45 of file ssl_server.cc.

Here is the call graph for this function:

void SslServer::ConnectHandlerComplete ( TcpSessionPtr  session)
privatevirtual

Reimplemented from TcpServer.

Definition at line 101 of file ssl_server.cc.

Here is the call graph for this function:

void SslServer::ConnectHandShakeHandler ( TcpServerPtr  server,
TcpSessionPtr  session,
const boost::system::error_code &  error 
)
staticprivate

Definition at line 117 of file ssl_server.cc.

Here is the call graph for this function:

boost::asio::ssl::context * SslServer::context ( )
protected

Definition at line 41 of file ssl_server.cc.

SslServer::DISALLOW_COPY_AND_ASSIGN ( SslServer  )
private
void SslServer::set_accept_socket ( )
privatevirtual

Reimplemented from TcpServer.

Definition at line 144 of file ssl_server.cc.

Here is the call graph for this function:

Friends And Related Function Documentation

friend class SslSession
friend

Definition at line 31 of file ssl_server.h.

Member Data Documentation

boost::asio::ssl::context SslServer::context_
private

Definition at line 55 of file ssl_server.h.

std::unique_ptr<SslSocket> SslServer::so_ssl_accept_
private

Definition at line 56 of file ssl_server.h.

bool SslServer::ssl_enabled_
private

Definition at line 57 of file ssl_server.h.

bool SslServer::ssl_handshake_delayed_
private

Definition at line 58 of file ssl_server.h.


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