MityDSP Documentation Index
Public Member Functions
tcTelnetd Class Reference

#include <lwip/telnetd/telnetd.h>

List of all members.

Public Member Functions

 tcTelnetd (int max_connects)
int run (tsTelnetdParams *params)
int send_str (tsTelnetConn *telnetconn, const char *str)
int send_char (tsTelnetConn *telnetconn, char c)
int send_option (tsTelnetConn *telnetconn, unsigned char cmd, unsigned char option)
void close_conn (tsTelnetConn *telnetconn)
int get_max_connects ()

Detailed Description

This class is the MityDSP telnet server. Your application will create one tcTelnetd object to handle all of the telnet requests received from clients.


Constructor & Destructor Documentation

tcTelnetd::tcTelnetd ( int  max_connects)

This constructor creates the telnet server.

Parameters:
max_connectsThe maximum number of simultaneous telnet connections which the server will allow.
Note:
The server will not start running until you call the function tcTelnetd::run.

Member Function Documentation

int tcTelnetd::run ( tsTelnetdParams params)

This function starts the telnet server. At this point the tsTelnetdParams::user1 parameter and the application callbacks are specified to the tcTelnetd object.

Parameters:
paramsThe telnet server parameters.
Returns:
0 if successful, -1 if error.
Note:
This function will not return unless an initialization error occurs. Initialization errors will be recorded in human readable format to the debugger trace log.
int tcTelnetd::send_str ( tsTelnetConn telnetconn,
const char *  str 
)

This function sends the specified string to the telnet client associated with the specified telnet connection. Typically an application's shell will call this function in response to a command. You might also call this function in to send debug or log messages to the telnet client.

Parameters:
telnetconnThe telnet connection to close.
strThe zero terminated string to send.
Returns:
0 if successful, TELNET_SOCKET_CLOSE_ERR if the connection is closed.
See also:
tcTelnetd::send_char
int tcTelnetd::send_char ( tsTelnetConn telnetconn,
char  c 
)

This function sends the specified character to the telnet client associated with the specified telnet connection. Typically an application's shell will call this function to echo characters back to the client if the connection echo flag is set.

Parameters:
telnetconnThe telnet connection to close.
cThe character to send.
Returns:
0 if successful, TELNET_SOCKET_CLOSE_ERR if the connection is closed.
See also:
tcTelnetd::send_str
int tcTelnetd::send_option ( tsTelnetConn telnetconn,
unsigned char  cmd,
unsigned char  option 
)

This function sends the specified option command to the telnet client associated with the specified telnet connection.

Parameters:
telnetconnThe telnet connection to use.
cmdThe command to send. (TELNET_CMD_DO, TELNET_CMD_WILL,...)
optionThe option to send. (TELNET_OPTION_ECHO,...)
Returns:
0 if successful, TELNET_SOCKET_CLOSE_ERR if the connection is closed.
void tcTelnetd::close_conn ( tsTelnetConn telnetconn)

This function closes a telnet connection. You can call this function to close a telnet connection. Typically an application's shell will call this function in response to a command such as "logout", "exit", etc..

Parameters:
telnetconnThe telnet connection to close.
Note:
This function will invoke a callback to your applications tfTelnetClose callback function.
int tcTelnetd::get_max_connects ( )
inline

This function returns the maximum number of connections allowed by the telnet server.

Returns:
The maximum number of connections supported.

  
Generated on Mon Apr 22 2013 11:33:33 for MityDSP Net by  Doxygen Version 1.8.1.1
Copyright © 2009, Critical Link LLC, All rights reserved.