Embedded TCP/IP stack  3.9.3
TELNET server API

FNET Telnet Server API. More...

Detailed Description

FNET Telnet Server API.

The Telnet server provides a simple command-line interface for a remote host via a virtual terminal connection.
Current version of the Telnet server supports maximum of one simultaneously connected Telnet client.

After the FNET Telnet server is initialized by calling the fnet_telnet_init() function, the user application should call the main service polling function fnet_poll_service() periodically in background.
For example:

...
const struct fnet_shell fapp_telnet_shell =
{
fapp_telnet_cmd_table,
(sizeof(fapp_telnet_cmd_table) / sizeof(struct fnet_shell_command)),
"TELNET>",
fapp_shell_init,
};
...
void main()
{
struct fnet_telnet_params params;
...
params.ip_address = FNET_HTONL(INADDR_ANY);
params.port = FNET_HTONS(0); //Default port number.
params.shell= &fapp_telnet_shell;
params.cmd_line_buffer = fapp_telnet_cmd_line_buffer;
params.cmd_line_buffer_size = sizeof(fapp_telnet_cmd_line_buffer)
// Init Telnet server.
fapp_telnet_desc = fnet_telnet_init(&params);
if(fapp_telnet_desc)
{
fnet_printf("\n FNET Telnet server started.\n");
while(1)
{
// Do something.
...
}
}
else
{
fnet_printf("\n FNET Telnet server initialization is failed.\n");
}
}

For Telnet usage example, refer to FNET demo application source code.

Configuration parameters:

Data Structures

struct  fnet_telnet_params
 Input parameters for fnet_telnet_init(). More...
 

Typedefs

typedef void * fnet_telnet_desc_t
 Telnet server descriptor. More...
 

Functions

fnet_telnet_desc_t fnet_telnet_init (struct fnet_telnet_params *params)
 Initializes the Telnet Server service. More...
 
void fnet_telnet_release (fnet_telnet_desc_t desc)
 Releases the Telnet Server service. More...
 
void fnet_telnet_close_session (fnet_telnet_desc_t desc)
 Closes the currently active session of the Telnet Server. More...
 
fnet_bool_t fnet_telnet_is_enabled (fnet_telnet_desc_t desc)
 Detects if the Telnet Server service is enabled or disabled. More...
 

© 2005-2017 by Andrey Butok. http://fnet.sourceforge.net