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

#include <xmpp_client.h>

Inheritance diagram for XmppClient:
Collaboration diagram for XmppClient:

Classes

class  DeleteActor
 

Public Types

typedef
boost::asio::ip::tcp::endpoint 
Endpoint
 
typedef boost::function< void(XmppChannelMux
*, xmps::PeerState)> 
ConnectionEventCb
 
- 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
 

Public Member Functions

 XmppClient (EventManager *evm)
 
 XmppClient (EventManager *evm, const XmppChannelConfig *config)
 
virtual ~XmppClient ()
 
void Shutdown ()
 
void RegisterConnectionEvent (xmps::PeerId, ConnectionEventCb)
 
void UnRegisterConnectionEvent (xmps::PeerId)
 
void NotifyConnectionEvent (XmppChannelMux *, xmps::PeerState)
 
size_t ConnectionEventCount () const
 
virtual TcpSessionCreateSession ()
 
virtual bool Initialize (short port)
 
XmppClientConnectionCreateConnection (const XmppChannelConfig *config)
 
XmppClientConnectionFindConnection (const std::string &address)
 
void InsertConnection (XmppClientConnection *connection)
 
void RemoveConnection (XmppClientConnection *connection)
 
size_t ConnectionCount () const
 
XmppChannelFindChannel (const std::string &address)
 
void ConfigUpdate (const XmppConfigData *cfg)
 
XmppConfigManagerxmpp_config_mgr ()
 
LifetimeManagerlifetime_manager ()
 
virtual LifetimeActordeleter ()
 
int SetDscpValue (uint8_t value, const char *conn_id)
 
uint32_t XmppTimeOut (const char *conn_id)
 
void UpdateTimeOut (uint8_t time_out, const char *conn_id)
 
- Public Member Functions inherited from XmppConnectionManager
 XmppConnectionManager (EventManager *evm, boost::asio::ssl::context::method m, bool ssl_enabled, bool ssl_handshake_delayed)
 
void Shutdown ()
 
void EnqueueSession (XmppSession *session)
 
size_t GetSessionQueueSize () const
 
tbb::mutex & mutex () const
 
- 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)
 
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)
 
- Protected Member Functions inherited from SslServer
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 Types

typedef std::map< Endpoint,
XmppClientConnection * > 
ConnectionMap
 
typedef std::map< xmps::PeerId,
ConnectionEventCb
ConnectionEventCbMap
 

Private Member Functions

void ProcessConfigUpdate (XmppConfigManager::DiffType delta, const XmppChannelConfig *current, const XmppChannelConfig *future)
 
 DISALLOW_COPY_AND_ASSIGN (XmppClient)
 

Private Attributes

ConnectionMap connection_map_
 
ConnectionEventCbMap connection_event_map_
 
tbb::mutex connection_event_map_mutex_
 
boost::scoped_ptr
< XmppConfigManager
config_mgr_
 
boost::scoped_ptr
< LifetimeManager
lifetime_manager_
 
boost::scoped_ptr< DeleteActordeleter_
 
bool auth_enabled_
 
int tcp_hold_time_
 

Friends

class XmppSessionTest
 
class XmppStreamMessageTest
 
class DeleteActor
 

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 22 of file xmpp_client.h.

Member Typedef Documentation

Definition at line 33 of file xmpp_client.h.

Definition at line 68 of file xmpp_client.h.

Definition at line 67 of file xmpp_client.h.

typedef boost::asio::ip::tcp::endpoint XmppClient::Endpoint

Definition at line 24 of file xmpp_client.h.

Constructor & Destructor Documentation

XmppClient::XmppClient ( EventManager evm)
explicit

Definition at line 42 of file xmpp_client.cc.

XmppClient::XmppClient ( EventManager evm,
const XmppChannelConfig config 
)

Definition at line 52 of file xmpp_client.cc.

Here is the call graph for this function:

XmppClient::~XmppClient ( )
virtual

Definition at line 119 of file xmpp_client.cc.

Member Function Documentation

SslSession * XmppClient::AllocSession ( SslSocket socket)
protectedvirtual

Implements SslServer.

Definition at line 226 of file xmpp_client.cc.

void XmppClient::ConfigUpdate ( const XmppConfigData cfg)

Definition at line 188 of file xmpp_client.cc.

Here is the call graph for this function:

