Jump to content
IGNORED

Coding Help Needed: TELNET IAC parser in C or C++


Recommended Posts

For anyone who can help. FujiNet needs to be able to support TELNET connections properly.

 

We need a library that fits into lib/ that can be jumped into when enabled, and when an $FF byte is received.

 

Once inside, it starts a state machine that parses IAC control code sequences, you can see some of these when you run a telnet client with option processing:

 

$ telnet.exe
telnet> set option on
Will show option processing.
telnet> open tnfs
Trying 192.168.1.12...
Connected to tnfs.
Escape character is '^]'.
SENT DO SUPPRESS GO AHEAD
SENT WILL TERMINAL TYPE
SENT WILL NAWS
SENT WILL TSPEED
SENT WILL LFLOW
SENT WILL LINEMODE
SENT WILL NEW-ENVIRON
SENT DO STATUS
RCVD DO TERMINAL TYPE
RCVD DO TSPEED
RCVD DO XDISPLOC
SENT WONT XDISPLOC
RCVD DO NEW-ENVIRON
RCVD WILL SUPPRESS GO AHEAD
RCVD DO NAWS
SENT IAC SB NAWS 0 173 (173) 0 52 (52)
RCVD DO LFLOW
RCVD DONT LINEMODE
RCVD WILL STATUS
RCVD IAC SB TERMINAL-SPEED SEND
SENT IAC SB TERMINAL-SPEED IS 38400,38400
RCVD IAC SB NEW-ENVIRON SEND
SENT IAC SB NEW-ENVIRON IS VAR "PRINTER" VALUE "Samsung CLP-510 (USB001)"
RCVD IAC SB TERMINAL-TYPE SEND
SENT IAC SB TERMINAL-TYPE IS "XTERM"
RCVD DO ECHO
SENT WONT ECHO
RCVD WILL ECHO
SENT DO ECHO
Raspbian GNU/Linux 10
tnfs login:
telnet> close
Connection closed.
telnet>

A complete explanation of TELNET IAC processing can be found here: 

http://mars.netanya.ac.il/~unesco/cdrom/booklet/HTML/NETWORKING/node300.html

 

-Thom

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...