driver/telnet: Remove TELNET_CHARACTER_MODE

If TELNET_CHARACTER_MODE is set, the ECHO must be handled by the telnet server.

So this option is useless. We need a new approach to control the ECHO behavior.

Signed-off-by: Huang Qi <huangqi3@xiaomi.com>
This commit is contained in:
Huang Qi 2023-04-03 16:21:13 +08:00 committed by Xiang Xiao
parent 06ee8d9673
commit d6c56e7105
15 changed files with 7 additions and 53 deletions

View File

@ -145,7 +145,6 @@ CONFIG_SYSTEM_SYSTEM=y
CONFIG_SYSTEM_TASKSET=y
CONFIG_SYSTEM_TIME64=y
CONFIG_TASK_NAME_SIZE=24
CONFIG_TELNET_CHARACTER_MODE=y
CONFIG_TESTING_GETPRIME=y
CONFIG_TESTING_OSTEST=y
CONFIG_TESTING_SMP=y

View File

@ -171,7 +171,6 @@ CONFIG_SYSTEM_NXPLAYER=y
CONFIG_SYSTEM_PING=y
CONFIG_SYSTEM_TIME64=y
CONFIG_TASK_NAME_SIZE=24
CONFIG_TELNET_CHARACTER_MODE=y
CONFIG_TESTING_OSTEST=y
CONFIG_UART0_RXBUFSIZE=512
CONFIG_UART0_SERIAL_CONSOLE=y

View File

@ -172,7 +172,6 @@ CONFIG_SYSTEM_SYSTEM=y
CONFIG_SYSTEM_TASKSET=y
CONFIG_SYSTEM_TIME64=y
CONFIG_TASK_NAME_SIZE=24
CONFIG_TELNET_CHARACTER_MODE=y
CONFIG_TESTING_GETPRIME=y
CONFIG_TESTING_OSTEST=y
CONFIG_TESTING_SMP=y

View File

@ -113,7 +113,6 @@ CONFIG_SYSTEM_SYSTEM=y
CONFIG_SYSTEM_TELNET_CLIENT=y
CONFIG_SYSTEM_TIME64=y
CONFIG_TASK_NAME_SIZE=32
CONFIG_TELNET_CHARACTER_MODE=y
CONFIG_TELNET_TXBUFFER_SIZE=64
CONFIG_TTY_SIGINT=y
CONFIG_TTY_SIGINT_CHAR=0x3

View File

@ -112,7 +112,6 @@ CONFIG_SYSTEM_DHCPC_RENEW=y
CONFIG_SYSTEM_NSH=y
CONFIG_SYSTEM_NXPLAYER=y
CONFIG_SYSTEM_PING=y
CONFIG_TELNET_CHARACTER_MODE=y
CONFIG_TLS_TASK_NELEM=4
CONFIG_UART0_SERIAL_CONSOLE=y
CONFIG_WIRELESS=y

View File

@ -82,7 +82,6 @@ CONFIG_SYSTEM_DHCPC_RENEW=y
CONFIG_SYSTEM_NSH=y
CONFIG_SYSTEM_PING=y
CONFIG_SYSTEM_STACKMONITOR=y
CONFIG_TELNET_CHARACTER_MODE=y
CONFIG_TLS_TASK_NELEM=4
CONFIG_UART0_SERIAL_CONSOLE=y
CONFIG_WIRELESS=y

View File

@ -117,7 +117,6 @@ CONFIG_SYSTEM_DHCPC_RENEW=y
CONFIG_SYSTEM_NSH=y
CONFIG_SYSTEM_NXPLAYER=y
CONFIG_SYSTEM_PING=y
CONFIG_TELNET_CHARACTER_MODE=y
CONFIG_TLS_TASK_NELEM=4
CONFIG_UART0_SERIAL_CONSOLE=y
CONFIG_WIRELESS=y

View File

@ -142,7 +142,6 @@ CONFIG_SYSTEM_DHCPC_RENEW=y
CONFIG_SYSTEM_NSH=y
CONFIG_SYSTEM_PING=y
CONFIG_SYSTEM_TELNETD=y
CONFIG_TELNET_CHARACTER_MODE=y
CONFIG_TLS_TASK_NELEM=4
CONFIG_UART0_SERIAL_CONSOLE=y
CONFIG_WIRELESS=y

View File

