nshlib: Reuse nsh_session logic in nsh_telnetmain

to avoid the code duplication

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
This commit is contained in:
Xiang Xiao
2022-10-17 05:17:41 +08:00
committed by Alan Carvalho de Assis
parent 8e460e7e19
commit 75455d3788
8 changed files with 55 additions and 128 deletions

View File

@@ -647,6 +647,13 @@
* Public Types
****************************************************************************/
enum nsh_login_e
{
NSH_LOGIN_NONE = 0, /* Don't Performs the login sequence */
NSH_LOGIN_LOCAL, /* Performs the login sequence as local user */
NSH_LOGIN_TELNET /* Performs the login sequence as telnet client */
};
#ifndef CONFIG_NSH_DISABLE_ITEF
/* State when parsing and if-then-else sequence */
@@ -866,7 +873,7 @@ int nsh_loginscript(FAR struct nsh_vtbl_s *vtbl);
struct console_stdio_s;
int nsh_session(FAR struct console_stdio_s *pstate,
bool login, int argc, FAR char *argv[]);
int login, int argc, FAR char *argv[]);
int nsh_parse(FAR struct nsh_vtbl_s *vtbl, FAR char *cmdline);
/****************************************************************************