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

#include <sandesh_server.h>

Inheritance diagram for SandeshServer:
Collaboration diagram for SandeshServer:

Classes

class  DeleteActor
 

Public Member Functions

 SandeshServer (EventManager *evm, const SandeshConfig &config)
 
virtual ~SandeshServer ()
 
virtual bool Initialize (short port, const std::string &ip="0.0.0.0")
 
virtual TcpSessionCreateSession ()
 
void Initiate ()
 
void Shutdown ()
 
virtual void SessionShutdown ()
 
LifetimeManagerlifetime_manager ()
 
LifetimeActordeleter ()
 
int lifetime_mgr_task_id ()
 
SandeshConnectionFindConnection (const Endpoint &peer_addr)
 
void RemoveConnection (SandeshConnection *connection)
 
virtual bool DisableSandeshLogMessages () const
 
virtual bool ReceiveResourceUpdate (SandeshSession *session, bool rsc)
 
virtual bool ReceiveSandeshMsg (SandeshSession *session, const SandeshMessage *msg, bool resource)=0
 
virtual bool ReceiveSandeshCtrlMsg (SandeshStateMachine *state_machine, SandeshSession *session, const Sandesh *sandesh)
 
virtual void DisconnectSession (SandeshSession *session)
 
size_t ConnectionsCount ()
 
int AllocConnectionIndex ()
 
void FreeConnectionIndex (int)
 
- Public Member Functions inherited from SslServer
 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 void DeleteSession (TcpSession *session)
 
virtual void Connect (TcpSession *session, Endpoint remote)
 
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)
 
virtual bool AcceptSession (TcpSession *session)
 
int session_writer_task_id () const
 
int session_reader_task_id () const
 
- Protected Member Functions inherited from SslServer
boost::asio::ssl::context * context ()
 
- Protected Member Functions inherited from TcpServer
void set_socket_open_failure (bool flag)
 
bool socket_open_failure () const
 
Endpoint LocalEndpoint () const
 

Private Types

typedef boost::ptr_map
< boost::asio::ip::tcp::endpoint,
SandeshConnection
SandeshConnectionMap
 
typedef
boost::ptr_container_detail::ref_pair
< boost::asio::ip::basic_endpoint
< boost::asio::ip::tcp >
, SandeshConnection *const > 
SandeshConnectionPair
 

Private Member Functions

bool Compare (const Endpoint &peer_addr, const SandeshConnectionPair &) const
 
 DISALLOW_COPY_AND_ASSIGN (SandeshServer)
 

Private Attributes

SandeshConnectionMap connection_
 
boost::dynamic_bitset conn_bmap_
 
int sm_task_id_
 
int session_reader_task_id_
 
int lifetime_mgr_task_id_
 
boost::scoped_ptr
< LifetimeManager
lifetime_manager_
 
boost::scoped_ptr< DeleteActordeleter_
 
tbb::mutex mutex_
 

Static Private Attributes

static const int kMaxInitRetries = 5
 
static const std::string kSessionReaderTask = "io::ReaderTask"
 
static const std::string kStateMachineTask = "sandesh::SandeshStateMachine"
 
static const std::string kLifetimeMgrTask = "sandesh::LifetimeMgr"
 
static bool task_policy_set_ = false
 

Friends

class DeleteActor
 

Additional Inherited Members

- Public Types inherited from SslServer
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
 
- Protected Types inherited from TcpServer
typedef boost::intrusive_ptr
< TcpServer
TcpServerPtr
 
typedef boost::intrusive_ptr
< TcpSession
TcpSessionPtr
 

Detailed Description

Definition at line 31 of file sandesh_server.h.

Member Typedef Documentation

typedef boost::ptr_map<boost::asio::ip::tcp::endpoint, SandeshConnection> SandeshServer::SandeshConnectionMap
private

Definition at line 79 of file sandesh_server.h.

typedef boost::ptr_container_detail::ref_pair< boost::asio::ip::basic_endpoint<boost::asio::ip::tcp>, SandeshConnection *const> SandeshServer::SandeshConnectionPair
private

Definition at line 82 of file sandesh_server.h.

Constructor & Destructor Documentation

SandeshServer::SandeshServer ( EventManager evm,
const SandeshConfig config 
)
explicit

Definition at line 48 of file sandesh_server.cc.

Here is the call graph for this function:

SandeshServer::~SandeshServer ( )
virtual

Definition at line 114 of file sandesh_server.cc.

Here is the call graph for this function:

Member Function Documentation

bool SandeshServer::AcceptSession ( TcpSession session)
protectedvirtual

Reimplemented from TcpServer.

Definition at line 237 of file sandesh_server.cc.

Here is the call graph for this function:

int SandeshServer::AllocConnectionIndex ( )

Definition at line 148 of file sandesh_server.cc.

SslSession * SandeshServer::AllocSession ( SslSocket socket)
protectedvirtual

