diff options
author | patacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3> | 2012-04-23 23:21:30 +0000 |
---|---|---|
committer | patacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3> | 2012-04-23 23:21:30 +0000 |
commit | aee2480fc6f591ac4b0d62cbba3770a033331819 (patch) | |
tree | 462a51b8aff86cae0d449394d56e3720da7a5565 /apps/nshlib | |
parent | a8aed07667d2a225ca6b09fadb91e66d7c554312 (diff) | |
download | nuttx-aee2480fc6f591ac4b0d62cbba3770a033331819.tar.gz nuttx-aee2480fc6f591ac4b0d62cbba3770a033331819.tar.bz2 nuttx-aee2480fc6f591ac4b0d62cbba3770a033331819.zip |
NFS update
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@4650 42af7a65-404d-4744-a932-0658087f49c3
Diffstat (limited to 'apps/nshlib')
-rw-r--r-- | apps/nshlib/nsh_fscmds.c | 38 |
1 files changed, 20 insertions, 18 deletions
diff --git a/apps/nshlib/nsh_fscmds.c b/apps/nshlib/nsh_fscmds.c index d79ce4f47..a398179c0 100644 --- a/apps/nshlib/nsh_fscmds.c +++ b/apps/nshlib/nsh_fscmds.c @@ -56,6 +56,7 @@ # endif # ifdef CONFIG_NFS # include <sys/socket.h> +# include <netinet/in.h> # include <nuttx/fs/nfs.h> # endif #endif @@ -86,7 +87,8 @@ * Private Types ****************************************************************************/ -typedef int (*direntry_handler_t)(FAR struct nsh_vtbl_s *, const char *, struct dirent *, void *); +typedef int (*direntry_handler_t)(FAR struct nsh_vtbl_s *, const char *, + struct dirent *, void *); /**************************************************************************** * Private Function Prototypes @@ -1338,23 +1340,23 @@ int cmd_nfsmount(FAR struct nsh_vtbl_s *vtbl, int argc, char **argv) /* Place all of the NFS arguements into the nfs_args structure */ memset(&data, 0, sizeof(data)); - data.version = 3; - data.proto = (tcp) ? 6 : 17; - data.sotype = (tcp) ? 0 : 1; - sin.sin_family = 2; - sin.sin_port = htons(2049); - sin.sin_addr = inaddr; - data.addr = (struct sockaddr *)&sin; - data.addrlen = sizeof(struct sockaddr); - data.flags = 0x00000200; - data.retrans = 3; - data.acregmin = 3; - data.acregmax = 60; - data.acdirmin = 30; - data.acdirmax = 60; - data.rsize = 0; - data.wsize = 0; - data.timeo = (tcp) ? 70 : 7; + data.version = NFS_ARGSVERSION; + data.proto = (tcp) ? IPPROTO_TCP : IPPROTO_UDP; + data.sotype = (tcp) ? SOCK_STREAM : SOCK_DGRAM; + sin.sin_family = AF_INET; + sin.sin_port = htons(NFS_PORT); + sin.sin_addr = inaddr; + data.addr = (struct sockaddr *)&sin; + data.addrlen = sizeof(struct sockaddr); + data.flags = NFSMNT_NFSV3; + data.retrans = 3; + data.acregmin = 3; + data.acregmax = 60; + data.acdirmin = 30; + data.acdirmax = 60; + data.rsize = 0; + data.wsize = 0; + data.timeo = (tcp) ? 70 : 7; /* Perform the mount */ |