1 / 7

Telnet Server API

Telnet Server API. Setting up the Server Callback Functions Setting Server and Client Options Other Telnet API Functions. Integrating a Telnet Server. Application Entry. TSInitServer(TS_ICONFIG_TYPE *ptr ). TSOpenPort(unsigned long *port , TS_UCONFIG_TYPE * ptr ).

kira
Download Presentation

Telnet Server API

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  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: • Number of ports to Listen on • 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

  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

More Related