MityDSP Documentation Index

e:/hudson/workspace/MityDSP MDK Release/trunk/sw/inc/net/telnetd/telnetd.h File Reference

#include <net/DSPNetStack.h>

Classes

struct  tsTelnetConn
struct  _tsTelnetdParams
class  tcTelnetd

Typedefs

typedef int(* tfTelnetConnect )(tsTelnetConn *telnetconn)
typedef int(* tfTelnetChkUser )(tsTelnetConn *telnetconn, const char *user)
typedef int(* tfTelnetChkPswd )(tsTelnetConn *telnetconn, const char *pswd)
typedef void(* tfTelnetClose )(tsTelnetConn *telnetconn)
typedef int(* tfTelnetInChar )(tsTelnetConn *telnetconn, char c)
typedef bool(* tfTelnetHandleOption )(tsTelnetConn *telnetconn, unsigned char cmd, unsigned char opt)
typedef bool(* tfTelnetHandleCmd )(tsTelnetConn *telnetconn, unsigned char cmd)
typedef bool(* tfTelnetHandleSubNeg )(tsTelnetConn *telnetconn, unsigned char *NegStream, int StreamLen)
typedef struct _tsTelnetdParams tsTelnetdParams

Variables

const int TELNET_SOCKET_CLOSE_ERR = -1
const int TELNET_MAX_USERNAME_LEN = 30
const int TELNET_MAX_PASSWORD_LEN = 30
const unsigned char TELNET_CMD_IAC = 255
const unsigned char TELNET_CMD_SE = 240
const unsigned char TELNET_CMD_NOP = 241
const unsigned char TELNET_CMD_DATAMARK = 242
const unsigned char TELNET_CMD_BREAK = 243
const unsigned char TELNET_CMD_IP = 244
const unsigned char TELNET_CMD_AO = 245
const unsigned char TELNET_CMD_AYT = 246
const unsigned char TELNET_CMD_EC = 247
const unsigned char TELNET_CMD_EL = 248
const unsigned char TELNET_CMD_GA = 249
const unsigned char TELNET_CMD_SB = 250
const unsigned char TELNET_CMD_WILL = 251
const unsigned char TELNET_CMD_WONT = 252
const unsigned char TELNET_CMD_DO = 253
const unsigned char TELNET_CMD_DONT = 254
const unsigned char TELNET_OPTION_ECHO = 1
const unsigned char TELNET_OPTION_SUPPRESSGA = 3
const unsigned char TELNET_OPTION_AUTHENTICATION = 37

Typedef Documentation

typedef int(* tfTelnetConnect)(tsTelnetConn *telnetconn)

This application supplied callback function is called each time a telnet client connects to the telnet server. This function MUST be specified in tsTelnetdParams::connect_func field passed to tcTelnetd::run().

Parameters:
telnetconn The connection structure for the new connection. Typically your application would set the tsTelnetConn::user2 field during execution of this callback if you have application specific data which you will reference in the future.
Returns:
0 to accept the connection, -1 to reject the connection.
Attention:
This function is called before user and password verification.
typedef int(* tfTelnetChkUser)(tsTelnetConn *telnetconn, const char *user)

This application supplied callback function is called each time a telnet client enters a username during connection login. This function may optionally be specified in tsTelnetdParams::chk_user_func field passed to tcTelnetd::run(). If the tsTelnetdParams::chk_user_func field is set to NULL, then no user name verification will be performed.

Parameters:
telnetconn The connection structure for the connection.
user The user name from the telnet client.
Returns:
0 to accept the user name, -1 to reject the user name.
typedef int(* tfTelnetChkPswd)(tsTelnetConn *telnetconn, const char *pswd)

This application supplied callback function is called each time a telnet client enters a password during connection login. This function may optionally be specified in tsTelnetdParams::chk_pswd_func field passed to tcTelnetd::run(). If the tsTelnetdParams::chk_pswd_func field is set to NULL, then no password verification will be performed.

Parameters:
telnetconn The connection structure for the connection.
password The password from the telnet client.
Returns:
0 to accept the password, -1 to reject the password.
typedef void(* tfTelnetClose)(tsTelnetConn *telnetconn)

