Telnet 服务器启用客户端线路模式 [英] Telnet server enable client linemode

查看:27
本文介绍了Telnet 服务器启用客户端线路模式的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在 Arduino 上编写一个小的 Telnet 客户端.使用以下代码停用 Telnet 客户端 linemode 后,如何重新启用它?

I am writing a little Telnet client on Arduino. How do I reactivate the Telnet client linemode after I deactivate it with the following code?

  client.write(255); // IAC
  client.write(251); // WILL
  client.write(1);   // ECHO

  client.write(255); // IAC
  client.write(251); // WILL
  client.write(3);   // suppress go ahead

  client.write(255); // IAC
  client.write(252); // WONT
  client.write(34);  // LINEMODE

用于输入密码.

我尝试了反向命令,但它们不起作用.

I tried the reverse commands, but they don't work.

推荐答案

使用 BSD telnet 客户端,使用以下命令:

Using the BSD telnet client, use the following commands:

set debug
set prettydump
set options
set netdata

然后,可以使用命令切换一次字符模式和一次一行模式,

then, character-at-a-time mode and line-at-a-time mode can be switched, using commands,

mode line
mode character

随后的协商可以被检查和复制.

The negotiation that follows can be inspected and duplicated.

但是,只发送 IAC DONT ECHO、密码、CR NUL 和 IAC DO ECHO 就足够了.使用WILL ECHO, WILL SGA"进入一次字符"模式称为kludge 模式"——重新启用 ECHO 应默认为标准 NVT 行为(行模式).

However, it should be sufficient to send only IAC DONT ECHO, the password, CR NUL, then IAC DO ECHO. Entering "character at a time" mode using "WILL ECHO, WILL SGA" is called "kludge mode" -- re-enabling ECHO should default to standard NVT behavior (linemode).

bsd 客户端,但是,具有完整的扩展线路模式支持.这不是微不足道的,将近 50% 的代码库(前向掩码、slc、回调等).

bsd client, however, with full extended linemode support. It is not trivial, nearly 50% of the codebase (forwardmask, slc, callbacks, etc.).

如果服务器回复 WONT LINEMODE,那么它实际上仍然处于默认的 NVT linemode——它只是不在增强的 linemode 中或者不在乎协商它.这就是为什么发送 DO LINEMODE 实际上是一个糟糕的主意,因为您需要期望从以后的 rfc 中确认 linemode 的子协商协议.

If the server replies WONT LINEMODE, then it is still actually in the default NVT linemode -- it just is not in the enhanced linemode or does not care to negotiate about it. Which is why sending DO LINEMODE is actually a terrible idea, as you will need to expect to acknowledge the sub-negotiation protocols for linemode from later rfc's.

回复 DO LINEMODE 的服务器可能会继续请求 linemode sub-negotiation,例如 IAC SB LINEMODE MODE <1 byte bitmask> 和 IAC SB LINEMODE FORWARDMASK.使用 WONT FORWARDMASK 拒绝此响应.MODE 必须设置 ACK 位并以类似方式回复.

A server that replies DO LINEMODE will likely continue to request linemode sub-negotiation, such as IAC SB LINEMODE MODE <1 byte bitmask>, and IAC SB LINEMODE FORWARDMASK . Decline this response with a WONT FORWARDMASK. The MODE must have ACK bit set and be replied similarly.

这篇关于Telnet 服务器启用客户端线路模式的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