telnet.h
Go to the documentation of this file.
1 /*
2  * SPDX-FileCopyrightText: 2021 ML!PA Consulting GmbH
3  * SPDX-License-Identifier: LGPL-2.1-only
4  */
5 
6 #pragma once
7 
44 #include "net/sock/tcp.h"
45 
46 #ifdef __cplusplus
47 extern "C" {
48 #endif
49 
53 #ifndef CONFIG_TELNET_PORT
54 #define CONFIG_TELNET_PORT (23)
55 #endif
56 
63 
72 ssize_t telnet_server_write(const void* buffer, size_t len);
73 
82 int telnet_server_read(void* buffer, size_t count);
83 
91 
100 
109 
114 
115 #ifdef __cplusplus
116 }
117 #endif
118 
void telnet_cb_pre_connected(sock_tcp_t *sock)
Callback function that gets called when a telnet client connects but before stdio is redirected.
int telnet_server_read(void *buffer, size_t count)
Read data from the telnet client, will block until data is available.
void telnet_server_disconnect(void)
Request to disconnect the current client.
void telnet_cb_connected(sock_tcp_t *sock)
Callback function that gets called when a telnet client connects after stdio is redirected.
int telnet_server_start(void)
Start the Telnet server thread.
ssize_t telnet_server_write(const void *buffer, size_t len)
Write data to the telnet client.
void telnet_cb_disconneced(void)
Callback function that gets called after a telnet client disconnected.
TCP sock definitions.
TCP sock type.
Definition: sock_types.h:101