From 608e5adab4915ada5c2881d66d20e3d6fa0efba5 Mon Sep 17 00:00:00 2001 From: patacongo Date: Wed, 31 Oct 2012 14:36:00 +0000 Subject: Add apps/netutils/codecs and associated NSH commands from Darcy Gong git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@5280 42af7a65-404d-4744-a932-0658087f49c3 --- apps/nshlib/nsh_parse.c | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) (limited to 'apps/nshlib/nsh_parse.c') diff --git a/apps/nshlib/nsh_parse.c b/apps/nshlib/nsh_parse.c index df2f7c3e3..f9642809f 100644 --- a/apps/nshlib/nsh_parse.c +++ b/apps/nshlib/nsh_parse.c @@ -153,6 +153,15 @@ static const struct cmdmap_s g_cmdmap[] = { "?", cmd_help, 1, 1, NULL }, #endif +#if defined(CONFIG_NETUTILS_CODECS) && defined(CONFIG_CODECS_BASE64) +# ifndef CONFIG_NSH_DISABLE_BASE64DEC + { "base64dec", cmd_base64decode, 2, 4, "[-w] [-f] " }, +# endif +# ifndef CONFIG_NSH_DISABLE_BASE64ENC + { "base64enc", cmd_base64encode, 2, 4, "[-w] [-f] " }, +# endif +#endif + #if CONFIG_NFILE_DESCRIPTORS > 0 # ifndef CONFIG_NSH_DISABLE_CAT { "cat", cmd_cat, 2, NSH_MAX_ARGUMENTS, " [ [ ...]]" }, @@ -246,6 +255,12 @@ static const struct cmdmap_s g_cmdmap[] = { "mb", cmd_mb, 2, 3, "[=][ ]" }, #endif +#if defined(CONFIG_NETUTILS_CODECS) && defined(CONFIG_CODECS_HASH_MD5) +# ifndef CONFIG_NSH_DISABLE_MD5 + { "md5", cmd_md5, 2, 3, "[-f] " }, +# endif +#endif + #if !defined(CONFIG_DISABLE_MOUNTPOINT) && CONFIG_NFILE_DESCRIPTORS > 0 && defined(CONFIG_FS_WRITABLE) # ifndef CONFIG_NSH_DISABLE_MKDIR { "mkdir", cmd_mkdir, 2, 2, "" }, @@ -363,6 +378,15 @@ static const struct cmdmap_s g_cmdmap[] = # endif #endif +#if defined(CONFIG_NETUTILS_CODECS) && defined(CONFIG_CODECS_URLCODE) +# ifndef CONFIG_NSH_DISABLE_URLDECODE + { "urldecode", cmd_urldecode, 2, 3, "[-f] " }, +# endif +# ifndef CONFIG_NSH_DISABLE_URLENCODE + { "urlencode", cmd_urlencode, 2, 3, "[-f] " }, +# endif +#endif + #ifndef CONFIG_DISABLE_SIGNALS # ifndef CONFIG_NSH_DISABLE_USLEEP { "usleep", cmd_usleep, 2, 2, "" }, @@ -378,6 +402,7 @@ static const struct cmdmap_s g_cmdmap[] = #ifndef CONFIG_NSH_DISABLE_XD { "xd", cmd_xd, 3, 3, " " }, #endif + { NULL, NULL, 1, 1, NULL } }; -- cgit v1.2.3