telnet.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2021 ML!PA Consulting GmbH
3  *
4  * This file is subject to the terms and conditions of the GNU Lesser
5  * General Public License v2.1. See the file LICENSE in the top level
6  * directory for more details.
7  */
8 
44 #ifndef NET_TELNET_H
45 #define NET_TELNET_H
46 
47 #include "net/sock/tcp.h"
48 
49 #ifdef __cplusplus
50 extern "C" {
51 #endif
52 
56 #ifndef CONFIG_TELNET_PORT
57 #define CONFIG_TELNET_PORT (23)
58 #endif
59 
66 
75 ssize_t telnet_server_write(const void* buffer, size_t len);
76 
85 int telnet_server_read(void* buffer, size_t count);
86 
94 
103 
112 
117 
118 #ifdef __cplusplus
119 }
120 #endif
121 
122 #endif /* NET_TELNET_H */
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