rfc1116.txt
来自「RFC 的详细文档!」· 文本 代码 · 共 1,179 行 · 第 1/4 页
TXT
1,179 行
Network Working Group Internet Engineering Task Force
Request for Comments: 1116 Telnet Linemode Working Group
D. Borman, Editor
Cray Research, Inc.
August 1989
Telnet Linemode Option
Status of this Memo
This RFC describes a proposed elective standard for the Internet
community. Hosts on the Internet that support Linemode within the
Telnet protocol are expected to adopt and implement this standard.
Distribution of this memo is unlimited.
Overview
Linemode Telnet is a way of doing terminal character processing on
the client side of a Telnet connection. While in Linemode with
editing enabled for the local side, network traffic is reduced to a
couple of packets per command line, rather than a couple of packets
per character typed. This is very useful for long delay networks,
because the user has local response time while typing the command
line, and only incurs the network delays after the command is typed.
It is also useful to reduce costs on networks that charge on a per
packet basis.
Table of Contents
1. Command Names and Codes 2
2. Command Meanings 3
2.1 The LINEMODE function 3
2.2 LINEMODE suboption MODE 3
2.3 LINEMODE suboption FORWARDMASK 4
2.4 LINEMODE suboption SLC, Set Local Characters 5
2.5 New control characters 8
3. Default Specification 9
4. Motivation 9
5. Implementation Rules 11
5.1 User Interface 11
5.2 End of line terminators 12
5.3 Output processing 12
5.4 A terminal driver in Telnet? 12
5.5 Setting of Local Characters 12
5.6 FORWARDMASK and SLC_FORW1 and SLC_FORW2 13
5.7 Valid and invalid modes and values. 14
5.8 Flushing input and output 14
Telnet Linemode Working Group [Page 1]
RFC 1116 Telnet Linemode Option August 1989
5.9 State diagram for SLC 16
5.10 Example of a connection 17
6. Other Telnet options and RFCs 20
1. Command Names and Codes
LINEMODE 34
MODE 1
EDIT 1
TRAPSIG 2
MODE_ACK 4
FORWARDMASK 2
SLC 3
SLC_SYNCH 1
SLC_BRK 2
SLC_IP 3
SLC_AO 4
SLC_AYT 5
SLC_EOR 6
SLC_ABORT 7
SLC_EOF 8
SLC_SUSP 9
SLC_EC 10
SLC_EL 11
SLC_EW 12
SLC_RP 13
SLC_LNEXT 14
SLC_XON 15
SLC_XOFF 16
SLC_FORW1 17
SLC_FORW2 18
SLC_DEFAULT 3
SLC_VALUE 2
SLC_CANTCHANGE 1
SLC_NOSUPPORT 0
SLC_LEVELBITS 3
SLC_ACK 128
SLC_FLUSHIN 64
SLC_FLUSHOUT 32
EOF 236
SUSP 237
ABORT 238
Telnet Linemode Working Group [Page 2]
RFC 1116 Telnet Linemode Option August 1989
2. Command Meanings
2.1 The LINEMODE function
IAC WILL LINEMODE
The sender of this command REQUESTS permission to begin sub-
negotiation of the editing/signaling status. This should only be
sent by the client side of the connection.
IAC WONT LINEMODE
The sender of this command DEMANDS that sub-negotiation of the
editing/signaling status not be allowed.
IAC DO LINEMODE
The sender of this command REQUESTS that the remote side begin
subnegotiation of the editing/signaling status. This should only
be sent by the server side of the connection.
IAC DONT LINEMODE
The sender of this command DEMANDS that the remote side not begin
subnegotiation of the editing/signaling status.
2.2 LINEMODE suboption MODE
IAC SB LINEMODE MODE mask IAC SE
The sender of this command CONFIRMS, or REQUESTS permission for, a
switch to the mode defined by "mask".
The "mask" is a bit mask of various modes that the connection can be
in. Under normal operation, the server side of the connection will
initiate mode changes, and the client will confirm the mode changes.
The currently defined modes are:
EDIT When set, the client side of the connection should
process all input lines, performing any editing
functions, and only send completed lines to the remote
side. When unset, client side should not process any
input from the user, and the server side should take
care of all character processing that needs to be done.
TRAPSIG When set, the client side should translate appropriate
interrupts/signals to their Telnet equivalent.
(These would be IP, BRK, AYT, ABORT, EOF, and SUSP.)
Telnet Linemode Working Group [Page 3]
RFC 1116 Telnet Linemode Option August 1989
When unset, the client should pass interrupts/signals
as their normal ASCII values.
FLOW Logically, this belongs in the "mask". However,
this would overlap the Telnet TOGGLE-FLOW-CONTROL
option, so the Telnet TOGGLE-FLOW-CONTROL option is
used instead. When DO/WILL LINEMODE is negotiated,
DO/WILL TOGGLE-FLOW-CONTROL should also be negotiated.
See RFC 1080, "Telnet Remote Flow Control", for
correct usage.
ECHO Logically, this belongs in the "mask". However,
this would overlap the Telnet ECHO option, so the
Telnet ECHO option is used instead. The client side
should never negotiate "WILL ECHO". When the server
has negotiated "WILL ECHO", the client should not
echo data typed by the user back to the user. When
the server has negotiated "WONT ECHO", the client is
responsible for echoing data typed by the user back
to the user. See RFC 857, "Telnet ECHO OPTION" for
a complete discussion on the use of the Telnet ECHO
option.
When the client side of a connection receives a MODE command, it MUST
agree with at least the state of the EDIT and TRAPSIG bits. If a
MODE command is received with a mode mask that is currently in use
(ignoring the MODE_ACK bit), the MODE command is ignored. If a MODE
command is received that is different from the current mode mask,
then a reply is sent with either the new mode mask and the MODE_ACK
bit set, or a subset of the new mode mask. The only exception is
that if the server receives a MODE with either the EDIT or TRAPSIG
bits not set, it may set the EDIT and TRAPSIG bits in the response,
and if the client receives a MODE with the EDIT or TRAPSIG bits set,
it may not clear them in the response.
When a MODE command is received with the MODE_ACK bit set, and the
mode is different that what the current mode is, the client will
ignore the new mode, and the server will switch to the new mode.
This ensures that both sides of the connection will resolve to the
same mode. In all cases, a response is never generated to a MODE
command that has the MODE_ACK bit set.
2.3 LINEMODE suboption FORWARDMASK
IAC SB LINEMODE DO FORWARDMASK mask0 mask1 ... mask31 IAC SE
The sender of this command request that the other side send any
buffered data when any of the ASCII characters defined by the bit
Telnet Linemode Working Group [Page 4]
RFC 1116 Telnet Linemode Option August 1989
mask are received. Only the side of the connection that sent DO
LINEMODE (the server side) may negotiate this. The mask is up to
32 octets long. Each octet represents 8 ASCII character codes.
The high order bit of mask0 corresponds to an ASCII code of 0.
The low order bit of mask0 corresponds to an ASCII code of 7. The
high order bit of mask1 corresponds to an ASCII code of 8. The
low order bit of mask1 corresponds to an ASCII code of 15, and so
on. The mask list may be terminated before the end of the list,
in which case all the rest of the mask octets are assumed to be
reset (equal to zero). When the server side is in DONT TRANSMIT-
BINARY mode, then only the first 16 octets of the mask (ASCII
codes 0 through 127) are used. If any individual octet of the
mask is equal to IAC, it must be sent as a double IAC.
IAC SB LINEMODE DONT FORWARDMASK IAC SE
The sender of this command requests that the other side stop using
the forward mask to determine when to send buffered data.
IAC SB LINEMODE WILL FORWARDMASK IAC SE
This command is sent in response to a DO FORWARDMASK command. It
indicates that the forward mask will be used to determine when to
send buffered data.
IAC SB LINEMODE WONT FORWARDMASK IAC SE
This command is sent in response to a DO FORWARDMASK command. It
indicates that the forward mask will not be used to determine when
to send buffered data.
2.4 LINEMODE suboption SLC, Set Local Characters
The SLC suboption uses a list of octet triplets. The first octet
specifies the function, the second octet specifies modifiers to the
function, and the third octet specifies the ASCII character for the
function.
IAC SB LINEMODE SLC <list of octet triplets> IAC SE
The sender of this command REQUESTS that the list of octet
triplets be used to set the local character to be used to send to
perform the specified function.
There are four levels that a function may be set to.
SLC_NOSUPPORT is the lowest, SLC_CANTCHANGE is the next higher
level, SLC_VALUE is above that, and SLC_DEFAULT is the highest
level.
Telnet Linemode Working Group [Page 5]
RFC 1116 Telnet Linemode Option August 1989
If the SLC_LEVELBITS in the second octet are equal to SLC_DEFAULT,
then this particular function should use the system default on the
other side of the connection.
If the SLC_LEVELBITS in the second octet are equal to SLC_VALUE,
then this function is supported, and the current value is
specified by the third octet.
If the SLC_LEVELBITS in the second octet are equal to
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?