size_t XmppClient::ConnectionCount ( ) const

Definition at line 222 of file xmpp_client.cc.

size_t XmppClient::ConnectionEventCount ( ) const

Definition at line 218 of file xmpp_client.cc.

XmppClientConnection * XmppClient::CreateConnection ( const XmppChannelConfig config)

Definition at line 239 of file xmpp_client.cc.

Here is the call graph for this function:

TcpSession * XmppClient::CreateSession ( )
virtual

Reimplemented from TcpServer.

Definition at line 135 of file xmpp_client.cc.

Here is the call graph for this function:

LifetimeActor * XmppClient::deleter ( )
virtual

Implements XmppConnectionManager.

Definition at line 127 of file xmpp_client.cc.

XmppClient::DISALLOW_COPY_AND_ASSIGN ( XmppClient  )
private
XmppChannel * XmppClient::FindChannel ( const std::string &  address)

Definition at line 269 of file xmpp_client.cc.

Here is the call graph for this function:

XmppClientConnection * XmppClient::FindConnection ( const std::string &  address)

Definition at line 231 of file xmpp_client.cc.

bool XmppClient::Initialize ( short  port)
virtual

Definition at line 122 of file xmpp_client.cc.

Here is the call graph for this function:

void XmppClient::InsertConnection ( XmppClientConnection connection)

Definition at line 252 of file xmpp_client.cc.

Here is the call graph for this function:

LifetimeManager * XmppClient::lifetime_manager ( )

Definition at line 131 of file xmpp_client.cc.

void XmppClient::NotifyConnectionEvent ( XmppChannelMux mux,
xmps::PeerState  state 
)

Definition at line 208 of file xmpp_client.cc.

void XmppClient::ProcessConfigUpdate ( XmppConfigManager::DiffType  delta,
const XmppChannelConfig current,
const XmppChannelConfig future 
)
private

Definition at line 173 of file xmpp_client.cc.

Here is the call graph for this function:

void XmppClient::RegisterConnectionEvent ( xmps::PeerId  id,
ConnectionEventCb  cb 
)

Definition at line 195 of file xmpp_client.cc.

void XmppClient::RemoveConnection ( XmppClientConnection connection)

Definition at line 261 of file xmpp_client.cc.

Here is the call graph for this function:

int XmppClient::SetDscpValue ( uint8_t  value,
const char *  conn_id 
)

Definition at line 274 of file xmpp_client.cc.

Here is the call graph for this function:

void XmppClient::Shutdown ( void  )

Definition at line 167 of file xmpp_client.cc.

Here is the call graph for this function:

void XmppClient::UnRegisterConnectionEvent ( xmps::PeerId  id)

Definition at line 201 of file xmpp_client.cc.

void XmppClient::UpdateTimeOut ( uint8_t  time_out,
const char *  conn_id 
)

Definition at line 282 of file xmpp_client.cc.

Here is the call graph for this function:

XmppConfigManager* XmppClient::xmpp_config_mgr ( )
inline

Definition at line 50 of file xmpp_client.h.

uint32_t XmppClient::XmppTimeOut ( const char *  conn_id)

Definition at line 289 of file xmpp_client.cc.

Here is the call graph for this function:

Friends And Related Function Documentation

friend class DeleteActor
friend

Definition at line 65 of file xmpp_client.h.

friend class XmppSessionTest
friend

Definition at line 62 of file xmpp_client.h.

friend class XmppStreamMessageTest
friend

Definition at line 64 of file xmpp_client.h.

Member Data Documentation

bool XmppClient::auth_enabled_
private

Definition at line 81 of file xmpp_client.h.

boost::scoped_ptr<XmppConfigManager> XmppClient::config_mgr_
private

Definition at line 77 of file xmpp_client.h.

ConnectionEventCbMap XmppClient::connection_event_map_
private

Definition at line 74 of file xmpp_client.h.

tbb::mutex XmppClient::connection_event_map_mutex_
private

Definition at line 75 of file xmpp_client.h.

ConnectionMap XmppClient::connection_map_
private

Definition at line 73 of file xmpp_client.h.

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

Definition at line 79 of file xmpp_client.h.

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

Definition at line 78 of file xmpp_client.h.

int XmppClient::tcp_hold_time_
private

Definition at line 82 of file xmpp_client.h.


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