rfc1184.txt
来自「RFC 的详细文档!」· 文本 代码 · 共 1,291 行 · 第 1/4 页
TXT
1,291 行
Network Working Group Telnet Working Group
Request for Comments: 1184 D. Borman, Editor
Obsoletes: RFC 1116 Cray Research, Inc.
October 1990
Telnet Linemode Option
Status of this Memo
This memo describes a Draft Standard for the Internet community, and
requests discussion and suggestions for improvements. This RFC
specifies an IAB standards track protocol for the Internet community.
Please refer to the current edition of the "IAB Official Protocol
Standards" for the standardization state and status of this protocol.
Distribution of this memo is unlimited.
Changes from RFC1116:
Two new mode bits have been added, SOFT_TAB and LIT_ECHO. These
bits allow the server to give the client some advise on how to
echo tabs and non-printable characters.
Several new special character mappings have been added for cursor
motion when visual editing is supported. These are: Move cursor
one character left/right (SLC_MCL/SLC_MCR), move cursor one word
left/right (SLC_MCWL/SLC_MCWR), move cursor to begining/end of
line (SLC_MCBOL/SLC_MCEOL), enter insert/overstrike mode
(SLC_INSRT/SLC_OVER), erase one character/word to the right
(SLC_ECR/SLC_EWR), and erase to the beginning/end of the line
(SLC_EBOL/SLC_EEOL).
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. Please send comments to the telnet-ietf@cray.com
mailing list.
Telnet Working Group [Page 1]
RFC 1184 Telnet Linemode Option October 1990
Table of Contents
1. Command Names and Codes 2
2. Command Meanings 3
2.1 The LINEMODE function 3
2.2 LINEMODE suboption MODE 4
2.3 LINEMODE suboption FORWARDMASK 5
2.4 LINEMODE suboption SLC, Set Local Characters 6
2.5 New control characters 10
3. Default Specification 11
4. Motivation 11
5. Implementation Rules 13
5.1 User Interface 13
5.2 End of line terminators 14
5.3 Output processing 14
5.4 A terminal driver in Telnet? 14
5.5 Setting of Local Characters 14
5.6 FORWARDMASK and SLC_FORW1 and SLC_FORW2 15
5.7 Valid and invalid modes and values 16
5.8 Flushing input and output 16
5.9 State diagram for SLC 18
5.10 Example of a connection 19
6. Other Telnet options and RFCs 22
7. Security Considerations 23
8. Author's Address 23
1. Command Names and Codes
LINEMODE 34
MODE 1
EDIT 1
TRAPSIG 2
MODE_ACK 4
SOFT_TAB 8
LIT_ECHO 16
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
Telnet Working Group [Page 2]
RFC 1184 Telnet Linemode Option October 1990
SLC_EW 12
SLC_RP 13
SLC_LNEXT 14
SLC_XON 15
SLC_XOFF 16
SLC_FORW1 17
SLC_FORW2 18
SLC_MCL 19
SLC_MCR 20
SLC_MCWL 21
SLC_MCWR 22
SLC_MCBOL 23
SLC_MCEOL 24
SLC_INSRT 25
SLC_OVER 26
SLC_ECR 27
SLC_EWR 28
SLC_EBOL 29
SLC_EEOL 30
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
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.
Telnet Working Group [Page 3]
RFC 1184 Telnet Linemode Option October 1990
IAC DO LINEMODE
The sender of this command REQUESTS that the remote side begin
sub-negotiation 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
sub-negotiation 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) 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
Telnet Working Group [Page 4]
RFC 1184 Telnet Linemode Option October 1990
user back to the user. When the server has negotiated
"WONT ECHO", the 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.
SOFT_TAB When set, the client side should expand the Horizontal
Tab (HT) code, USASCII 9, into the appropriate number of
spaces to move the printer to the next horizontal tab
stop. When unset, the client side should allow the
Horizontal Tab code to pass through un-modified.
LIT_ECHO When set, if the client side is echoing a non-printable
character that the user has typed to the users screen,
the character should be echoed as the literal character.
If the LIT_ECHO bit is not set, then the client side may
echo the character in any manner that it desires. (Many
systems echo unprintable characters as two character
sequences, for example, they will echo "^A" for an
ASCII 1 value.)
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
mask are received. Only the side of the connection that sent DO
LINEMODE (the server side) may negotiate this. The mask is up to
Telnet Working Group [Page 5]
RFC 1184 Telnet Linemode Option October 1990
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
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?