MityDSP Documentation Index

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_connects The 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:
params The 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:
telnetconn The telnet connection to close.
str The 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:
telnetconn The telnet connection to close.
c The 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:
telnetconn The telnet connection to use.
cmd The command to send. (TELNET_CMD_DO, TELNET_CMD_WILL,...)
option The 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:
telnetconn The 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 Wed Mar 28 15:14:01 2012 for MityDSP Net by  Doxygen Version 1.6.1
Copyright © 2009, Critical Link LLC, All rights reserved.