|
Project SkyFire Core
SkyFire 5.4.8 server core API documentation
|
Remote Administration socket. More...
#include <RASocket.h>
Classes | |
| struct | PendingWrite |
Public Member Functions | |
| RASocket (std::shared_ptr< Skyfire::Asio::IoContextExecutor > executor, std::unique_ptr< RASocketHandle > socket, std::string const &remoteAddress) | |
| void | start () |
| virtual | ~RASocket () |
Private Types | |
| typedef std::function< void(bool, std::string)> | ReadLineCallback |
| typedef std::function< void(bool)> | WriteCallback |
Private Member Functions | |
| void | async_read_line (ReadLineCallback callback) |
| int | check_access_level (const std::string &user) |
| int | check_password (const std::string &user, const std::string &pass) |
| void | close () |
| void | drain_command_output () |
| void | finish_subnegotiation () |
| void | handle_async_write (boost::system::error_code const &error) |
| void | handle_command (std::string const &command) |
| void | handle_credentials () |
| void | handle_read_line (boost::system::error_code const &error, size_t transferredBytes, ReadLineCallback callback) |
| void | handle_subnegotiation_read (boost::system::error_code const &error, size_t transferredBytes) |
| bool | is_open () const |
| void | prompt_command () |
| void | prompt_password () |
| void | prompt_username () |
| void | queue_write (std::string data, WriteCallback callback=WriteCallback()) |
| void | send_authentication_required () |
| void | start_async_write () |
| void | start_command (std::string const &command) |
| void | start_subnegotiation () |
| Used by telnet protocol RFC 854 / 855. | |
Static Private Member Functions | |
| static void | commandFinished (void *callbackArg, bool success) |
| static void | zprint (void *callbackArg, const char *szText) |
Private Attributes | |
| std::atomic< bool > | _closed |
| bool | _commandComplete |
| std::atomic< bool > | _commandExecuting |
| std::mutex | _commandLock |
| std::queue< std::string > | _commandOutput |
| bool | _commandOutputDrainInProgress |
| std::shared_ptr< RASocket > | _commandSelf |
| std::shared_ptr< Skyfire::Asio::IoContextExecutor > | _executor |
| boost::asio::streambuf | _lineBuffer |
| uint8 | _minLevel |
| Minimum security level required to connect. | |
| std::string | _pass |
| std::string | _remoteAddress |
| std::unique_ptr< RASocketHandle > | _socket |
| std::array< char, 1024 > | _subnegotiationBuffer |
| bool | _subnegotiationDone |
| bool | _subnegotiationTimedOut |
| boost::asio::steady_timer | _subnegotiationTimer |
| std::string | _user |
| bool | _writeInProgress |
| std::deque< PendingWrite > | _writeQueue |
Remote Administration socket.
Definition at line 31 of file RASocket.h.
|
private |
Definition at line 41 of file RASocket.h.
|
private |
Definition at line 40 of file RASocket.h.
| RASocket::RASocket | ( | std::shared_ptr< Skyfire::Asio::IoContextExecutor > | executor, |
| std::unique_ptr< RASocketHandle > | socket, | ||
| std::string const & | remoteAddress ) |
Definition at line 30 of file RASocket.cpp.
References _closed, _commandComplete, _commandExecuting, _commandOutput, _commandOutputDrainInProgress, _commandSelf, _executor, _lineBuffer, _minLevel, _pass, _remoteAddress, _socket, _subnegotiationBuffer, _subnegotiationDone, _subnegotiationTimedOut, _subnegotiationTimer, _user, _writeInProgress, _writeQueue, and sConfigMgr.
Referenced by commandFinished(), and zprint().
|
virtual |
Definition at line 54 of file RASocket.cpp.
References close().
|
private |
Definition at line 418 of file RASocket.cpp.
References _closed, _lineBuffer, and _socket.
|
private |
Definition at line 508 of file RASocket.cpp.
References _minLevel, LOGIN_SEL_ACCOUNT_ACCESS, LoginDatabase, AccountMgr::normalizeString(), PreparedStatement::setString(), and SF_LOG_INFO.
Referenced by handle_credentials().
|
private |
Definition at line 540 of file RASocket.cpp.
References SkyFire::Crypto::SRP6::CheckLogin(), LOGIN_SEL_CHECK_PASSWORD_BY_NAME, LoginDatabase, AccountMgr::normalizeString(), SkyFire::Crypto::SRP6::SALT_LENGTH, PreparedStatement::setString(), SF_LOG_INFO, and SkyFire::Crypto::SRP6::VERIFIER_LENGTH.
Referenced by handle_credentials().
|
private |
Definition at line 68 of file RASocket.cpp.
References _closed, _socket, _subnegotiationTimer, Skyfire::Net::CancelTimer(), Skyfire::Net::CloseTcpSocket(), and SF_LOG_INFO.
Referenced by handle_async_write(), handle_read_line(), handle_subnegotiation_read(), start_subnegotiation(), and ~RASocket().
|
staticprivate |
Definition at line 589 of file RASocket.cpp.
References _closed, _commandComplete, _commandExecuting, _commandLock, _commandSelf, and RASocket().
Referenced by start_command().
|
private |
Definition at line 453 of file RASocket.cpp.
References _closed, _commandComplete, _commandLock, _commandOutput, _commandOutputDrainInProgress, _commandSelf, prompt_command(), and queue_write().
|
private |
Definition at line 202 of file RASocket.cpp.
References send_authentication_required().
Referenced by handle_subnegotiation_read().
|
private |
Definition at line 390 of file RASocket.cpp.
References _writeInProgress, _writeQueue, close(), and start_async_write().
|
private |
Definition at line 319 of file RASocket.cpp.
References prompt_command(), queue_write(), SF_LOG_INFO, and start_command().
|
private |
Definition at line 269 of file RASocket.cpp.
References _pass, _user, check_access_level(), check_password(), queue_write(), SF_LOG_INFO, and sWorld.
|
private |
Definition at line 434 of file RASocket.cpp.
References _lineBuffer, and close().
|
private |
Definition at line 119 of file RASocket.cpp.
References _subnegotiationBuffer, _subnegotiationDone, _subnegotiationTimedOut, _subnegotiationTimer, Skyfire::Net::CancelTimer(), close(), finish_subnegotiation(), queue_write(), and SF_LOG_DEBUG.
|
private |
Definition at line 81 of file RASocket.cpp.
References _closed, and _socket.
Referenced by start_subnegotiation().
|
private |
Definition at line 295 of file RASocket.cpp.
References queue_write().
Referenced by drain_command_output(), and handle_command().
|
private |
Definition at line 244 of file RASocket.cpp.
References queue_write().
|
private |
Definition at line 219 of file RASocket.cpp.
References queue_write().
|
private |
Definition at line 359 of file RASocket.cpp.
References _closed, _writeInProgress, _writeQueue, and start_async_write().
Referenced by drain_command_output(), handle_command(), handle_credentials(), handle_subnegotiation_read(), prompt_command(), prompt_password(), prompt_username(), and send_authentication_required().
|
private |
Definition at line 207 of file RASocket.cpp.
References queue_write().
Referenced by finish_subnegotiation().
| void RASocket::start | ( | ) |
Definition at line 59 of file RASocket.cpp.
References _executor.
|
private |
Definition at line 375 of file RASocket.cpp.
References _closed, _socket, _writeInProgress, and _writeQueue.
Referenced by handle_async_write(), and queue_write().
|
private |
Definition at line 342 of file RASocket.cpp.
References _commandComplete, _commandExecuting, _commandLock, _commandOutput, _commandOutputDrainInProgress, _commandSelf, commandFinished(), sWorld, and zprint().
Referenced by handle_command().
|
private |
Used by telnet protocol RFC 854 / 855.
Definition at line 86 of file RASocket.cpp.
References _socket, _subnegotiationBuffer, _subnegotiationDone, _subnegotiationTimedOut, _subnegotiationTimer, close(), and is_open().
|
staticprivate |
Definition at line 564 of file RASocket.cpp.
References _closed, _commandLock, _commandOutput, _commandSelf, and RASocket().
Referenced by start_command().
|
private |
Definition at line 82 of file RASocket.h.
Referenced by async_read_line(), close(), commandFinished(), drain_command_output(), is_open(), queue_write(), RASocket(), start_async_write(), and zprint().
|
private |
Definition at line 91 of file RASocket.h.
Referenced by commandFinished(), drain_command_output(), RASocket(), and start_command().
|
private |
Definition at line 88 of file RASocket.h.
Referenced by commandFinished(), RASocket(), and start_command().
|
private |
Definition at line 89 of file RASocket.h.
Referenced by commandFinished(), drain_command_output(), start_command(), and zprint().
|
private |
Definition at line 90 of file RASocket.h.
Referenced by drain_command_output(), RASocket(), start_command(), and zprint().
|
private |
Definition at line 92 of file RASocket.h.
Referenced by drain_command_output(), RASocket(), and start_command().
|
private |
Definition at line 93 of file RASocket.h.
Referenced by commandFinished(), drain_command_output(), RASocket(), start_command(), and zprint().
|
private |
Definition at line 74 of file RASocket.h.
Referenced by RASocket(), and start().
|
private |
Definition at line 79 of file RASocket.h.
Referenced by async_read_line(), handle_read_line(), and RASocket().
|
private |
Minimum security level required to connect.
Definition at line 87 of file RASocket.h.
Referenced by check_access_level(), and RASocket().
|
private |
Definition at line 86 of file RASocket.h.
Referenced by handle_credentials(), and RASocket().
|
private |
Definition at line 77 of file RASocket.h.
Referenced by RASocket().
|
private |
Definition at line 75 of file RASocket.h.
Referenced by async_read_line(), close(), is_open(), RASocket(), start_async_write(), and start_subnegotiation().
|
private |
Definition at line 78 of file RASocket.h.
Referenced by handle_subnegotiation_read(), RASocket(), and start_subnegotiation().
|
private |
Definition at line 83 of file RASocket.h.
Referenced by handle_subnegotiation_read(), RASocket(), and start_subnegotiation().
|
private |
Definition at line 84 of file RASocket.h.
Referenced by handle_subnegotiation_read(), RASocket(), and start_subnegotiation().
|
private |
Definition at line 76 of file RASocket.h.
Referenced by close(), handle_subnegotiation_read(), RASocket(), and start_subnegotiation().
|
private |
Definition at line 85 of file RASocket.h.
Referenced by handle_credentials(), and RASocket().
|
private |
Definition at line 81 of file RASocket.h.
Referenced by handle_async_write(), queue_write(), RASocket(), and start_async_write().
|
private |
Definition at line 80 of file RASocket.h.
Referenced by handle_async_write(), queue_write(), RASocket(), and start_async_write().