diff options
author | patacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3> | 2008-11-14 15:11:26 +0000 |
---|---|---|
committer | patacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3> | 2008-11-14 15:11:26 +0000 |
commit | 33750aac935ce4f0f9c2e44ab1e43cd196c95ce9 (patch) | |
tree | a1ae161c2388d2d02a0ff95f1ec26a92082cbcd7 /nuttx/examples/nsh/nsh_netcmds.c | |
parent | eb82956af4b42337b8b2baced2d3931769771ebd (diff) | |
download | px4-nuttx-33750aac935ce4f0f9c2e44ab1e43cd196c95ce9.tar.gz px4-nuttx-33750aac935ce4f0f9c2e44ab1e43cd196c95ce9.tar.bz2 px4-nuttx-33750aac935ce4f0f9c2e44ab1e43cd196c95ce9.zip |
Allow each NSH command to be disabled
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@1234 42af7a65-404d-4744-a932-0658087f49c3
Diffstat (limited to 'nuttx/examples/nsh/nsh_netcmds.c')
-rw-r--r-- | nuttx/examples/nsh/nsh_netcmds.c | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/nuttx/examples/nsh/nsh_netcmds.c b/nuttx/examples/nsh/nsh_netcmds.c index 3bc0d1e7e..56dce7bd2 100644 --- a/nuttx/examples/nsh/nsh_netcmds.c +++ b/nuttx/examples/nsh/nsh_netcmds.c @@ -133,7 +133,7 @@ static inline uint16 ping_newid(void) * Name: uip_statistics ****************************************************************************/ -#ifdef CONFIG_NET_STATISTICS +#if defined(CONFIG_NET_STATISTICS) && !defined(CONFIG_EXAMPLES_NSH_DISABLE_IFCONFIG) static inline void uip_statistics(FAR struct nsh_vtbl_s *vtbl) { nsh_output(vtbl, "uIP IP "); @@ -242,6 +242,7 @@ static inline void uip_statistics(FAR struct nsh_vtbl_s *vtbl) # define uip_statistics(vtbl) #endif + /**************************************************************************** * Name: ifconfig_callback ****************************************************************************/ @@ -386,6 +387,7 @@ errout: ****************************************************************************/ #if defined(CONFIG_NET_UDP) && CONFIG_NFILE_DESCRIPTORS > 0 +#ifndef CONFIG_EXAMPLES_NSH_DISABLE_GET int cmd_get(FAR struct nsh_vtbl_s *vtbl, int argc, char **argv) { struct tftpc_args_s args; @@ -419,17 +421,20 @@ int cmd_get(FAR struct nsh_vtbl_s *vtbl, int argc, char **argv) return OK; } #endif +#endif /**************************************************************************** * Name: cmd_ifconfig ****************************************************************************/ +#ifndef CONFIG_EXAMPLES_NSH_DISABLE_IFCONFIG int cmd_ifconfig(FAR struct nsh_vtbl_s *vtbl, int argc, char **argv) { netdev_foreach(ifconfig_callback, vtbl); uip_statistics(vtbl); return OK; } +#endif /**************************************************************************** * Name: cmd_ping @@ -437,6 +442,7 @@ int cmd_ifconfig(FAR struct nsh_vtbl_s *vtbl, int argc, char **argv) #if defined(CONFIG_NET_ICMP) && defined(CONFIG_NET_ICMP_PING) && \ !defined(CONFIG_DISABLE_CLOCK) && !defined(CONFIG_DISABLE_SIGNALS) +#ifndef CONFIG_EXAMPLES_NSH_DISABLE_PING int cmd_ping(FAR struct nsh_vtbl_s *vtbl, int argc, char **argv) { FAR const char *fmt = g_fmtarginvalid; @@ -576,6 +582,7 @@ errout: nsh_output(vtbl, fmt, argv[0]); return ERROR; } +#endif #endif /* CONFIG_NET_ICMP && CONFIG_NET_ICMP_PING */ /**************************************************************************** @@ -583,6 +590,7 @@ errout: ****************************************************************************/ #if defined(CONFIG_NET_UDP) && CONFIG_NFILE_DESCRIPTORS > 0 +#ifndef CONFIG_EXAMPLES_NSH_DISABLE_PUT int cmd_put(FAR struct nsh_vtbl_s *vtbl, int argc, char **argv) { struct tftpc_args_s args; @@ -616,5 +624,6 @@ int cmd_put(FAR struct nsh_vtbl_s *vtbl, int argc, char **argv) return OK; } #endif +#endif #endif /* CONFIG_NET */ |