public List <String> GetItemListByFH(nfs_fh4 dir_fh) { //should return result int acess = get_fh_acess(dir_fh); List <string> ItemsList = new List <string>(); //has read acess if (acess % 2 == 1) { bool done = false; long cookie = 0; verifier4 verifier = new verifier4(0); do { List <nfs_argop4> ops = new List <nfs_argop4>(); ops.Add(SequenceStub.generateRequest(false, _sessionid.value, _sequenceID.value.value, 12, 0)); ops.Add(PutfhStub.generateRequest(dir_fh)); ops.Add(ReadDirStub.generateRequest(cookie, verifier)); COMPOUND4res compound4res = sendCompound(ops, ""); if (compound4res.status == nfsstat4.NFS4_OK) { verifier = compound4res.resarray[2].opreaddir.resok4.cookieverf; done = compound4res.resarray[2].opreaddir.resok4.reply.eof; entry4 dirEntry = compound4res.resarray[2].opreaddir.resok4.reply.entries; while (dirEntry != null) { cookie = dirEntry.cookie.value.value; string name = System.Text.Encoding.UTF8.GetString(dirEntry.name.value.value.value); ItemsList.Add(name); dirEntry = dirEntry.nextentry; } } else { throw new NFSGeneralException(nfsstat4.getErrorString(compound4res.status)); } } while (!done); //now do the lookups (maintained by the nfsclient) } else { throw new NFSGeneralException(nfsstat4.getErrorString(nfsstat4.NFS4ERR_ACCESS)); } return(ItemsList); }
public static nfs_argop4 generateRequest(long cookie, verifier4 verifier) { nfs_argop4 op = new nfs_argop4(); op.opreaddir = new READDIR4args(); op.opreaddir.cookie = new nfs_cookie4(new uint64_t(cookie)); op.opreaddir.dircount = new count4(new uint32_t(10000)); op.opreaddir.maxcount = new count4(new uint32_t(10000)); op.opreaddir.attr_request = new bitmap4(new uint32_t[] { new uint32_t(0), new uint32_t(0) }); op.opreaddir.cookieverf = verifier; op.argop = nfs_opnum4.OP_READDIR; return(op); }
public static nfs_argop4 generateRequest(long cookie, verifier4 verifier) { nfs_argop4 op = new nfs_argop4(); op.opreaddir = new READDIR4args(); op.opreaddir.cookie = new nfs_cookie4(new uint64_t(cookie)); op.opreaddir.dircount = new count4(new uint32_t(10000)); op.opreaddir.maxcount = new count4(new uint32_t(10000)); op.opreaddir.attr_request = new bitmap4(new uint32_t[] { new uint32_t(0), new uint32_t(0) }); op.opreaddir.cookieverf = verifier; op.argop = nfs_opnum4.OP_READDIR; return op; }
public void xdrDecode(XdrDecodingStream xdr) { nv_new_cookieverf = new verifier4(xdr); }