#include "telnet/TelnetServer.hpp"
#include "Version.h"
#include "utils/ErrorHelpers.hpp"
#include "utils/Hasher.hpp"
#include <spdlog/spdlog.h>
#include <algorithm>
#include <array>
#include <ctime>
#include <iomanip>
#include <iostream>
#include <sstream>
#include <utility>
#include <sys/time.h>
Go to the source code of this file.
Functions | |
const std::string | ANSI_FG_BLACK ("\x1b[30m") |
const std::string | ANSI_FG_RED ("\x1b[31m") |
const std::string | ANSI_FG_GREEN ("\x1b[32m") |
const std::string | ANSI_FG_YELLOW ("\x1b[33m") |
const std::string | ANSI_FG_BLUE ("\x1b[34m") |
const std::string | ANSI_FG_MAGENTA ("\x1b[35m") |
const std::string | ANSI_FG_CYAN ("\x1b[36m") |
const std::string | ANSI_FG_WHITE ("\x1b[37m") |
const std::string | ANSI_FG_DEFAULT ("\x1b[39m") |
const std::string | ANSI_BG_BLACK ("\x1b[40m") |
const std::string | ANSI_BG_RED ("\x1b[41m") |
const std::string | ANSI_BG_GREEN ("\x1b[42m") |
const std::string | ANSI_BG_YELLOW ("\x1b[43m") |
const std::string | ANSI_BG_BLUE ("\x1b[44m") |
const std::string | ANSI_BG_MAGENTA ("\x1b[45m") |
const std::string | ANSI_BG_CYAN ("\x1b[46m") |
const std::string | ANSI_BG_WHITE ("\x1b[47m") |
const std::string | ANSI_BG_DEFAULT ("\x1b[49m") |
const std::string | ANSI_BOLD_ON ("\x1b[1m") |
const std::string | ANSI_BOLD_OFF ("\x1b[22m") |
const std::string | ANSI_ITALICS_ON ("\x1b[3m") |
const std::string | ANSI_ITALCIS_OFF ("\x1b[23m") |
const std::string | ANSI_UNDERLINE_ON ("\x1b[4m") |
const std::string | ANSI_UNDERLINE_OFF ("\x1b[24m") |
const std::string | ANSI_INVERSE_ON ("\x1b[7m") |
const std::string | ANSI_INVERSE_OFF ("\x1b[27m") |
const std::string | ANSI_STRIKETHROUGH_ON ("\x1b[9m") |
const std::string | ANSI_STRIKETHROUGH_OFF ("\x1b[29m") |
const std::string | ANSI_ERASE_LINE ("\x1b[2K") |
const std::string | ANSI_ERASE_SCREEN ("\x1b[2J") |
const std::string | ANSI_ARROW_UP ("\x1b\x5b\x41") |
const std::string | ANSI_ARROW_DOWN ("\x1b\x5b\x42") |
const std::string | ANSI_ARROW_RIGHT ("\x1b\x5b\x43") |
const std::string | ANSI_ARROW_LEFT ("\x1b\x5b\x44") |
const std::string | ANSI_DOUBLE_HORIZONTAL_TAB ("\t\t") |
const std::string | ANSI_HORIZONTAL_TAB ("\t") |
const std::string | TELNET_ERASE_LINE ("\xff\xf8") |
const std::string | TELNET_CLEAR_SCREEN ("\033[2J") |
void | TelnetPrintAvailableCommands (const SP_TelnetSession &session) |
void | TelnetConnectedCallback (const SP_TelnetSession &session) |
bool | TelnetMessageCallback (const SP_TelnetSession &session, const std::string &line) |
std::string | TelnetTabCallback (const SP_TelnetSession &session, std::string_view line) |
Variables | |
constexpr int | INVALID_SOCKET = -1 |
constexpr int | DEFAULT_BUFLEN = 512 |
constexpr int | TELNET_TIMEOUT = 120 |
constexpr int | MAX_AVAILABLE_SESSION = 5 |
constexpr int | TELNET_HISTORY_LIMIT = 50 |
constexpr int | SLEEP_INTERVAL_MS = 50 |
constexpr int | KEY_WIDTH = 30 |
constexpr int | VAL_WIDTH = 15 |
constexpr int | ASCII_LF = 0x0A |
constexpr int | ASCII_NULL = 0x00 |
constexpr int | ASCII_NBSP = 0xFF |
const std::vector< std::pair< std::string, std::string > > | telnetCommands |
const std::string ANSI_ARROW_DOWN | ( | "\x1b\x5b\x42" | ) |
const std::string ANSI_ARROW_LEFT | ( | "\x1b\x5b\x44" | ) |
const std::string ANSI_ARROW_RIGHT | ( | "\x1b\x5b\x43" | ) |
const std::string ANSI_ARROW_UP | ( | "\x1b\x5b\x41" | ) |
const std::string ANSI_BG_BLACK | ( | ) |
const std::string ANSI_BG_BLUE | ( | ) |
const std::string ANSI_BG_CYAN | ( | ) |
const std::string ANSI_BG_DEFAULT | ( | ) |
const std::string ANSI_BG_GREEN | ( | ) |
const std::string ANSI_BG_MAGENTA | ( | ) |
const std::string ANSI_BG_RED | ( | ) |
const std::string ANSI_BG_WHITE | ( | ) |
const std::string ANSI_BG_YELLOW | ( | ) |
const std::string ANSI_BOLD_OFF | ( | ) |
const std::string ANSI_BOLD_ON | ( | ) |
const std::string ANSI_DOUBLE_HORIZONTAL_TAB | ( | "\t\t" | ) |
const std::string ANSI_ERASE_LINE | ( | ) |
const std::string ANSI_ERASE_SCREEN | ( | ) |
const std::string ANSI_FG_BLACK | ( | ) |
const std::string ANSI_FG_BLUE | ( | ) |
const std::string ANSI_FG_CYAN | ( | ) |
const std::string ANSI_FG_DEFAULT | ( | ) |
const std::string ANSI_FG_GREEN | ( | ) |
const std::string ANSI_FG_MAGENTA | ( | ) |
const std::string ANSI_FG_RED | ( | ) |
const std::string ANSI_FG_WHITE | ( | ) |
const std::string ANSI_FG_YELLOW | ( | ) |
const std::string ANSI_HORIZONTAL_TAB | ( | "\t" | ) |
const std::string ANSI_INVERSE_OFF | ( | ) |
const std::string ANSI_INVERSE_ON | ( | ) |
const std::string ANSI_ITALCIS_OFF | ( | ) |
const std::string ANSI_ITALICS_ON | ( | ) |
const std::string ANSI_STRIKETHROUGH_OFF | ( | ) |
const std::string ANSI_STRIKETHROUGH_ON | ( | ) |
const std::string ANSI_UNDERLINE_OFF | ( | ) |
const std::string ANSI_UNDERLINE_ON | ( | ) |
const std::string TELNET_CLEAR_SCREEN | ( | ) |
const std::string TELNET_ERASE_LINE | ( | "\xff\xf8" | ) |
void TelnetConnectedCallback | ( | const SP_TelnetSession & | session | ) |
Telnet session connection start callback
[in] | session | Handle to session |
Definition at line 771 of file TelnetServer.cpp.
bool TelnetMessageCallback | ( | const SP_TelnetSession & | session, |
const std::string & | line ) |
Telnet session message received callback
[in] | session | Handle to session |
[in] | line | Received message |
Definition at line 780 of file TelnetServer.cpp.
void TelnetPrintAvailableCommands | ( | const SP_TelnetSession & | session | ) |
Print available commands to the session
[in] | session | Handle to session |
Definition at line 755 of file TelnetServer.cpp.
std::string TelnetTabCallback | ( | const SP_TelnetSession & | session, |
std::string_view | line ) |
Telnet session TAB received callback
[in] | session | Handle to session |
[in] | line | Received message |
Definition at line 857 of file TelnetServer.cpp.
|
constexpr |
Definition at line 37 of file TelnetServer.cpp.
|
constexpr |
Definition at line 39 of file TelnetServer.cpp.
|
constexpr |
Definition at line 38 of file TelnetServer.cpp.
|
constexpr |
Definition at line 22 of file TelnetServer.cpp.
|
constexpr |
Definition at line 20 of file TelnetServer.cpp.
|
constexpr |
Definition at line 33 of file TelnetServer.cpp.
|
constexpr |
Definition at line 26 of file TelnetServer.cpp.
|
constexpr |
Definition at line 30 of file TelnetServer.cpp.
|
constexpr |
Definition at line 28 of file TelnetServer.cpp.
|
constexpr |
Definition at line 24 of file TelnetServer.cpp.
const std::vector<std::pair<std::string, std::string> > telnetCommands |
Definition at line 42 of file TelnetServer.cpp.
|
constexpr |
Definition at line 34 of file TelnetServer.cpp.