This application supplied callback function is called each time a telnet connection is closed. This function may optionally be specified in tsTelnetdParams::close_func field passed to tcTelnetd::run(). If the tsTelnetdParams::close_func field is set to NULL, then no close notification will be generated.

Parameters:
telnetconn The connection structure for the connection.
typedef int(* tfTelnetInChar)(tsTelnetConn *telnetconn, char c)

This application supplied callback function is called each time a telnet client sends a character. This function MUST be specified in tsTelnetdParams::in_char_func field passed to tcTelnetd::run().

Parameters:
telnetconn The connection structure for the connection.
Returns:
0 unless the connection has been closed in which case a -1 should be returned to abort processing of any further pending characters.
typedef bool(* tfTelnetHandleOption)(tsTelnetConn *telnetconn, unsigned char cmd, unsigned char opt)

This application supplied callback function is called whenever an RFC 854 Option Request is received.

Parameters:
telnetconn The connection structure for the connection.
cmd command option (WILL, WONT, DO, DONT)
option code requested
Returns:
true if the option is handled, false it not
typedef bool(* tfTelnetHandleCmd)(tsTelnetConn *telnetconn, unsigned char cmd)

This application supplied callback function is called whenever an RFC 854 Command is received

Parameters:
telnetconn The connection structure for the connection.
cmd command (NOP, DM, BRK, IP, AO, AYT, EC, EL, GA)
Returns:
true if the option is handled
typedef bool(* tfTelnetHandleSubNeg)(tsTelnetConn *telnetconn, unsigned char *NegStream, int StreamLen)

This application supplied callback function is called whenever an RFC 854 Subnegotiation sequence is received.

Parameters:
telnetconn The connection structure for the connection.
NegStream negotiation stream (without SB or SE character)
StreamLen length of negotiation stream
Returns:
true if the option is handled successfully

This structure specifies the application callback functions which the telnet server will call during execution. You will also specify the tsTelnetConn::user1 parameter which you may access during callback function execution.

See also:
tcTelnetd::run

Variable Documentation

const int TELNET_SOCKET_CLOSE_ERR = -1

Error returned when a connection is closed

const int TELNET_MAX_USERNAME_LEN = 30

Maximum length of a user name.

const int TELNET_MAX_PASSWORD_LEN = 30

Maximum length of a password.

const unsigned char TELNET_CMD_IAC = 255

Interpret as Command

const unsigned char TELNET_CMD_SE = 240

end of subnegotiation parameters

const unsigned char TELNET_CMD_NOP = 241

no operation

const unsigned char TELNET_CMD_DATAMARK = 242

Data Stream Portion of a Sync.

const unsigned char TELNET_CMD_BREAK = 243

NVT character BRK

const unsigned char TELNET_CMD_IP = 244

Interrupt Process

const unsigned char TELNET_CMD_AO = 245

Abort Output

const unsigned char TELNET_CMD_AYT = 246

Are you there?

const unsigned char TELNET_CMD_EC = 247

Ethernet Character

const unsigned char TELNET_CMD_EL = 248

Erase Line

const unsigned char TELNET_CMD_GA = 249

Go Ahead

const unsigned char TELNET_CMD_SB = 250

Subnegotiation parameters begin

const unsigned char TELNET_CMD_WILL = 251

Desire to begin, or confirmation that now performing option

const unsigned char TELNET_CMD_WONT = 252

refusal to perform option

const unsigned char TELNET_CMD_DO = 253

request remote side to perform, or confirm expectation of performing option

const unsigned char TELNET_CMD_DONT = 254

request side to stop performing option

const unsigned char TELNET_OPTION_ECHO = 1

telnet option parameter, local echo, RFC857

const unsigned char TELNET_OPTION_SUPPRESSGA = 3

telnet option parameter, suppress go-ahead, RFC858

const unsigned char TELNET_OPTION_AUTHENTICATION = 37

  
Generated on Wed Mar 17 18:24:38 2010 for MityDSP Net by  Doxygen Version 1.6.1
Copyright © 2009, Critical Link LLC, All rights reserved.