@ -94,7 +94,6 @@ CONFIG_SYSTEM_DHCPC_RENEW=y
CONFIG_SYSTEM_NSH=y
CONFIG_SYSTEM_PING=y
CONFIG_SYSTEM_STACKMONITOR=y
CONFIG_TELNET_CHARACTER_MODE=y
CONFIG_TLS_TASK_NELEM=4
CONFIG_UART0_SERIAL_CONSOLE=y
CONFIG_WIRELESS=y

View File

@ -119,7 +119,6 @@ CONFIG_SYSTEM_NSH=y
CONFIG_SYSTEM_NXLOOPER=y
CONFIG_SYSTEM_NXPLAYER=y
CONFIG_SYSTEM_PING=y
CONFIG_TELNET_CHARACTER_MODE=y
CONFIG_TLS_TASK_NELEM=4
CONFIG_UART0_SERIAL_CONSOLE=y
CONFIG_WIRELESS=y

View File

@ -82,7 +82,6 @@ CONFIG_SYSTEM_DHCPC_RENEW=y
CONFIG_SYSTEM_NSH=y
CONFIG_SYSTEM_PING=y
CONFIG_SYSTEM_STACKMONITOR=y
CONFIG_TELNET_CHARACTER_MODE=y
CONFIG_TLS_TASK_NELEM=4
CONFIG_UART0_SERIAL_CONSOLE=y
CONFIG_WIRELESS=y

View File

@ -116,7 +116,6 @@ CONFIG_SYSTEM_DHCPC_RENEW=y
CONFIG_SYSTEM_NSH=y
CONFIG_SYSTEM_NXPLAYER=y
CONFIG_SYSTEM_PING=y
CONFIG_TELNET_CHARACTER_MODE=y
CONFIG_TLS_TASK_NELEM=4
CONFIG_UART0_SERIAL_CONSOLE=y
CONFIG_WIRELESS=y

View File

@ -82,7 +82,6 @@ CONFIG_SYSTEM_DHCPC_RENEW=y
CONFIG_SYSTEM_NSH=y
CONFIG_SYSTEM_PING=y
CONFIG_SYSTEM_STACKMONITOR=y
CONFIG_TELNET_CHARACTER_MODE=y
CONFIG_TLS_TASK_NELEM=4
CONFIG_UART0_SERIAL_CONSOLE=y
CONFIG_WIRELESS=y

View File

@ -73,14 +73,6 @@ config TELNET_MAXLCLIENTS
number. This limitation is somewhat artificial since it only
determines the size of a fixed-size, preallocated, internal array.
config TELNET_CHARACTER_MODE
bool "Character mode"
default n
---help---
The Telnet daemon works in character mode. In this case, the daemon
will echo a character which telnet client sent. By default, it works
in line mode.
config TELNET_SUPPORT_NAWS
bool "Support NAWS (Negotiate About Window Size)"
default n

View File

@ -311,18 +311,11 @@ static void telnet_getchar(FAR struct telnet_dev_s *priv, uint8_t ch,
{
register int index;
#ifndef CONFIG_TELNET_CHARACTER_MODE
/* Ignore carriage returns */
if (ch != TELNET_CR)
#endif
{
/* Add all other characters to the destination buffer */
/* Add all characters to the destination buffer */
index = *nread;
dest[index++] = ch;
*nread = index;
}
}
/****************************************************************************
@ -420,25 +413,12 @@ static ssize_t telnet_receive(FAR struct telnet_dev_s *priv,
break;
case STATE_DO:
#ifdef CONFIG_TELNET_CHARACTER_MODE
if (ch == TELNET_SGA || ch == TELNET_ECHO)
{
/* If it received 'ECHO' or 'Suppress Go Ahead', then do
* nothing.
/* FIXME: Handle ECHO and SGA setting here
* Used to disable ECHO password in login nsh via telnet
*/
}
else
{
/* Reply with a WONT */
telnet_sendopt(priv, TELNET_WONT, ch);
ninfo("WONT: 0x%02X\n", ch);
}
#else
/* Reply with a WONT */
telnet_sendopt(priv, TELNET_WONT, ch);
#endif
priv->td_state = STATE_NORMAL;
break;
@ -1001,11 +981,6 @@ static int telnet_session(FAR struct telnet_session_s *session)
telnet_sendopt(priv, TELNET_DO, TELNET_NAWS);
#endif
#ifdef CONFIG_TELNET_CHARACTER_MODE
telnet_sendopt(priv, TELNET_WILL, TELNET_SGA);
telnet_sendopt(priv, TELNET_WILL, TELNET_ECHO);
#endif
/* Save ourself in the list of Telnet client threads */
g_telnet_clients[priv->td_minor] = priv;