TELNET SERVER
Since the CP/CMS system operates with EBCDIC codes, ASCII codes must be translated into EBCDIC before being sent to a virtual machine. Figure 1 gives the ASCII codes and their EBCDIC mapping. When the ASCII sequence CR-LF is received, it is mapped into the EBCDIC code NL. Whenever the TELNET control NOP is included in an input string, it is mapped into an EBCDIC idle (X'17') and then removed from the string. Thus, if TELNET NOP codes are included between a CR and LF, they are removed before the CR-LF is mapped into the EBCDIC NL.
The TELNET control hide-your-input is mapped into the EBCDIC code for bypass (X'24') and the TELNET control echo is mapped into the EBCDIC control for restore (X'14'). If the TELNET control echo is received, the SERVER should send the control noecho but this feature has not yet been implemented. Instead, the TELNET control echo is mapped into the EBCDIC code X'23'. If the TELNET break is received, it is interpreted as an attention signal and the appropriate action is taken by CP or CMS.
CP/CMS is a line at a time system and expects all input to consist of lines ending with a NL code. Characters received are buffered until the newline code is received.
Since CP/CMS is also a half duplex system, characters are only examined when the system is expecting input. If the system is not expecting input, a network interrupt is required to cause the SERVER to process received characters. On receipt of a network interrupt, characters received before the TELNET data mark is received are examined and discarded, except that if a TELNET break code is found, the appropriate CP/CMS interrupt action is stimulated.
On output, EBCDIC codes are mapped into network ASCII if a mapping exists; otherwise, the codes are mapped into the TELNET control NOP. A NL code is mapped into CR-LF. The EBCDIC code for bypass maps into the TELNET control hide-your-input and the EBCDIC code for restore maps into the TELNET control noecho. Also, the code X'23' maps into the TELNET control echo and the code X'38' maps into the TELNET control break.
Since CP/CMS is a line at a time, half duplex system the TELNET control break is transmitted as an end of message signal and also as an input prompt code. If characters were output without a NL, the break, as an end of message code, indicates to the user TELNET operating on a line at a time mode that the characters previously transmitted should be printed without waiting for the end of line sequence. If the user TELNET is also operating in a half duplex mode, the break as an input prompt indicates that the system is ready for input.
If input had been anticipated and sent by a full duplex user TELNET, the TELNET SERVER will have that input available for immediate processing. Thus, in the case of a full duplex user TELNET the break as a prompt should be ignored.
Though CP/CMS operates in a half duplex mode, it supports half duplex terminals with the reverse break feature allowing the system to abort an input mode in order to transmit a priority output message. In this situation, the TELNET SERVER transmits a TELNET SYNC. A half duplex user TELNET should interpret this by aborting the input mode, i.e., revoking a previous TELNET break which was interpreted as an input prompt.
No codes in the output character stream can cause the TELNET data mark to be transmitted.