|
CMSDK 2.0.1
Cross-platform C++ base library and SDK for the Psyclone AIOS platform
|
One line of Telnet-style text traffic. More...
#include <NetworkProtocols.h>
Public Member Functions | |
| TelnetLine (uint64 source) | |
| Construct an empty line. | |
| virtual | ~TelnetLine () |
| bool | setLine (const char *buffer, bool addCR) |
| Set the line text from a NUL-terminated string. | |
| bool | setLine (const char *buffer, uint32 len, bool addCR=false) |
| Set the line text from a length-delimited buffer. | |
| bool | giveData (char *buffer, uint32 len) |
| Take ownership of an existing buffer as the line text (no copy). | |
| uint32 | getSize () |
| bool | setCR (uint8 type) |
| Select the line-ending convention. | |
Public Attributes | |
| char * | data |
| Owned line text. | |
| char | cr [3] |
| Active line-ending characters (\r\n or \n, NUL-terminated). | |
| uint64 | time |
| Timestamp of creation/receipt (ms epoch). | |
| uint64 | source |
| Packed uint64 endpoint of the sender. | |
| uint32 | size |
| Line length in bytes. | |
| uint32 | user |
| Optional user/session tag for multi-user telnet servers. | |
One line of Telnet-style text traffic.
The unit of exchange for the PROTOCOL_TELNET protocol — a plain text line plus its line-ending convention, timestamp and source endpoint. Used for interactive console/diagnostic connections.
Definition at line 591 of file NetworkProtocols.h.
| cmlabs::TelnetLine::TelnetLine | ( | uint64 | source | ) |
Construct an empty line.
| source | Packed uint64 endpoint of the sender. |
Definition at line 1320 of file NetworkProtocols.cpp.
References cr, data, cmlabs::GetTimeNow(), size, source, time, and user.
|
virtual |
Definition at line 1332 of file NetworkProtocols.cpp.
References data.
| uint32 cmlabs::TelnetLine::getSize | ( | ) |
Definition at line 1354 of file NetworkProtocols.cpp.
Referenced by cmlabs::TelnetProtocol::SendTelnetLine().
| bool cmlabs::TelnetLine::giveData | ( | char * | buffer, |
| uint32 | len ) |
Take ownership of an existing buffer as the line text (no copy).
| buffer | Heap buffer this object will delete[]. |
| len | Byte count. |
Definition at line 1384 of file NetworkProtocols.cpp.
| bool cmlabs::TelnetLine::setCR | ( | uint8 | type | ) |
Select the line-ending convention.
| type | TELNET_WINDOWS or TELNET_UNIX. |
Definition at line 1338 of file NetworkProtocols.cpp.
References cr, TELNET_UNIX, and TELNET_WINDOWS.
Referenced by cmlabs::TelnetProtocol::ReceiveTelnetLine().
| bool cmlabs::TelnetLine::setLine | ( | const char * | buffer, |
| bool | addCR ) |
Set the line text from a NUL-terminated string.
| buffer | Text (copied). |
| addCR | Append the line ending when true. |
Definition at line 1363 of file NetworkProtocols.cpp.
References setLine().
Referenced by cmlabs::TelnetProtocol::ReceiveTelnetLine(), and setLine().
| bool cmlabs::TelnetLine::setLine | ( | const char * | buffer, |
| uint32 | len, | ||
| bool | addCR = false ) |
Set the line text from a length-delimited buffer.
| buffer | Text bytes (copied). |
| len | Byte count. |
| addCR | Append the line ending when true. |
Definition at line 1367 of file NetworkProtocols.cpp.
| char cmlabs::TelnetLine::cr[3] |
Active line-ending characters (\r\n or \n, NUL-terminated).
Definition at line 616 of file NetworkProtocols.h.
Referenced by setCR(), setLine(), and TelnetLine().
| char* cmlabs::TelnetLine::data |
Owned line text.
Definition at line 615 of file NetworkProtocols.h.
Referenced by getSize(), giveData(), cmlabs::TelnetProtocol::ReceiveTelnetLine(), cmlabs::TelnetProtocol::SendTelnetLine(), setLine(), TelnetLine(), and ~TelnetLine().
| uint32 cmlabs::TelnetLine::size |
Line length in bytes.
Definition at line 619 of file NetworkProtocols.h.
Referenced by getSize(), giveData(), cmlabs::TelnetProtocol::ReceiveTelnetLine(), and TelnetLine().
| uint64 cmlabs::TelnetLine::source |
Packed uint64 endpoint of the sender.
Definition at line 618 of file NetworkProtocols.h.
Referenced by TelnetLine().
| uint64 cmlabs::TelnetLine::time |
Timestamp of creation/receipt (ms epoch).
Definition at line 617 of file NetworkProtocols.h.
Referenced by TelnetLine().
| uint32 cmlabs::TelnetLine::user |
Optional user/session tag for multi-user telnet servers.
Definition at line 620 of file NetworkProtocols.h.
Referenced by TelnetLine().