|
CMSDK 2.0.1
Cross-platform C++ base library and SDK for the Psyclone AIOS platform
|
Telnet line protocol handler for interactive text connections. More...
#include <NetworkProtocols.h>
Public Member Functions | |
| TelnetProtocol () | |
| Public Member Functions inherited from cmlabs::NetworkProtocol | |
| NetworkProtocol () | |
Static Public Member Functions | |
| static bool | CheckBufferForCompatibility (const char *buffer, uint32 length) |
| static bool | InitialiseConversation (NetworkConnection *con) |
| Send any initial prompt/negotiation. | |
| static bool | SendTelnetLine (NetworkConnection *con, TelnetLine *line) |
| Send one line (with its line ending). | |
| static TelnetLine * | ReceiveTelnetLine (NetworkConnection *con, uint32 timeout) |
| Read one line terminated by CR/LF. | |
| static TelnetLine * | ReceiveTelnetLine (NetworkConnection *con, uint32 timeout, uint32 size) |
| Read a fixed number of bytes as one line (for raw/binary console input). | |
| Static Public Member Functions inherited from cmlabs::NetworkProtocol | |
| static bool | CheckBufferForCompatibility (const char *buffer, uint32 length) |
Sniff whether buffer looks like this protocol. | |
| static bool | InitialiseConversation (NetworkConnection *con) |
| Perform any protocol-specific initial exchange on a new connection. | |
Additional Inherited Members | |
| Public Attributes inherited from cmlabs::NetworkProtocol | |
| uint8 | protocol |
| PROTOCOL_* id of this handler. | |
Telnet line protocol handler for interactive text connections.
Definition at line 908 of file NetworkProtocols.h.
|
inline |
Definition at line 911 of file NetworkProtocols.h.
References cmlabs::NetworkProtocol::protocol, and PROTOCOL_TELNET.
|
static |
buffer looks like plain line-oriented text. Definition at line 2367 of file NetworkProtocols.cpp.
Referenced by cmlabs::NetworkChannel::ConnectionAutodetectRun().
|
static |
Send any initial prompt/negotiation.
| con | Connection. |
Definition at line 2373 of file NetworkProtocols.cpp.
|
static |
Read one line terminated by CR/LF.
| con | Connection. |
| timeout | Max wait in ms. |
Definition at line 2383 of file NetworkProtocols.cpp.
References cmlabs::NetworkConnection::discard(), cmlabs::NetworkConnection::getRemoteAddress(), cmlabs::GetTimeAgeMS(), cmlabs::GetTimeNow(), cmlabs::NetworkConnection::receiveAvailable(), cmlabs::TelnetLine::setCR(), cmlabs::TelnetLine::setLine(), TELNET_UNIX, TELNET_WINDOWS, and cmlabs::NetworkConnection::waitForDataToRead().
Referenced by cmlabs::NetworkChannel::sendReceiveTelnetLine(), and cmlabs::NetworkChannel::TelnetServerRun().
|
static |
Read a fixed number of bytes as one line (for raw/binary console input).
| con | Connection. |
| timeout | Max wait in ms. |
| size | Exact byte count. |
Definition at line 2438 of file NetworkProtocols.cpp.
References cmlabs::TelnetLine::data, cmlabs::NetworkConnection::getRemoteAddress(), cmlabs::NetworkConnection::receive(), cmlabs::TelnetLine::size, and cmlabs::NetworkConnection::waitForDataToRead().
|
static |
Send one line (with its line ending).
| con | Connection. |
| line | Line (caller keeps ownership). |
Definition at line 2377 of file NetworkProtocols.cpp.
References cmlabs::TelnetLine::data, cmlabs::TelnetLine::getSize(), and cmlabs::NetworkConnection::send().
Referenced by cmlabs::NetworkChannel::sendReceiveTelnetLine(), and cmlabs::NetworkChannel::sendTelnetLine().