附录:卸载 Telnet(第 3 部分)
2.3.5. 字符处置选项
从 H-FP 的角度看,回车处置(Carriage Return Disposition)选项、水平制表处置(Horizontal Tab Disposition)选项、换页处置(Formfeed Disposition)选项、垂直制表处置(Vertical Tab Disposition)选项和换行处置(Linefeed Disposition)选项都被视为字符处置选项。字符处置选项需要两个选项特有的参数。第一个是前面描述过的 DR 或 DS 代码。第二个是单个 ASCII 编码的数值,其解释如下(假定 Condition 命令由主机发出):
0 The Host requests that it handle the character
disposition for this connection.
1 to 250 The Host suggests that the remote end handle
the character disposition considerations, but
suggests that the value indicated should be
taken as the number of nulls which should be
inserted in the data stream following the
particular format character being
subnegotiated.
251 The Host suggests that the remote end handle
the character disposition considerations, but
recommends that it replace the character with
some simplified character similar to but not
identical with it (e.g., replace a tab with a
space, or a formfeed with a newline).
252 The Host suggests that the remote end handle
the character disposition considerations, but
recommends that it discard the character.
253 The Host suggests that the remote end handle
the character disposition, but recommends that
the effect of the character be simulated using
other characters such as spaces or linefeeds.
254 The Host suggests that the remote end handle
the character disposition considerations, but
recommends that it wait for additional data
before sending more data.
255 The Host suggests that the remote end handle
the tabstop considerations, and suggests
nothing about what the value should be.
在某些字符处置选项中,251 到 254 之间的部分代码并不使用。更多细节请参阅 ARPANET 文档。
如果 Condition 命令由 OPE 发出,则主机与远端的角色互换。
2.3.5.1. RCTE 选项
远程控制传输与回显(Remote Controlled Transmission and Echoing,RCTE)选项需要参数来指明中断字符集和传输字符集。RCTE 有两个选项特有的参数。第一个是构成中断字符集的字符类别列表,如 RCTE 文档所定义。第二个是构成传输字符集的字符类别列表,如 RCTE 文档所定义。由于这两个类别是可选的,且长度可以任意,所以每个列表前必须加上 -bc(中断字符)或 -tc(传输字符)。字符类别定义如下
1 Upper Case Letters A through Z
2 Lower Case Letters a through z
3 Digits 0 through 9
4 Format effectors <BS> <CR> <LF> <FF> <HT> <VT>
5 Non-format control codes, plus <ESC> and <DEL>
6 Punctuation . , ; : ? !
7 Grouping { [ ( < > ) ] }
8 Misc ' ` " / \ % @ $ & + - * = ^ _ | ~
9 <space>
2.3.5.2. 扩展选项列表
扩展选项列表(Extended Option List)选项需要一个参数来携带扩展列表上的选项编号。因此,用于此目的的 Condition 命令有一个选项特有的参数,即扩展选项列表上的选项编号。它可以用八进制、十进制或十六进制格式以 ASCII 表示。
2.3.5.3. 终端扩展选项
Telnet 的 Extended ASCII、SUPDUP 和 Data Entry Terminal 选项,都是试图把 Telnet 数据流的基本能力扩展到最初 Telnet 设计所基于的简单滚动模式终端模型之外。
所有这些选项的有效性都有局限。Extended ASCII 选项缺乏把比特模式解释为扩展 ASCII 字符的标准化方式。SUPDUP 的工作实际上是一种独立的模式,其中使用了另一种虚拟终端协议,而该选项只是用来切换到该协议或从该协议切换回来。Data Entry Terminal 选项要求每次使用扩展特性时都要进行子协商,开销过大。所有这些选项都缺乏更有价值的资产,即被广泛实现和使用。
本附录不详述应如何处理这些选项。显然,Condition 命令可以用来启动和终止对这些选项的使用。与扩展终端特性相关的字符的实际传输,应由 Transmit 命令提供,既可以作为正常的主机到 OPE 数据流的一部分,也可以使用协议特有参数。
这里应当提到一个较新的选项,即终端类型(Terminal Type)选项。它允许连接的一端请求有关另一端终端的信息,或发送有关本地端终端的信息。这对提供多种终端支持的系统很方便,但显然它并不遵循通过使用虚拟终端来化简 MxN 问题的模型。它在 H-FP 的背景下使用起来非常直截了当。只需把终端类型发送给另一端,并激活二进制传输选项(Binary Transmission Option)即可。
2.3.5.4. 状态选项
状态(Status)选项是使用 Telnet 的协商机制启用的。然而,在 OPE 与主机之间传递状态信息的手段由 Status 命令提供。因此,状态协商的细节与外置 Telnet 的接口无关。
2.3.6. 命令示例
下面的示例展示主机向 OPE 发出的命令,请求 OPE 与对方协商,以便执行远程回显。
C CO -pi DO 1 <nl>
数字 1 是上表中 ECHO 的选项代码。上面列出的所有简单选项都使用同样的基本格式。
带有额外参数的选项使用这种语法的直接扩展。例如,主机使用 Condition 设置近似消息大小的一种可能用法是:
C CO -pi DO 4 DS 1024
4 是近似消息大小选项的选项代码,DS 表示应设置主机的消息大小,1024 是期望的大小。