Download presentation
Presentation is loading. Please wait.
Published byDaniella White Modified over 9 years ago
1
Telnet Server API Setting up the Server Callback Functions Setting Server and Client Options Other Telnet API Functions
2
Integrating a Telnet Server Application Entry TSInitServer(TS_ICONFIG_TYPE *ptr) TSOpenPort(unsigned long *port, TS_UCONFIG_TYPE *ptr) Structure that defines: Telnet Port Login retries Client and server options TS_ECHO,TS_BINARY, TS_NOGA Callbacks for connect, login, disconnect, receive and buffer management Structure that defines: Number of ports to Listen on
3
Sample Telnet Port Setup TS_UCONFIG_TYPE; Properties & Callbacks Setup Telnet Listener Using Above Properties
4
Callback functions int (*connect_callback) (unsigned int session_id) int (*login_callback) (unsigned int session_id, int user_id) int (*disconnect_callback) (unsigned int session_id) int (*getbuf_callback) (unsigned int session_id, void **buf, int *bufSize) int (*receive_callback) (unsigned int session_id, void *buf, int len)
5
Setting Server and Client Options int TSSetServerOption( unsigned long session_id, unsigned long option, int mode) int TSSetClientOption( unsigned long session_id, unsigned long option, int mode) mode – 0 off/1 on Option –TS_TXBINARY(xmit binary data) –TS_NOECHO(echo) –TS_NOGA (go-ahead characters) –TS_CAMOUFLAGE (server only – “camouflage” password) (Note: “session_id” comes from connect or logon callback)
6
Other Telnet API Functions int TSClosePort (unsigned long port_id) int TSSendData (unsigned long session_id, char *buf, int len) int TSSendString (unsigned long session_id, char *buf) int TSCloseSession (unsigned long session_id) char *TSGetSessionUserName (unsigned long session_id)
7
Telnet Server Summary Start with TSInitServer Perform TSOpenPort for each port –TS_UCONFIG_TYPE structure provides parameters (including callback addresses) on port-by-port basis Process client interaction via callbacks for connect, login, receive, disconnect and buffer acquisition Use TSSendData or TSSendString to transmit to client. Close session with TSCloseSession Close out port with TSClosePort
Similar presentations
© 2024 SlidePlayer.com. Inc.
All rights reserved.