diff options
author | patacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3> | 2012-11-04 18:54:04 +0000 |
---|---|---|
committer | patacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3> | 2012-11-04 18:54:04 +0000 |
commit | 08a0eae6371ad7d6af7c0d941381fa1e11370a86 (patch) | |
tree | 7a3a8ae8e2b29e3832a17a7def5b0531383172bb /apps/nshlib/nsh.h | |
parent | 813efa266bb67269669e532b5ce6f00ee2097948 (diff) | |
download | nuttx-08a0eae6371ad7d6af7c0d941381fa1e11370a86.tar.gz nuttx-08a0eae6371ad7d6af7c0d941381fa1e11370a86.tar.bz2 nuttx-08a0eae6371ad7d6af7c0d941381fa1e11370a86.zip |
Add interfaces flags, extend ifconfig, add ifup and ifdown commands (Darcy Gong
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@5308 42af7a65-404d-4744-a932-0658087f49c3
Diffstat (limited to 'apps/nshlib/nsh.h')
-rw-r--r-- | apps/nshlib/nsh.h | 34 |
1 files changed, 32 insertions, 2 deletions
diff --git a/apps/nshlib/nsh.h b/apps/nshlib/nsh.h index 9f36b1d1f..ac75cf2e1 100644 --- a/apps/nshlib/nsh.h +++ b/apps/nshlib/nsh.h @@ -267,9 +267,35 @@ # undef CONFIG_NSH_ROMFSSECTSIZE #endif -/* This is the maximum number of arguments that will be accepted for a command */ +/* This is the maximum number of arguments that will be accepted for a + * command. Here we attempt to select the smallest number possible depending + * upon the of commands that are available. Most commands use six or fewer + * arguments, but there are a few that require more. + * + * This value is also configurable with CONFIG_NSH_MAXARGUMENTS. This + * configurability is necessary since there may also be external, "built-in" + * commands that require more commands than NSH is aware of. + */ + +#ifndef CONFIG_NSH_MAXARGUMENTS +# define CONFIG_NSH_MAXARGUMENTS 6 +#endif + +#if CONFIG_NSH_MAXARGUMENTS < 11 +# if defined(CONFIG_NET) && !defined(CONFIG_NSH_DISABLE_IFCONFIG) +# undef CONFIG_NSH_MAXARGUMENTS +# define CONFIG_NSH_MAXARGUMENTS 11 +# endif +#endif -#define NSH_MAX_ARGUMENTS 6 +#if CONFIG_NSH_MAXARGUMENTS < 7 +# if defined(CONFIG_NET_UDP) && CONFIG_NFILE_DESCRIPTORS > 0 +# if !defined(CONFIG_NSH_DISABLE_GET) || !defined(CONFIG_NSH_DISABLE_PUT) +# undef CONFIG_NSH_MAXARGUMENTS +# define CONFIG_NSH_MAXARGUMENTS 7 +# endif +# endif +#endif /* strerror() produces much nicer output but is, however, quite large and * will only be used if CONFIG_NSH_STRERROR is defined. Note that the strerror @@ -602,6 +628,10 @@ void nsh_usbtrace(void); # ifndef CONFIG_NSH_DISABLE_IFCONFIG int cmd_ifconfig(FAR struct nsh_vtbl_s *vtbl, int argc, char **argv); # endif +# ifndef CONFIG_NSH_DISABLE_IFUPDOWN + int cmd_ifup(FAR struct nsh_vtbl_s *vtbl, int argc, char **argv); + int cmd_ifdown(FAR struct nsh_vtbl_s *vtbl, int argc, char **argv); +# endif #if defined(CONFIG_NET_UDP) && CONFIG_NFILE_DESCRIPTORS > 0 # ifndef CONFIG_NSH_DISABLE_GET int cmd_get(FAR struct nsh_vtbl_s *vtbl, int argc, char **argv); |