Implements SslServer.

Definition at line 221 of file sandesh_server.cc.

Here is the call graph for this function:

bool SandeshServer::Compare ( const Endpoint peer_addr,
const SandeshConnectionPair p 
) const
private

Definition at line 205 of file sandesh_server.cc.

size_t SandeshServer::ConnectionsCount ( )
inline

Definition at line 57 of file sandesh_server.h.

TcpSession * SandeshServer::CreateSession ( )
virtual

Reimplemented from TcpServer.

Definition at line 174 of file sandesh_server.cc.

Here is the call graph for this function:

LifetimeActor * SandeshServer::deleter ( )

Definition at line 277 of file sandesh_server.cc.

virtual bool SandeshServer::DisableSandeshLogMessages ( ) const
inlinevirtual

Reimplemented from TcpServer.

Definition at line 48 of file sandesh_server.h.

SandeshServer::DISALLOW_COPY_AND_ASSIGN ( SandeshServer  )
private
virtual void SandeshServer::DisconnectSession ( SandeshSession session)
inlinevirtual

Definition at line 56 of file sandesh_server.h.

SandeshConnection * SandeshServer::FindConnection ( const Endpoint peer_addr)

Definition at line 210 of file sandesh_server.cc.

Here is the call graph for this function:

void SandeshServer::FreeConnectionIndex ( int  id)

Definition at line 159 of file sandesh_server.cc.

bool SandeshServer::Initialize ( short  port,
const std::string &  ip = "0.0.0.0" 
)
virtual

Definition at line 126 of file sandesh_server.cc.

Here is the call graph for this function:

void SandeshServer::Initiate ( )
LifetimeManager * SandeshServer::lifetime_manager ( )

Definition at line 281 of file sandesh_server.cc.

int SandeshServer::lifetime_mgr_task_id ( )

Definition at line 118 of file sandesh_server.cc.

virtual bool SandeshServer::ReceiveResourceUpdate ( SandeshSession session,
bool  rsc 
)
inlinevirtual

Definition at line 50 of file sandesh_server.h.

bool SandeshServer::ReceiveSandeshCtrlMsg ( SandeshStateMachine state_machine,
SandeshSession session,
const Sandesh sandesh 
)
virtual

Definition at line 263 of file sandesh_server.cc.

Here is the call graph for this function:

virtual bool SandeshServer::ReceiveSandeshMsg ( SandeshSession session,
const SandeshMessage msg,
bool  resource 
)
pure virtual
void SandeshServer::RemoveConnection ( SandeshConnection connection)

Definition at line 231 of file sandesh_server.cc.

Here is the call graph for this function:

int SandeshServer::session_reader_task_id ( ) const
inlineprotected

Definition at line 66 of file sandesh_server.h.

int SandeshServer::session_writer_task_id ( ) const
inlineprotected

Definition at line 65 of file sandesh_server.h.

void SandeshServer::SessionShutdown ( )
virtual

Definition at line 122 of file sandesh_server.cc.

Here is the call graph for this function:

void SandeshServer::Shutdown ( void  )

Definition at line 200 of file sandesh_server.cc.

Friends And Related Function Documentation

friend class DeleteActor
friend

Definition at line 75 of file sandesh_server.h.

Member Data Documentation

boost::dynamic_bitset SandeshServer::conn_bmap_
private

Definition at line 86 of file sandesh_server.h.

SandeshConnectionMap SandeshServer::connection_
private

Definition at line 85 of file sandesh_server.h.

boost::scoped_ptr<DeleteActor> SandeshServer::deleter_
private

Definition at line 91 of file sandesh_server.h.

const std::string SandeshServer::kLifetimeMgrTask = "sandesh::LifetimeMgr"
staticprivate

Definition at line 72 of file sandesh_server.h.

const int SandeshServer::kMaxInitRetries = 5
staticprivate

Definition at line 69 of file sandesh_server.h.

const std::string SandeshServer::kSessionReaderTask = "io::ReaderTask"
staticprivate

Definition at line 70 of file sandesh_server.h.

const std::string SandeshServer::kStateMachineTask = "sandesh::SandeshStateMachine"
staticprivate

Definition at line 71 of file sandesh_server.h.

boost::scoped_ptr<LifetimeManager> SandeshServer::lifetime_manager_
private

Definition at line 90 of file sandesh_server.h.

int SandeshServer::lifetime_mgr_task_id_
private

Definition at line 89 of file sandesh_server.h.

tbb::mutex SandeshServer::mutex_
private

Definition at line 93 of file sandesh_server.h.

int SandeshServer::session_reader_task_id_
private

Definition at line 88 of file sandesh_server.h.

int SandeshServer::sm_task_id_
private

Definition at line 87 of file sandesh_server.h.

bool SandeshServer::task_policy_set_ = false
staticprivate

Definition at line 73 of file sandesh_server.h.


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