📄 rfc1116.txt
字号:
SLC_CANTCHANGE, then this is a function that is supported, but the value for this function, specified in the third octet, cannot be changed. If the SLC_LEVELBITS in the second octet are equal to SLC_NOSUPPORT, then this particular function is not supported and should be disabled by the other side. If this is a response to a previous request to change a special character, and we are agreeing to the change, then the SLC_ACK bit must be set in the second octet. If the SLC_FLUSHIN bit is set in the second octet, then whenever this function is sent, a Telnet "sync" should be sent at the same time to flush the input stream. If the SLC_FLUSHOUT bit is set in the second octet, then whenever this function is sent, output data should be flushed. Only the client may send an octet triplet with the first octet equal to zero. In this case, the SLC_LEVELBITS may only be set to SLC_DEFAULT or SLC_VALUE, and the third octet does not matter. When the server receives 0 SLC_DEFAULT 0, it should switch to its system default special character settings, and send all those special characters to the client. When the server receives 0 SLC_VALUE 0, it should just send its current special character settings. Note that if the server does not support some of the editing functions, they should be sent as XXX SLC_DEFAULT 0, rather than as XXX SLC_NOSUPPORT 0, so that the client may choose to use its own values for those functions, rather than have to disable those functions even if it supports them. If any of the octets in the list of octet triplets is equal to IAC, it must be sent as a double IAC. When a connection is established, it is the responsibility of the client to either request the remote default values for the special characters, or to send across what all the special characters should be set to.Telnet Linemode Working Group [Page 6]RFC 1116 Telnet Linemode Option August 1989 The function values can be put into two groups; functions that are to be translated to their Telnet equivalents before being sent across the Telnet connection, and functions that are to be recognized and processed locally. First, we have those characters that are to be mapped into their Telnet equivalents: SLC_SYNCH Synch. See RFC 854, "TELNET PROTOCOL SPECIFICATION", for a complete description. SLC_BRK Break. See RFC 854, "TELNET PROTOCOL SPECIFICATION", for a complete description. SLC_IP Interrupt Process. See RFC 854, "TELNET PROTOCOL SPECIFICATION", for a complete description. SLC_AO Abort Output. See RFC 854, "TELNET PROTOCOL SPECIFICATION", for a complete description. SLC_AYT Are You There. See RFC 854, "TELNET PROTOCOL SPECIFICATION", for a complete description. SLC_EOR End of Record. See RFC 885, "TELNET END OF RECORD OPTION" for a complete description. SLC_ABORT Abort. See section 2.5 for a complete description. SLC_EOF End of File. See section 2.5 for a complete description. SLC_SUSP Suspend. See section 2.5 for a complete description. Next, we have the locally interpreted functions: SLC_EC Erase Character. This is the character that is typed to erase one character from the input stream. See RFC 854, "TELNET PROTOCOL SPECIFICATION", for a complete description. SLC_EL Erase Line. This is the character that is typed to erase the entire contents of the current line of input. See RFC 854, "TELNET PROTOCOL SPECIFICATION", for a complete description. SLC_EW Erase Word. This is the character that is typed to erase one word from the input stream. When backing up in the input stream, a word is definedTelnet Linemode Working Group [Page 7]RFC 1116 Telnet Linemode Option August 1989 to be (optionally) whitespace (tab or space characters), and a string of characters up to, but not including, whitespace or line delimiters. SLC_RP Reprint Line. This is the character that is typed to cause the current line of input to be reprinted, leaving the cursor at the end of the line. SLC_LNEXT Literal Next. This is the character that is typed to indicate that the next character is to be taken literally, no character processing should be done with it, and if it is a special character that would normally get mapped into a Telnet option, that mapping should not be done. SLC_XON Start Output. This is the character that is sent to resume output to the users terminal. SLC_XOFF Stop Output. This is the character that is sent to stop output to the users terminal. SLC_FORW1 Forwarding character. This is a character that should cause all data currently being buffered, and this character, to be sent immediately. SLC_FORW2 Forwarding character. This is another character that is to be treated in the same manner as SLC_FORW1.2.5 New control characters IAC ABORT Abort. Similar to "IAC IP", but means only to abort or terminate the process to which the NVT is connected. (The Telnet spec says IP may "suspend, interrupt, abort or terminate" the process.) If a system does not have two methods of interrupting a process, then ABORT and IP should have the same effect. IAC SUSP Suspend the execution of the current process attached to the NVT in such a way that another process will take over control of the NVT, and the suspended process can be resumed at a later time. If the receiving system does not support this functionality, it should be ignored.Telnet Linemode Working Group [Page 8]RFC 1116 Telnet Linemode Option August 1989 IAC EOF End Of File. The recipient should notify the process connected to the NVT that an end of file has been reached. This is intended for systems that support the ability for the user to type in an EOF character at the keyboard.3. Default Specification The default specification for this option is: WONT LINEMODE DONT LINEMODE meaning there will not be any subnegotiation of the mode of the connection. If WILL LINEMODE is negotiated, the defaults are: IAC SB LINEMODE MODE 0 IAC SE IAC SB LINEMODE WONT FORWARDMASK IAC SE If DO LINEMODE is negotiated, the defaults are: IAC SB LINEMODE MODE 0 IAC SE IAC SB LINEMODE DONT FORWARDMASK IAC SE Character values for SLC default to SLC_NOSUPPORT.4. Motivation With increasing Telnet usage, it has become apparent that the ability to do command line processing on the local machine and send completed lines to the remote machine is a feature necesary in several environments. First, in the case of a connection over long delay equipment, it is very frustrating to the user to have the echoing of his data take several seconds. Second, some supercomputers, due to their nature, are not good at handling and processing single character input. For these machines, it is better to have the front end computer do the character processing, and leave the supercomputer's cycles available for doing vectorized number crunching. There have been attempts to make local line editing work within the existing Telnet specs. Indeed, the 4.3 BSD tape includes a version of Telnet that attempts to do this through recognition of the state of the ECHO and SUPRESS-GO-AHEAD options; other implementations do this recognition purely through the ECHO option.Telnet Linemode Working Group [Page 9]RFC 1116 Telnet Linemode Option August 1989 There are problems with both of these methods. Using just the ECHO provides no mechanism to have ECHO to the user turned off, and leave local character processing on, for example, when a user is typing a password. The usage of the SUPRESS-GO-AHEAD comes from reading into RFC 858, where it states: "In many TELNET implementations it will be desirable to couple the SUPRESS-GO-AHEAD option to the echo option so that when the echo option is in effect, the SUPPRESS-GO-AHEAD option is in effect simultaneously: both of these options will normally have to be in effect simultaneously to effect what it commonly understood to be character at a time echoing by the remote computer." The reverse reading of this is that without the ECHO option or the SUPPRESS-GO-AHEAD option, you are in line at a time mode, implying local line editing. This has the obvious problem that that is not what the SUPPRESS-GO-AHEAD option is supposed to mean. Other shortcomings are that the Telnet specification is not rich enough to handle all of the special characters that some of the current operating systems support. For example, the ECHO/SGA implementation supports two ways of interrupting a process, by borrowing the BRK option for the second interrupt. Some implementations have taken the EOR option to send an End-Of-File. Obviously, this is using things for which they were not intended, and the correct solution would be to define new options. Another problem is that some implementations of line mode buffer up the input until the end of the line, and then send the whole line across, editing characters and all. No local editing of the line has been done. After examining several implementations, it has become clear that the correct thing to do is to implement new options to enhance the current Telnet specification so that it can support local line editing in a reasonable, reliable, and consistent manner. There are three states that are of interest: 1) Local line editing and local signal trapping 2) Remote line editing, local signal trapping 3) Remote line editing, remote signal trapping The case of local line editing and remote signal trapping is not aTelnet Linemode Working Group [Page 10]RFC 1116 Telnet Linemode Option August 1989 very interesting case, because you don't recognize the signals, and cannot send them to the remote side for it to recognize until the line has been completed. Also, special signals usually will have an effect on the line editing function, and if they are not being trapped locally the desired action will not happen. Local line editing means that all normal command line character processing, like "Erase Character" and "Erase Line", happen on the local system, and only when "CR LF" (or some other special character) is encountered is the edited data sent to the remote system. Signal trapping means, for example, that if the user types the character associated with the IP function, then the "IAC IP" function is sent to the remote side instead of the character typed. Remote signal trapping means, for example, that if the user types the character associated with the IP function, then the "IAC IP" function is not sent to the remote side, but rather the actual character typed is sent to the remote side.5. Implementation Rules It is expected that any implementation that supports the Telnet LINEMODE option will support all of this specification.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -