mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-28 07:03:34 +08:00
NFS update
git-svn-id: https://nuttx.svn.sourceforge.net/svnroot/nuttx/trunk@4818 7fd9a85b-ad96-42d3-883c-3090e2eb8679
This commit is contained in:
@@ -764,7 +764,7 @@ int nfs_readdirrpc(struct nfsmount *nmp, struct nfsnode *np,
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Check for EOF */
|
/* Check for EOF */
|
||||||
|
#if 0 /* This logic is NOT correct */
|
||||||
if (*ptr != 0)
|
if (*ptr != 0)
|
||||||
{
|
{
|
||||||
np->n_direofoffset = fxdr_hyper(&dir->u.nfs.cookie[0]);
|
np->n_direofoffset = fxdr_hyper(&dir->u.nfs.cookie[0]);
|
||||||
@@ -776,11 +776,11 @@ int nfs_readdirrpc(struct nfsmount *nmp, struct nfsnode *np,
|
|||||||
fdbg("End of directory\n");
|
fdbg("End of directory\n");
|
||||||
error = ENOENT;
|
error = ENOENT;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
/* Otherwise, there is an entry. Get the file ID and point to the length */
|
/* Otherwise, there is an entry. Get the file ID and point to the length */
|
||||||
|
/* Missing logic to get the file ID */
|
||||||
|
|
||||||
// dir->fd_dir.d_type = entry->fileid;
|
|
||||||
#warning "This must match the type values in dirent.h"
|
|
||||||
ptr += 2;
|
ptr += 2;
|
||||||
|
|
||||||
/* Get the length and point to the name */
|
/* Get the length and point to the name */
|
||||||
@@ -807,7 +807,13 @@ int nfs_readdirrpc(struct nfsmount *nmp, struct nfsnode *np,
|
|||||||
ptr++; /* Just skip over the nextentry for now */
|
ptr++; /* Just skip over the nextentry for now */
|
||||||
|
|
||||||
/* Return the Type of the node to the caller */
|
/* Return the Type of the node to the caller */
|
||||||
/* MISSING LOGIC */
|
/* MISSING LOGIC TO DETERMINE FILE TYPE -- Need to (1) get nfstype, and (2)
|
||||||
|
* map NFREG, NFDIR, etc. to values in dirent.h.
|
||||||
|
*/
|
||||||
|
|
||||||
|
dir->fd_dir.d_type = DTYPE_FILE;
|
||||||
|
// dir->fd_dir.d_type = entry->fileid;
|
||||||
|
#warning "This must match the type values in dirent.h"
|
||||||
|
|
||||||
/* Return the name of the node to the caller */
|
/* Return the name of the node to the caller */
|
||||||
|
|
||||||
|
|||||||
@@ -387,14 +387,12 @@ struct rpc_reply_header
|
|||||||
struct rpc_reply_pmap
|
struct rpc_reply_pmap
|
||||||
{
|
{
|
||||||
struct rpc_reply_header rh;
|
struct rpc_reply_header rh;
|
||||||
uint32_t status;
|
|
||||||
struct call_result_pmap pmap;
|
struct call_result_pmap pmap;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct rpc_reply_mount
|
struct rpc_reply_mount
|
||||||
{
|
{
|
||||||
struct rpc_reply_header rh;
|
struct rpc_reply_header rh;
|
||||||
uint32_t status;
|
|
||||||
struct call_result_mount mount;
|
struct call_result_mount mount;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
+4
-14
@@ -465,7 +465,6 @@ static int rpcclnt_receive(struct rpctask *rep, struct sockaddr *aname,
|
|||||||
uint32_t len;
|
uint32_t len;
|
||||||
int sotype;
|
int sotype;
|
||||||
#endif
|
#endif
|
||||||
int rcvflg;
|
|
||||||
int error = 0;
|
int error = 0;
|
||||||
int errval;
|
int errval;
|
||||||
|
|
||||||
@@ -541,9 +540,8 @@ static int rpcclnt_receive(struct rpctask *rep, struct sockaddr *aname,
|
|||||||
do
|
do
|
||||||
{
|
{
|
||||||
socklen_t fromlen = sizeof(*rep->r_rpcclnt->rc_name)
|
socklen_t fromlen = sizeof(*rep->r_rpcclnt->rc_name)
|
||||||
rcvflg = MSG_WAITALL;
|
|
||||||
nbytes = psock_recvfrom(so, reply, len,
|
nbytes = psock_recvfrom(so, reply, len,
|
||||||
&rcvflg, rep->r_rpcclnt->rc_name,
|
MSG_WAITALL, rep->r_rpcclnt->rc_name,
|
||||||
&fromlen);
|
&fromlen);
|
||||||
if (nbytes < 0)
|
if (nbytes < 0)
|
||||||
{
|
{
|
||||||
@@ -597,9 +595,8 @@ static int rpcclnt_receive(struct rpctask *rep, struct sockaddr *aname,
|
|||||||
do
|
do
|
||||||
{
|
{
|
||||||
socklen_t fromlen = sizeof(*rep->r_rpcclnt->rc_name);
|
socklen_t fromlen = sizeof(*rep->r_rpcclnt->rc_name);
|
||||||
rcvflg = MSG_WAITALL;
|
|
||||||
nbytes = psock_recvfrom(so, reply, sizeof(*reply),
|
nbytes = psock_recvfrom(so, reply, sizeof(*reply),
|
||||||
&rcvflg, rep->r_rpcclnt->rc_name,
|
MSG_WAITALL, rep->r_rpcclnt->rc_name,
|
||||||
&fromlen);
|
&fromlen);
|
||||||
if (nbytes < 0)
|
if (nbytes < 0)
|
||||||
{
|
{
|
||||||
@@ -640,8 +637,7 @@ static int rpcclnt_receive(struct rpctask *rep, struct sockaddr *aname,
|
|||||||
do
|
do
|
||||||
{
|
{
|
||||||
socklen_t fromlen = sizeof(*rep->r_rpcclnt->rc_name);
|
socklen_t fromlen = sizeof(*rep->r_rpcclnt->rc_name);
|
||||||
rcvflg = 0;
|
nbytes = psock_recvfrom(so, reply, sizeof(*reply), 0,
|
||||||
nbytes = psock_recvfrom(so, reply, sizeof(*reply), &rcvflg,
|
|
||||||
rep->r_rpcclnt->rc_name, &fromlen);
|
rep->r_rpcclnt->rc_name, &fromlen);
|
||||||
if (nbytes < 0)
|
if (nbytes < 0)
|
||||||
{
|
{
|
||||||
@@ -659,11 +655,6 @@ static int rpcclnt_receive(struct rpctask *rep, struct sockaddr *aname,
|
|||||||
}
|
}
|
||||||
while (errval == EWOULDBLOCK || nbytes == 0);
|
while (errval == EWOULDBLOCK || nbytes == 0);
|
||||||
|
|
||||||
if ((rcvflg & MSG_EOR) == 0)
|
|
||||||
{
|
|
||||||
fdbg("Egad!!\n");
|
|
||||||
}
|
|
||||||
|
|
||||||
if (nbytes < 0)
|
if (nbytes < 0)
|
||||||
{
|
{
|
||||||
error = errval;
|
error = errval;
|
||||||
@@ -714,8 +705,7 @@ static int rpcclnt_receive(struct rpctask *rep, struct sockaddr *aname,
|
|||||||
}
|
}
|
||||||
|
|
||||||
socklen_t fromlen = sizeof(struct sockaddr);
|
socklen_t fromlen = sizeof(struct sockaddr);
|
||||||
rcvflg = 0;
|
nbytes = psock_recvfrom(so, reply, len, 0, aname, &fromlen);
|
||||||
nbytes = psock_recvfrom(so, reply, len, rcvflg, aname, &fromlen);
|
|
||||||
if (nbytes < 0)
|
if (nbytes < 0)
|
||||||
{
|
{
|
||||||
errval = errno;
|
errval = errno;
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* net/uip/uip_udpconn.c
|
* net/uip/uip_udpconn.c
|
||||||
*
|
*
|
||||||
* Copyright (C) 2007-2009, 2011 Gregory Nutt. All rights reserved.
|
* Copyright (C) 2007-2009, 2011-2012 Gregory Nutt. All rights reserved.
|
||||||
* Author: Gregory Nutt <spudmonkey@racsa.co.cr>
|
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||||
*
|
*
|
||||||
* Large parts of this file were leveraged from uIP logic:
|
* Large parts of this file were leveraged from uIP logic:
|
||||||
*
|
*
|
||||||
@@ -313,6 +313,7 @@ struct uip_udp_conn *uip_udpactive(struct uip_udpip_hdr *buf)
|
|||||||
uiphdr_ipaddr_cmp(buf->srcipaddr, &conn->ripaddr)))
|
uiphdr_ipaddr_cmp(buf->srcipaddr, &conn->ripaddr)))
|
||||||
{
|
{
|
||||||
/* Matching connection found.. return a reference to it */
|
/* Matching connection found.. return a reference to it */
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user