OpenSDN source code
|
#include <xmpp_connection.h>
Classes | |
struct | ErrorStats |
struct | ProtoStats |
Public Member Functions | |
XmppConnection (TcpServer *server, const XmppChannelConfig *config) | |
virtual | ~XmppConnection () |
void | SetConfig (const XmppChannelConfig *) |
virtual bool | AcceptSession (XmppSession *session) |
virtual void | ReceiveMsg (XmppSession *session, const std::string &) |
virtual boost::asio::ip::tcp::endpoint | endpoint () const |
virtual boost::asio::ip::tcp::endpoint | local_endpoint () const |
std::string | endpoint_string () const |
std::string | local_endpoint_string () const |
TcpServer * | server () |
XmppSession * | CreateSession () |
int | GetTaskInstance () const |
const std::string & | ToUVEKey () const |
const std::string & | ToString () const |
const std::string & | FromString () const |
void | SetAdminDown (bool toggle) |
bool | Send (const uint8_t *data, size_t size, const std::string *msg_str=NULL) |
virtual bool | SendOpen (XmppSession *session) |
virtual bool | SendOpenConfirm (XmppSession *session) |
virtual bool | SendStreamFeatureRequest (XmppSession *session) |
virtual bool | SendStartTls (XmppSession *session) |
virtual bool | SendProceedTls (XmppSession *session) |
void | SendKeepAlive () |
void | SendClose (XmppSession *session) |
void | ProcessSslHandShakeResponse (SslSessionPtr session, const boost::system::error_code &error) |
int | ProcessXmppIqMessage (const XmppStanza::XmppMessage *) |
int | ProcessXmppChatMessage (const XmppStanza::XmppChatMessage *) |
void | StartKeepAliveTimer () |
void | StopKeepAliveTimer () |
void | UpdateKeepAliveTimer (uint8_t time_out) |
void | set_session (XmppSession *session) |
void | clear_session () |
void | SetTo (const std::string &) |
const XmppSession * | session () const |
XmppSession * | session () |
bool | logUVE () const |
bool | IsClient () const |
virtual void | ManagedDelete ()=0 |
virtual void | RetryDelete ()=0 |
virtual LifetimeActor * | deleter ()=0 |
virtual const LifetimeActor * | deleter () const =0 |
virtual LifetimeManager * | lifetime_manager ()=0 |
xmsm::XmState | GetStateMcState () const |
xmsm::XmOpenConfirmState | GetStateMcOpenConfirmState () const |
bool | IsActiveChannel () const |
XmppChannelMux * | ChannelMux () |
void | SetChannelMux (XmppChannelMux *channel_mux) |
void | Initialize () |
void | Clear () |
void | SetAdminState (bool down) |
void | Shutdown () |
bool | MayDelete () const |
bool | IsDeleted () const |
std::string & | GetComputeHostName () |
std::string & | GetControllerHostName () |
std::string & | GetFrom () |
std::string & | GetTo () |
virtual void | set_close_reason (const std::string &reason)=0 |
virtual void | increment_flap_count ()=0 |
virtual uint32_t | flap_count () const =0 |
virtual const std::string | last_flap_at () const =0 |
virtual void | WriteReady () |
int | GetConfiguredHoldTime () const |
int | GetNegotiatedHoldTime () const |
std::string | StateName () const |
std::string | LastStateName () const |
std::string | LastStateChangeAt () const |
std::string | LastEvent () const |
uint32_t | tx_open () const |
uint32_t | tx_keepalive () const |
uint32_t | tx_close () const |
uint32_t | tx_update () const |
uint32_t | rx_open () const |
uint32_t | rx_keepalive () const |
uint32_t | rx_close () const |
uint32_t | rx_update () const |
void | LogMsg (std::string msg) |
bool | disable_read () const |
void | set_disable_read (bool disable_read) |
XmppStateMachine * | state_machine () |
const XmppStateMachine * | state_machine () const |
void | set_state_machine (XmppStateMachine *state_machine) |
void | SwapXmppStateMachine (XmppConnection *other) |
uint8_t | dscp_value () const |
int | SetDscpValue (uint8_t value) |
void | inc_connect_error () |
void | inc_session_close () |
void | inc_open_fail () |
void | inc_stream_feature_fail () |
void | inc_handshake_failure () |
size_t | get_connect_error () |
size_t | get_session_close () |
size_t | get_open_fail () |
size_t | get_stream_feature_fail () |
size_t | get_handshake_failure () |
size_t | get_sm_connect_attempts () |
size_t | get_sm_keepalive_count () |
std::string | GetXmppAuthenticationType () const |
void | SwapContents (XmppConnection *other) |
boost::asio::ip::tcp::endpoint & | endpoint () |
const Timer * | keepalive_timer () const |
Static Public Attributes | |
static const char * | kAuthTypeNil = "NIL" |
static const char * | kAuthTypeTls = "TLS" |
Protected Member Functions | |
const XmppChannelMux * | channel_mux () const |
Protected Attributes | |
TcpServer * | server_ |
XmppSession * | session_ |
Private Member Functions | |
bool | KeepAliveTimerExpired () |
void | KeepaliveTimerErrorHanlder (std::string error_name, std::string error_message) |
XmppStanza::XmppMessage * | XmppDecode (const std::string &msg) |
void | LogKeepAliveSend () |
int | GetTaskInstance (bool is_client) const |
void | IncProtoStats (unsigned int type) |
DISALLOW_COPY_AND_ASSIGN (XmppConnection) | |
Private Attributes | |
boost::asio::ip::tcp::endpoint | endpoint_ |
boost::asio::ip::tcp::endpoint | local_endpoint_ |
const XmppChannelConfig * | config_ |
tbb::spin_mutex | spin_mutex_ |
Timer * | keepalive_timer_ |
bool | is_client_ |
bool | log_uve_ |
bool | admin_down_ |
bool | disable_read_ |
std::string | from_ |
std::string | to_ |
bool | auth_enabled_ |
uint8_t | dscp_value_ |
std::string | xmlns_ |
std::string | uve_key_str_ |
boost::scoped_ptr < XmppStateMachine > | state_machine_ |
boost::scoped_ptr< XmppChannelMux > | mux_ |
std::unique_ptr < XmppStanza::XmppMessage > | last_msg_ |
ProtoStats | stats_ [2] |
ErrorStats | error_stats_ |
Friends | |
class | XmppStateMachineTest |
Definition at line 30 of file xmpp_connection.h.
XmppConnection::XmppConnection | ( | TcpServer * | server, |
const XmppChannelConfig * | config | ||
) |
|
virtual |
|
virtual |
|
protected |
Definition at line 491 of file xmpp_connection.cc.
|
inline |
Definition at line 128 of file xmpp_connection.h.
|
inline |
Definition at line 132 of file xmpp_connection.h.
void XmppConnection::clear_session | ( | ) |
XmppSession * XmppConnection::CreateSession | ( | ) |
|
pure virtual |
Implemented in XmppClientConnection, and XmppServerConnection.
|
pure virtual |
Implemented in XmppClientConnection, and XmppServerConnection.
|
inline |
Definition at line 205 of file xmpp_connection.h.
|
private |
|
inline |
Definition at line 217 of file xmpp_connection.h.
|
virtual |
Definition at line 168 of file xmpp_connection.cc.
|
inline |
Definition at line 237 of file xmpp_connection.h.
string XmppConnection::endpoint_string | ( | ) | const |
Definition at line 176 of file xmpp_connection.cc.
|
pure virtual |
Implemented in XmppClientConnection, and XmppServerConnection.
const string & XmppConnection::FromString | ( | ) | const |
Definition at line 188 of file xmpp_connection.cc.
size_t XmppConnection::get_connect_error | ( | ) |
Definition at line 532 of file xmpp_connection.cc.
size_t XmppConnection::get_handshake_failure | ( | ) |
Definition at line 548 of file xmpp_connection.cc.
size_t XmppConnection::get_open_fail | ( | ) |
Definition at line 540 of file xmpp_connection.cc.
size_t XmppConnection::get_session_close | ( | ) |
Definition at line 536 of file xmpp_connection.cc.
size_t XmppConnection::get_sm_connect_attempts | ( | ) |
Definition at line 552 of file xmpp_connection.cc.
size_t XmppConnection::get_sm_keepalive_count | ( | ) |
Definition at line 556 of file xmpp_connection.cc.
size_t XmppConnection::get_stream_feature_fail | ( | ) |
Definition at line 544 of file xmpp_connection.cc.
|
inline |
Definition at line 139 of file xmpp_connection.h.
|
inline |
Definition at line 154 of file xmpp_connection.h.
|
inline |
Definition at line 140 of file xmpp_connection.h.
|
inline |
Definition at line 142 of file xmpp_connection.h.
|
inline |
Definition at line 158 of file xmpp_connection.h.
xmsm::XmOpenConfirmState XmppConnection::GetStateMcOpenConfirmState | ( | ) | const |
xmsm::XmState XmppConnection::GetStateMcState | ( | ) | const |
|
inline |
|
private |
|
inline |
Definition at line 143 of file xmpp_connection.h.
std::string XmppConnection::GetXmppAuthenticationType | ( | ) | const |
Definition at line 75 of file xmpp_connection.cc.
void XmppConnection::inc_connect_error | ( | ) |
Definition at line 512 of file xmpp_connection.cc.
void XmppConnection::inc_handshake_failure | ( | ) |
Definition at line 528 of file xmpp_connection.cc.
void XmppConnection::inc_open_fail | ( | ) |
Definition at line 520 of file xmpp_connection.cc.
void XmppConnection::inc_session_close | ( | ) |
Definition at line 516 of file xmpp_connection.cc.
void XmppConnection::inc_stream_feature_fail | ( | ) |
Definition at line 524 of file xmpp_connection.cc.
|
private |
Definition at line 495 of file xmpp_connection.cc.
|
pure virtual |
Implemented in XmppClientConnection, and XmppServerConnection.
|
inline |
Definition at line 131 of file xmpp_connection.h.
|
inline |
Definition at line 125 of file xmpp_connection.h.
|
inline |
Definition at line 116 of file xmpp_connection.h.
bool XmppConnection::IsDeleted | ( | ) | const |
|
inline |
Definition at line 238 of file xmpp_connection.h.
|
private |
|
private |
|
pure virtual |
Implemented in XmppClientConnection, and XmppServerConnection.
|
inline |
Definition at line 174 of file xmpp_connection.h.
|
inline |
Definition at line 170 of file xmpp_connection.h.
|
inline |
Definition at line 166 of file xmpp_connection.h.
|
pure virtual |
Implemented in XmppClientConnection, and XmppServerConnection.
|
virtual |
Definition at line 172 of file xmpp_connection.cc.
string XmppConnection::local_endpoint_string | ( | ) | const |
Definition at line 182 of file xmpp_connection.cc.
|
private |
void XmppConnection::LogMsg | ( | std::string | msg | ) |
|
inline |
Definition at line 115 of file xmpp_connection.h.
|
pure virtual |
Implemented in XmppClientConnection, and XmppServerConnection.
bool XmppConnection::MayDelete | ( | ) | const |
Definition at line 125 of file xmpp_connection.cc.
void XmppConnection::ProcessSslHandShakeResponse | ( | SslSessionPtr | session, |
const boost::system::error_code & | error | ||
) |
int XmppConnection::ProcessXmppChatMessage | ( | const XmppStanza::XmppChatMessage * | msg | ) |
Definition at line 644 of file xmpp_connection.cc.
int XmppConnection::ProcessXmppIqMessage | ( | const XmppStanza::XmppMessage * | msg | ) |
Definition at line 650 of file xmpp_connection.cc.
|
virtual |
|
pure virtual |
Implemented in XmppClientConnection, and XmppServerConnection.
|
inline |
Definition at line 197 of file xmpp_connection.h.
|
inline |
Definition at line 194 of file xmpp_connection.h.
|
inline |
Definition at line 191 of file xmpp_connection.h.
|
inline |
Definition at line 200 of file xmpp_connection.h.
bool XmppConnection::Send | ( | const uint8_t * | data, |
size_t | size, | ||
const std::string * | msg_str = NULL |
||
) |
void XmppConnection::SendClose | ( | XmppSession * | session | ) |
void XmppConnection::SendKeepAlive | ( | ) |
|
virtual |
|
virtual |
|
virtual |
|
virtual |
|
virtual |
|
inline |
Definition at line 73 of file xmpp_connection.h.
const XmppSession * XmppConnection::session | ( | ) | const |
Definition at line 104 of file xmpp_connection.cc.
XmppSession * XmppConnection::session | ( | ) |
Definition at line 108 of file xmpp_connection.cc.
|
pure virtual |
Implemented in XmppClientConnection, and XmppServerConnection.
|
inline |
void XmppConnection::set_session | ( | XmppSession * | session | ) |
|
inline |
Definition at line 210 of file xmpp_connection.h.
void XmppConnection::SetAdminDown | ( | bool | toggle | ) |
Definition at line 216 of file xmpp_connection.cc.
|
inline |
Definition at line 133 of file xmpp_connection.h.
|
inline |
Definition at line 129 of file xmpp_connection.h.
void XmppConnection::SetConfig | ( | const XmppChannelConfig * | config | ) |
Definition at line 83 of file xmpp_connection.cc.
int XmppConnection::SetDscpValue | ( | uint8_t | value | ) |
void XmppConnection::SetTo | ( | const std::string & | ) |
void XmppConnection::Shutdown | ( | void | ) |
void XmppConnection::StartKeepAliveTimer | ( | ) |
XmppStateMachine * XmppConnection::state_machine | ( | ) |
Definition at line 483 of file xmpp_connection.cc.
const XmppStateMachine * XmppConnection::state_machine | ( | ) | const |
Definition at line 487 of file xmpp_connection.cc.
|
inline |
Definition at line 162 of file xmpp_connection.h.
void XmppConnection::StopKeepAliveTimer | ( | ) |
void XmppConnection::SwapContents | ( | XmppConnection * | other | ) |
|
inline |
Definition at line 214 of file xmpp_connection.h.
const string & XmppConnection::ToString | ( | ) | const |
Definition at line 192 of file xmpp_connection.cc.
const std::string & XmppConnection::ToUVEKey | ( | ) | const |
Definition at line 196 of file xmpp_connection.cc.
|
inline |
Definition at line 184 of file xmpp_connection.h.
|
inline |
Definition at line 181 of file xmpp_connection.h.
|
inline |
Definition at line 178 of file xmpp_connection.h.
|
inline |
Definition at line 187 of file xmpp_connection.h.
void XmppConnection::UpdateKeepAliveTimer | ( | uint8_t | time_out | ) |
|
virtual |
Definition at line 112 of file xmpp_connection.cc.
|
private |
|
friend |
Definition at line 152 of file xmpp_connection.h.
|
private |
Definition at line 263 of file xmpp_connection.h.
|
private |
Definition at line 267 of file xmpp_connection.h.
|
private |
Definition at line 255 of file xmpp_connection.h.
|
private |
Definition at line 264 of file xmpp_connection.h.
|
private |
Definition at line 268 of file xmpp_connection.h.
|
private |
Definition at line 253 of file xmpp_connection.h.
|
private |
Definition at line 278 of file xmpp_connection.h.
|
private |
Definition at line 265 of file xmpp_connection.h.
|
private |
Definition at line 261 of file xmpp_connection.h.
|
static |
Definition at line 233 of file xmpp_connection.h.
|
static |
Definition at line 234 of file xmpp_connection.h.
|
private |
Definition at line 259 of file xmpp_connection.h.
|
private |
Definition at line 274 of file xmpp_connection.h.
|
private |
Definition at line 254 of file xmpp_connection.h.
|
private |
Definition at line 262 of file xmpp_connection.h.
|
private |
Definition at line 273 of file xmpp_connection.h.
|
protected |
Definition at line 241 of file xmpp_connection.h.
|
protected |
Definition at line 242 of file xmpp_connection.h.
|
private |
Definition at line 258 of file xmpp_connection.h.
|
private |
Definition at line 272 of file xmpp_connection.h.
|
private |
Definition at line 276 of file xmpp_connection.h.
|
private |
Definition at line 266 of file xmpp_connection.h.
|
mutableprivate |
Definition at line 270 of file xmpp_connection.h.
|
private |
Definition at line 269 of file xmpp_connection.h.