Gateway transport using layer 5. More...
Inherits NLNET::IGatewayTransport.
Public Types | |
| typedef std::map< TServiceId, CL5Route * > | TRouteMap |
| typedef std::map < TL5TransportId, CGatewayL5Transport * > | TTransportDispatcher |
Public Member Functions | |
| CGatewayL5Transport (const IGatewayTransport::TCtorParam ¶m) | |
| Constructor. | |
| ~CGatewayL5Transport () | |
| const std::string & | getClassName () const |
| Return the class name from the transport factory. | |
| virtual void | update () |
| The gateway update the transport regularly. | |
| virtual uint32 | getRouteCount () const |
| Return the number of route currently open by the transport. | |
| void | dump (NLMISC::CLog &log) const |
| Dump debug information in the specified log stream. | |
| void | onCommand (const CMessage &) throw (EInvalidCommand) |
| The gateway send a command message to the transport. | |
| bool | onCommand (const TParsedCommandLine &command) throw (EInvalidCommand) |
| The gateway send a textual command to the transport. | |
| void | open (const std::string &subNetName) throw (ETransportError) |
| Open the server by establishing route with all known services. | |
| void | close () |
| Close the server, this will close all route. | |
| void | onServiceUp (const std::string &serviceName, TServiceId sid) |
| Event management. | |
| void | onServiceDown (const std::string &, TServiceId sid) |
| void | onDispatchMessage (const CMessage &msgin, TServiceId sid) |
| void | onAddTransport (TServiceId sid, TTransportDesc &desc) |
| void | onRemoveTransport (TServiceId sid, TTransportDesc &desc) |
Static Public Member Functions | |
| static void | cbL5AddTransport (CMessage &msgin, const std::string &, TServiceId sid) |
| static callback forwarder | |
| static void | cbL5RemoveTransport (CMessage &msgin, const std::string &, TServiceId sid) |
| static void | cbDispatchL5Message (CMessage &msgin, const std::string &serviceName, TServiceId sid) |
| static void | cbOnServiceUp (const std::string &serviceName, TServiceId sid, void *) |
| static void | cbOnServiceDown (const std::string &serviceName, TServiceId sid, void *) |
Public Attributes | |
| TL5TransportId | _TransportId |
| This transport ID. | |
| bool | _Open |
| current open status | |
| string | _SubNetName |
| Subnet name. | |
| TRouteMap | _Routes |
| The table that keep track of all routes. | |
Static Public Attributes | |
| static TTransportDispatcher | _TransportDispatcher |
| Global index of transport use to dispatch received message. | |
Friends | |
| class | CL5Route |
Gateway transport using layer 5.
Definition at line 125 of file module_l5_transport.cpp.
| typedef std::map<TServiceId, CL5Route*> NLNET::CGatewayL5Transport::TRouteMap |
Definition at line 137 of file module_l5_transport.cpp.
| typedef std::map<TL5TransportId, CGatewayL5Transport*> NLNET::CGatewayL5Transport::TTransportDispatcher |
Definition at line 141 of file module_l5_transport.cpp.
| NLNET::CGatewayL5Transport::CGatewayL5Transport | ( | const IGatewayTransport::TCtorParam & | param | ) | [inline] |
Constructor.
Definition at line 146 of file module_l5_transport.cpp.
References _TransportDispatcher, _TransportId, and NLNET::IGatewayTransport::PeerInvisible.
| NLNET::CGatewayL5Transport::~CGatewayL5Transport | ( | ) | [inline] |
Definition at line 160 of file module_l5_transport.cpp.
References _Open, _TransportDispatcher, _TransportId, close(), and nlassert.
| static void NLNET::CGatewayL5Transport::cbDispatchL5Message | ( | CMessage & | msgin, | |
| const std::string & | serviceName, | |||
| TServiceId | sid | |||
| ) | [inline, static] |
Definition at line 543 of file module_l5_transport.cpp.
References _TransportDispatcher, LNETL6_DEBUG, nlwarning, onDispatchMessage(), and NLMISC::CMemStream::serial().
Referenced by open().
| static void NLNET::CGatewayL5Transport::cbL5AddTransport | ( | CMessage & | msgin, | |
| const std::string & | , | |||
| TServiceId | sid | |||
| ) | [inline, static] |
static callback forwarder
callback from layer 5
Definition at line 488 of file module_l5_transport.cpp.
References _Open, _SubNetName, _TransportDispatcher, _TransportId, NLNET::TServiceId::get(), NLNET::IService::getInstance(), NLNET::IService::getServiceId(), LNETL6_DEBUG, onAddTransport(), and NLMISC::CMemStream::serial().
Referenced by open().
| static void NLNET::CGatewayL5Transport::cbL5RemoveTransport | ( | CMessage & | msgin, | |
| const std::string & | , | |||
| TServiceId | sid | |||
| ) | [inline, static] |
Definition at line 516 of file module_l5_transport.cpp.
References _Open, _SubNetName, _TransportDispatcher, _TransportId, NLNET::TServiceId::get(), LNETL6_DEBUG, onRemoveTransport(), and NLMISC::CMemStream::serial().
Referenced by open().
| static void NLNET::CGatewayL5Transport::cbOnServiceDown | ( | const std::string & | serviceName, | |
| TServiceId | sid, | |||
| void * | ||||
| ) | [inline, static] |
Definition at line 578 of file module_l5_transport.cpp.
References _Open, _TransportDispatcher, LNETL6_DEBUG, and onServiceDown().
Referenced by open().
| static void NLNET::CGatewayL5Transport::cbOnServiceUp | ( | const std::string & | serviceName, | |
| TServiceId | sid, | |||
| void * | ||||
| ) | [inline, static] |
Definition at line 564 of file module_l5_transport.cpp.
References _Open, _TransportDispatcher, LNETL6_DEBUG, and onServiceUp().
Referenced by open().
| void NLNET::CGatewayL5Transport::close | ( | ) | [inline] |
Close the server, this will close all route.
Definition at line 325 of file module_l5_transport.cpp.
References _Open, _Routes, H_AUTO, onServiceDown(), and NLNET::CL5Route::ServiceId.
Referenced by onCommand(), and ~CGatewayL5Transport().
| void NLNET::CGatewayL5Transport::dump | ( | NLMISC::CLog & | log | ) | const [inline, virtual] |
Dump debug information in the specified log stream.
Implements NLNET::IGatewayTransport.
Definition at line 190 of file module_l5_transport.cpp.
References _Open, _Routes, NLMISC::CLog::displayNL(), NLNET::CGatewayRoute::ForeignToLocalIdx, NLNET::TServiceId::get(), NLNET::IModuleManager::getInstance(), NLNET::IModuleProxy::getModuleName(), and NLNET::IModuleManager::getModuleProxy().
| const std::string& NLNET::CGatewayL5Transport::getClassName | ( | ) | const [inline, virtual] |
Return the class name from the transport factory.
Implements NLNET::IGatewayTransport.
Definition at line 175 of file module_l5_transport.cpp.
References LAYER5_CLASS_NAME.
| virtual uint32 NLNET::CGatewayL5Transport::getRouteCount | ( | ) | const [inline, virtual] |
Return the number of route currently open by the transport.
Implements NLNET::IGatewayTransport.
Definition at line 185 of file module_l5_transport.cpp.
References _Routes.
| void NLNET::CGatewayL5Transport::onAddTransport | ( | TServiceId | sid, | |
| TTransportDesc & | desc | |||
| ) | [inline] |
Definition at line 418 of file module_l5_transport.cpp.
References NLNET::IGatewayTransport::_Gateway, _Routes, _SubNetName, _TransportId, CL5Route, NLNET::CL5Route::ForeignTransportId, NLNET::TServiceId::get(), H_AUTO, NLNET::TTransportDesc::InResponse, LNETL6_DEBUG, NLNET::msg, NLNET::IModuleGateway::onRouteAdded(), NLMISC::CMemStream::serial(), NLNET::CL5Route::ServiceId, NLNET::TTransportDesc::SubNetName, and NLNET::TTransportDesc::TransportId.
Referenced by cbL5AddTransport().
| bool NLNET::CGatewayL5Transport::onCommand | ( | const TParsedCommandLine & | command | ) | throw (EInvalidCommand) [inline, virtual] |
The gateway send a textual command to the transport.
look for an optional sub network name
Implements NLNET::IGatewayTransport.
Definition at line 234 of file module_l5_transport.cpp.
References close(), open(), and NLNET::TParsedCommandLine::ParamValue.
| void NLNET::CGatewayL5Transport::onCommand | ( | const CMessage & | command | ) | throw (EInvalidCommand) [inline, virtual] |
The gateway send a command message to the transport.
Implements NLNET::IGatewayTransport.
Definition at line 228 of file module_l5_transport.cpp.
| void NLNET::CGatewayL5Transport::onDispatchMessage | ( | const CMessage & | msgin, | |
| TServiceId | sid | |||
| ) | [inline] |
retrieve the route for dispatching
Definition at line 390 of file module_l5_transport.cpp.
References NLNET::IGatewayTransport::_Gateway, _Routes, NLNET::TServiceId::get(), NLNET::IModuleGateway::getGatewayName(), H_AUTO, LNETL6_DEBUG, NLNET::CMessage::lockSubMessage(), nlRead, nlwarning, NLNET::IModuleGateway::onReceiveMessage(), and NLNET::CMessage::unlockSubMessage().
Referenced by cbDispatchL5Message().
| void NLNET::CGatewayL5Transport::onRemoveTransport | ( | TServiceId | sid, | |
| TTransportDesc & | desc | |||
| ) | [inline] |
Definition at line 458 of file module_l5_transport.cpp.
References NLNET::IGatewayTransport::_Gateway, _Routes, NLNET::TServiceId::get(), H_AUTO, LNETL6_DEBUG, nlwarning, NLNET::IModuleGateway::onRouteRemoved(), and NLNET::TTransportDesc::TransportId.
Referenced by cbL5RemoveTransport().
| void NLNET::CGatewayL5Transport::onServiceDown | ( | const std::string & | , | |
| TServiceId | sid | |||
| ) | [inline] |
Definition at line 367 of file module_l5_transport.cpp.
References NLNET::IGatewayTransport::_Gateway, _Routes, NLNET::TServiceId::get(), H_AUTO, LNETL6_DEBUG, nlinfo, and NLNET::IModuleGateway::onRouteRemoved().
Referenced by cbOnServiceDown(), and close().
| void NLNET::CGatewayL5Transport::onServiceUp | ( | const std::string & | serviceName, | |
| TServiceId | sid | |||
| ) | [inline] |
Event management.
Definition at line 348 of file module_l5_transport.cpp.
References _SubNetName, _TransportId, H_AUTO, LNETL6_DEBUG, NLNET::msg, and NLMISC::CMemStream::serial().
Referenced by cbOnServiceUp(), and open().
| void NLNET::CGatewayL5Transport::open | ( | const std::string & | subNetName | ) | throw (ETransportError) [inline] |
Open the server by establishing route with all known services.
Definition at line 265 of file module_l5_transport.cpp.
References _Open, _SubNetName, NLNET::CUnifiedNetwork::addCallbackArray(), cbDispatchL5Message(), cbL5AddTransport(), cbL5RemoveTransport(), cbOnServiceDown(), cbOnServiceUp(), NLNET::CUnifiedNetwork::getConnectionList(), NLNET::CUnifiedNetwork::getServiceName(), H_AUTO, NLNET::CUnifiedNetwork::isConnectionConnected(), LNETL6_DEBUG, onServiceUp(), NLNET::CUnifiedNetwork::setServiceDownCallback(), and NLNET::CUnifiedNetwork::setServiceUpCallback().
Referenced by onCommand().
| virtual void NLNET::CGatewayL5Transport::update | ( | ) | [inline, virtual] |
The gateway update the transport regularly.
Implements NLNET::IGatewayTransport.
Definition at line 181 of file module_l5_transport.cpp.
friend class CL5Route [friend] |
Definition at line 127 of file module_l5_transport.cpp.
Referenced by onAddTransport().
current open status
Definition at line 133 of file module_l5_transport.cpp.
Referenced by cbL5AddTransport(), cbL5RemoveTransport(), cbOnServiceDown(), cbOnServiceUp(), close(), dump(), open(), and ~CGatewayL5Transport().
The table that keep track of all routes.
Definition at line 139 of file module_l5_transport.cpp.
Referenced by close(), dump(), getRouteCount(), onAddTransport(), onDispatchMessage(), onRemoveTransport(), and onServiceDown().
Subnet name.
Definition at line 135 of file module_l5_transport.cpp.
Referenced by cbL5AddTransport(), cbL5RemoveTransport(), onAddTransport(), onServiceUp(), and open().
Global index of transport use to dispatch received message.
Definition at line 143 of file module_l5_transport.cpp.
Referenced by cbDispatchL5Message(), cbL5AddTransport(), cbL5RemoveTransport(), cbOnServiceDown(), cbOnServiceUp(), CGatewayL5Transport(), and ~CGatewayL5Transport().
This transport ID.
Definition at line 130 of file module_l5_transport.cpp.
Referenced by cbL5AddTransport(), cbL5RemoveTransport(), CGatewayL5Transport(), onAddTransport(), onServiceUp(), NLNET::CL5Route::sendMessage(), and ~CGatewayL5Transport().
1.6.1