summaryrefslogtreecommitdiff
path: root/apps/nshlib
diff options
context:
space:
mode:
authorpatacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3>2012-06-14 00:47:42 +0000
committerpatacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3>2012-06-14 00:47:42 +0000
commit68cef09eeafdbceef358b47ca3a6817600bdfc08 (patch)
tree8884f40bd84695b9de63c6eb5a85d2ce074552d7 /apps/nshlib
parentcdbc82c04c609695764e116c593c390c46f37dd8 (diff)
downloadnuttx-68cef09eeafdbceef358b47ca3a6817600bdfc08.tar.gz
nuttx-68cef09eeafdbceef358b47ca3a6817600bdfc08.tar.bz2
nuttx-68cef09eeafdbceef358b47ca3a6817600bdfc08.zip
NFS just finished a major weight reduction program
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@4838 42af7a65-404d-4744-a932-0658087f49c3
Diffstat (limited to 'apps/nshlib')
-rw-r--r--apps/nshlib/nsh_fscmds.c79
-rw-r--r--apps/nshlib/nsh_parse.c2
2 files changed, 7 insertions, 74 deletions
diff --git a/apps/nshlib/nsh_fscmds.c b/apps/nshlib/nsh_fscmds.c
index b3b4ae770..39174a862 100644
--- a/apps/nshlib/nsh_fscmds.c
+++ b/apps/nshlib/nsh_fscmds.c
@@ -1266,7 +1266,6 @@ int cmd_mv(FAR struct nsh_vtbl_s *vtbl, int argc, char **argv)
int cmd_nfsmount(FAR struct nsh_vtbl_s *vtbl, int argc, char **argv)
{
struct nfs_args data;
- FAR char *protocol;
FAR char *address;
FAR char *lpath;
FAR char *rpath;
@@ -1278,54 +1277,8 @@ int cmd_nfsmount(FAR struct nsh_vtbl_s *vtbl, int argc, char **argv)
FAR struct sockaddr_in *sin;
struct in_addr inaddr;
#endif
- bool tcp = false;
int ret;
- /* Get the NFS mount options */
-
- int option;
- while ((option = getopt(argc, argv, ":p:")) != ERROR)
- {
- switch (option)
- {
- /* Protocol may be UDP or TCP */
-
- case 'p':
- protocol = optarg;
- break;
-
- /* Handle missing required arguments */
-
- case ':':
- nsh_output(vtbl, g_fmtargrequired, argv[0]);
- badarg = true;
- break;
-
- /* Handle unrecognized arguments */
-
- case '?':
- default:
- nsh_output(vtbl, g_fmtarginvalid, argv[0]);
- badarg = true;
- break;
- }
- }
-
- /* Decode the protocol string */
-
- if (protocol)
- {
- if (strncmp(protocol, "tcp", 3) == 0)
- {
- tcp = true;
- }
- else if (!strncmp(protocol, "udp", 3) != 0)
- {
- nsh_output(vtbl, g_fmtarginvalid, argv[0]);
- badarg = true;
- }
- }
-
/* If a bad argument was encountered, then return without processing the
* command.
*/
@@ -1335,26 +1288,11 @@ int cmd_nfsmount(FAR struct nsh_vtbl_s *vtbl, int argc, char **argv)
return ERROR;
}
- /* There are three required arguments after the options: (1) The NFS server IP
- * address and then (1) the path to the mount point.
- */
-
- if (optind + 3 < argc)
- {
- nsh_output(vtbl, g_fmttoomanyargs, argv[0]);
- return ERROR;
- }
- else if (optind + 3 > argc)
- {
- nsh_output(vtbl, g_fmtargrequired, argv[0]);
- return ERROR;
- }
-
- /* The next argument on the command line should be the NFS server IP address
+ /* The fist argument on the command line should be the NFS server IP address
* in standard IPv4 (or IPv6) dot format.
*/
- address = argv[optind];
+ address = argv[1];
if (!address)
{
return ERROR;
@@ -1364,7 +1302,7 @@ int cmd_nfsmount(FAR struct nsh_vtbl_s *vtbl, int argc, char **argv)
* directory.
*/
- lpath = nsh_getfullpath(vtbl, argv[optind+1]);
+ lpath = nsh_getfullpath(vtbl, argv[2]);
if (!lpath)
{
return ERROR;
@@ -1372,7 +1310,7 @@ int cmd_nfsmount(FAR struct nsh_vtbl_s *vtbl, int argc, char **argv)
/* Get the remote mount point path */
- rpath = argv[optind+2];
+ rpath = argv[3];
/* Convert the IP address string into its binary form */
@@ -1406,16 +1344,11 @@ int cmd_nfsmount(FAR struct nsh_vtbl_s *vtbl, int argc, char **argv)
#endif
data.version = NFS_ARGSVERSION;
- data.sotype = (tcp) ? SOCK_STREAM : SOCK_DGRAM;
- data.proto = (tcp) ? IPPROTO_TCP : IPPROTO_UDP;
+ data.sotype = SOCK_DGRAM;
data.flags = NFSMNT_NFSV3;
data.retrans = 3;
data.path = rpath;
- data.acregmin = 3;
- data.acregmax = 60;
- data.acdirmin = 30;
- data.acdirmax = 60;
- data.timeo = (tcp) ? 70 : 7;
+ data.timeo = 7;
/* Perform the mount */
diff --git a/apps/nshlib/nsh_parse.c b/apps/nshlib/nsh_parse.c
index f95444f0b..bc6f8576a 100644
--- a/apps/nshlib/nsh_parse.c
+++ b/apps/nshlib/nsh_parse.c
@@ -276,7 +276,7 @@ static const struct cmdmap_s g_cmdmap[] =
#if !defined(CONFIG_DISABLE_MOUNTPOINT) && CONFIG_NFILE_DESCRIPTORS > 0 && \
defined(CONFIG_FS_READABLE) && defined(CONFIG_NET) && defined(CONFIG_NFS)
# ifndef CONFIG_NSH_DISABLE_NFSMOUNT
- { "nfsmount", cmd_nfsmount, 4, 6, "[-p <protocol>] <server-address> <mount-point> <remote-path>" },
+ { "nfsmount", cmd_nfsmount, 4, 4, "<server-address> <mount-point> <remote-path>" },
# endif
#endif