All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
Loading...
Searching...
No Matches
basic Telnet server implementation

Telnet server functions More...

Detailed Description

Telnet server functions

Files

file  telnet.h
 minimal Telnet server (RFC 854) implementation
 

Macros

#define CONFIG_TELNET_PORT   (23)
 The port for the Telnet server to listen on.
 

Functions

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.
 
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_pre_connected (sock_tcp_t *sock)
 Callback function that gets called when a telnet client connects but before stdio is redirected.
 
void telnet_cb_connected (sock_tcp_t *sock)
 Callback function that gets called when a telnet client connects after stdio is redirected.
 
void telnet_cb_disconneced (void)
 Callback function that gets called after a telnet client disconnected.
 

Macro Definition Documentation

◆ CONFIG_TELNET_PORT

#define CONFIG_TELNET_PORT   (23)

The port for the Telnet server to listen on.

Definition at line 57 of file telnet.h.

Function Documentation

◆ telnet_cb_connected()

void telnet_cb_connected ( sock_tcp_t * sock)

Callback function that gets called when a telnet client connects after stdio is redirected.

Parameters
[in]sockSocket of the client that just connected only use with sock_tcp_get_local

◆ telnet_cb_pre_connected()

void telnet_cb_pre_connected ( sock_tcp_t * sock)

Callback function that gets called when a telnet client connects but before stdio is redirected.

Parameters
[in]sockSocket of the client that just connected only use with sock_tcp_get_local

◆ telnet_server_disconnect()

void telnet_server_disconnect ( void )

Request to disconnect the current client.

     This only sets the disconnect request flag, so it's safe to call
     this from interrupt context.

◆ telnet_server_read()

int telnet_server_read ( void * buffer,
size_t count )

Read data from the telnet client, will block until data is available.

Parameters
[out]bufferThe buffer to write data from the client
[in]countNumber of bytes to read
Returns
number of bytes read, error otherwise

◆ telnet_server_start()

int telnet_server_start ( void )

Start the Telnet server thread.

Returns
0 on success, error otherwise

◆ telnet_server_write()

ssize_t telnet_server_write ( const void * buffer,
size_t len )

Write data to the telnet client.

Parameters
[in]bufferThe buffer to send to the client
[in]lenThe length of the buffer
Returns
0 on success, error otherwise