diff options
author | patacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3> | 2012-10-12 16:59:17 +0000 |
---|---|---|
committer | patacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3> | 2012-10-12 16:59:17 +0000 |
commit | e4ccbe7508fd31b76790986fc654dc588efb9dfe (patch) | |
tree | 48b3a447e4756a3cc3ee0e5d7ff61f637c59bc1d /apps/nshlib/nsh.h | |
parent | 8de1d1d182bed68c075f279541c32a7493aef0bc (diff) | |
download | px4-firmware-e4ccbe7508fd31b76790986fc654dc588efb9dfe.tar.gz px4-firmware-e4ccbe7508fd31b76790986fc654dc588efb9dfe.tar.bz2 px4-firmware-e4ccbe7508fd31b76790986fc654dc588efb9dfe.zip |
You can now configure a login for Telnet NSH session -- from Darcy Gong
git-svn-id: http://svn.code.sf.net/p/nuttx/code/trunk@5231 42af7a65-404d-4744-a932-0658087f49c3
Diffstat (limited to 'apps/nshlib/nsh.h')
-rw-r--r-- | apps/nshlib/nsh.h | 35 |
1 files changed, 34 insertions, 1 deletions
diff --git a/apps/nshlib/nsh.h b/apps/nshlib/nsh.h index dac91ba05..cfab26271 100644 --- a/apps/nshlib/nsh.h +++ b/apps/nshlib/nsh.h @@ -164,10 +164,19 @@ * Default: SCHED_PRIORITY_DEFAULT * CONFIG_NSH_TELNETD_DAEMONSTACKSIZE - Stack size allocated for the * Telnet daemon. Default: 2048 - * CONFIG_NSH_TELNETD_CLIENTPRIO- Priority of the Telnet client. + * CONFIG_NSH_TELNETD_CLIENTPRIO - Priority of the Telnet client. * Default: SCHED_PRIORITY_DEFAULT * CONFIG_NSH_TELNETD_CLIENTSTACKSIZE - Stack size allocated for the * Telnet client. Default: 2048 + * CONFIG_NSH_TELNET_LOGIN - Support a simple Telnet login. + * + * If CONFIG_NSH_TELNET_LOGIN is defined, then these additional + * options may be specified: + * + * CONFIG_NSH_TELNET_USERNAME - Login user name. Default: "admin" + * CONFIG_NSH_TELNET_PASSWORD - Login password: Default: "nuttx" + * CONFIG_NSH_TELNET_FAILCOUNT - Number of login retry attempts. + * Default 3. */ #ifndef CONFIG_NSH_TELNETD_PORT @@ -190,6 +199,22 @@ # define CONFIG_NSH_TELNETD_CLIENTSTACKSIZE 2048 #endif +#ifdef CONFIG_NSH_TELNET_LOGIN + +# ifndef CONFIG_NSH_TELNET_USERNAME +# define CONFIG_NSH_TELNET_USERNAME "admin" +# endif + +# ifndef CONFIG_NSH_TELNET_PASSWORD +# define CONFIG_NSH_TELNET_PASSWORD "nuttx" +# endif + +# ifndef CONFIG_NSH_TELNET_FAILCOUNT +# define CONFIG_NSH_TELNET_FAILCOUNT 3 +# endif + +#endif /* CONFIG_NSH_TELNET_LOGIN */ + /* Verify support for ROMFS /etc directory support options */ #ifdef CONFIG_NSH_ROMFSETC @@ -362,6 +387,14 @@ typedef int (*cmd_t)(FAR struct nsh_vtbl_s *vtbl, int argc, char **argv); ****************************************************************************/ extern const char g_nshgreeting[]; +#if defined(CONFIG_NSH_TELNET_LOGIN) && defined(CONFIG_NSH_TELNET) +extern const char g_telnetgreeting[]; +extern const char g_userprompt[]; +extern const char g_passwordprompt[]; +extern const char g_loginsuccess[]; +extern const char g_badcredentials[]; +extern const char g_loginfailure[]; +#endif extern const char g_nshprompt[]; extern const char g_nshsyntax[]; extern const char g_fmtargrequired[]; |