Provides access to a console shell as a telnet server.
More...
#include <uuid/telnet.h>
Provides access to a console shell as a telnet server.
- Since
- 0.1.0
Definition at line 230 of file telnet.h.
◆ shell_factory_function
Function to handle the creation of a shell.
- Parameters
-
[in] | stream | Stream for the telnet connection. |
[in] | addr | Remote IP address. |
[in] | port | Remote port. |
- Since
- 0.1.0
Definition at line 245 of file telnet.h.
◆ TelnetService() [1/4]
uuid::telnet::TelnetService::TelnetService |
( |
std::shared_ptr< uuid::console::Commands > |
commands, |
|
|
unsigned int |
context = 0 , |
|
|
unsigned int |
flags = 0 |
|
) |
| |
Create a new telnet service listening on the default port.
- Parameters
-
[in] | commands | Commands available for execution in shells. |
[in] | context | Default context for shells. |
[in] | flags | Initial flags for shells. |
- Since
- 0.1.0
Definition at line 73 of file telnet.cpp.
◆ TelnetService() [2/4]
uuid::telnet::TelnetService::TelnetService |
( |
uint16_t |
port, |
|
|
std::shared_ptr< uuid::console::Commands > |
commands, |
|
|
unsigned int |
context = 0 , |
|
|
unsigned int |
flags = 0 |
|
) |
| |
Create a new telnet service listening on a specific port.
- Parameters
-
[in] | port | TCP listening port. |
[in] | commands | Commands available for execution in shells. |
[in] | context | Default context for shells. |
[in] | flags | Initial flags for shells. |
- Since
- 0.1.0
Definition at line 78 of file telnet.cpp.
◆ TelnetService() [3/4]
Create a new telnet service listening on the default port.
- Parameters
-
[in] | shell_factory | Function to create a shell for new connections. |
- Since
- 0.1.0
Definition at line 86 of file telnet.cpp.
◆ TelnetService() [4/4]
Create a new telnet service listening on a specific port.
- Parameters
-
[in] | port | TCP listening port. |
[in] | shell_factory | Function to create a shell for new connections. |
- Since
- 0.1.0
Definition at line 91 of file telnet.cpp.
◆ close_all()
void uuid::telnet::TelnetService::close_all |
( |
| ) |
|
Close all connections.
The listening status is not affected.
- Since
- 0.1.0
Definition at line 100 of file telnet.cpp.
◆ default_write_timeout() [1/2]
unsigned long uuid::telnet::TelnetService::default_write_timeout |
( |
| ) |
const |
Get the default socket write timeout for new connections.
- Returns
- The default socket write timeout in seconds (or 0 for platform default).
- Since
- 0.1.0
Definition at line 138 of file telnet.cpp.
◆ default_write_timeout() [2/2]
void uuid::telnet::TelnetService::default_write_timeout |
( |
unsigned long |
timeout | ) |
|
Set the default socket write timeout for new connections.
Defaults to TelnetService::DEFAULT_WRITE_TIMEOUT (platform default).
- Parameters
-
[in] | timeout | Socket write timeout in seconds (or 0 for platform default). |
- Since
- 0.1.0
Definition at line 142 of file telnet.cpp.
◆ initial_idle_timeout() [1/2]
unsigned long uuid::telnet::TelnetService::initial_idle_timeout |
( |
| ) |
const |
Get the initial idle timeout for new connections.
- Returns
- The initial idle timeout in seconds (or 0 for disabled).
- Since
- 0.1.0
Definition at line 130 of file telnet.cpp.
◆ initial_idle_timeout() [2/2]
void uuid::telnet::TelnetService::initial_idle_timeout |
( |
unsigned long |
timeout | ) |
|
◆ loop()
void uuid::telnet::TelnetService::loop |
( |
| ) |
|
Accept new connections.
- Since
- 0.1.0
Definition at line 146 of file telnet.cpp.
◆ maximum_connections() [1/2]
size_t uuid::telnet::TelnetService::maximum_connections |
( |
| ) |
const |
Get the maximum number of concurrent open connections.
- Returns
- The maximum number of concurrent open connections.
- Since
- 0.1.0
Definition at line 111 of file telnet.cpp.
◆ maximum_connections() [2/2]
void uuid::telnet::TelnetService::maximum_connections |
( |
size_t |
count | ) |
|
◆ start()
void uuid::telnet::TelnetService::start |
( |
| ) |
|
Start listening for connections on the configured port.
- Since
- 0.1.0
Definition at line 96 of file telnet.cpp.
◆ stop()
void uuid::telnet::TelnetService::stop |
( |
| ) |
|
Stop listening for connections.
Existing connections are not affected.
- Since
- 0.1.0
Definition at line 107 of file telnet.cpp.
◆ connections_
std::list<Connection> uuid::telnet::TelnetService::connections_ |
|
private |
Open connections.
- Since
- 0.1.0
Definition at line 425 of file telnet.h.
◆ DEFAULT_IDLE_TIMEOUT
constexpr unsigned long uuid::telnet::TelnetService::DEFAULT_IDLE_TIMEOUT = 600 |
|
staticconstexpr |
Default initial idle timeout (in seconds).
- Since
- 0.1.0
Definition at line 234 of file telnet.h.
◆ DEFAULT_PORT
constexpr uint16_t uuid::telnet::TelnetService::DEFAULT_PORT = 23 |
|
staticconstexpr |
Default TCP port to listen on.
- Since
- 0.1.0
Definition at line 233 of file telnet.h.
◆ DEFAULT_WRITE_TIMEOUT
constexpr unsigned long uuid::telnet::TelnetService::DEFAULT_WRITE_TIMEOUT = 0 |
|
staticconstexpr |
Default write timeout (in milliseconds). @ since 0.1.0
Definition at line 235 of file telnet.h.
◆ initial_idle_timeout_
Initial idle timeout (in seconds).
- Since
- 0.1.0
Definition at line 427 of file telnet.h.
◆ logger_
uuid::log::Logger uuid::telnet::TelnetService::logger_ {FPSTR(__pstr__logger_name), uuid::log::Facility::DAEMON} |
|
staticprivate |
◆ MAX_CONNECTIONS
constexpr size_t uuid::telnet::TelnetService::MAX_CONNECTIONS = 3 |
|
staticconstexpr |
Maximum number of concurrent open connections.
- Since
- 0.1.0
Definition at line 232 of file telnet.h.
◆ maximum_connections_
Maximum number of concurrent open connections.
- Since
- 0.1.0
Definition at line 424 of file telnet.h.
◆ server_
WiFiServer uuid::telnet::TelnetService::server_ |
|
private |
TCP server.
- Since
- 0.1.0
Definition at line 423 of file telnet.h.
◆ shell_factory_
Function to create a shell.
- Since
- 0.1.0
Definition at line 426 of file telnet.h.
◆ write_timeout_
Write timeout (in milliseconds).
- Since
- 0.1.0
Definition at line 428 of file telnet.h.
The documentation for this class was generated from the following files: