예제 #1
0
 public void xdrDecode(XdrDecodingStream xdr)
 {
     this._file = new NFSHandle();
     this._file.Version = V3.RPC.NFSv3Protocol.NFS_V3;
     this._file.xdrDecode(xdr);
     this._link = new ItemOperationArguments(xdr);
 }
예제 #2
0
 public void xdrDecode(XdrDecodingStream xdr)
 {
     this._file         = new NFSHandle();
     this._file.Version = V3.RPC.NFSv3Protocol.NFS_V3;
     this._file.xdrDecode(xdr);
     this._link = new ItemOperationArguments(xdr);
 }
        /**
         * Call remote procedure NFSPROC3_RMDIR_3.
         * @param arg1 parameter (of type RMDIR3args) to the remote procedure call.
         * @return Result from remote procedure call (of type RMDIR3res).
         * @throws OncRpcException if an ONC/RPC error occurs.
         * @throws IOException if an I/O error occurs.
         */
        public ResultObject <RemoveAccessOK, RemoveAccessFAIL> NFSPROC3_RMDIR(ItemOperationArguments arg1)
        {
            ResultObject <RemoveAccessOK, RemoveAccessFAIL> result_ =
                new ResultObject <RemoveAccessOK, RemoveAccessFAIL>();

            client.call(NFSv3Protocol.NFSPROC3_RMDIR, NFSv3Protocol.NFS_V3, arg1, result_);

            return(result_);
        }
예제 #4
0
        /**
         * Call remote procedure NFSPROC3_RMDIR_3.
         * @param arg1 parameter (of type RMDIR3args) to the remote procedure call.
         * @return Result from remote procedure call (of type RMDIR3res).
         * @throws OncRpcException if an ONC/RPC error occurs.
         * @throws IOException if an I/O error occurs.
         */
        public ResultObject<RemoveAccessOK, RemoveAccessFAIL> NFSPROC3_RMDIR(ItemOperationArguments arg1)
        {
            ResultObject<RemoveAccessOK, RemoveAccessFAIL> result_ = 
                new ResultObject<RemoveAccessOK, RemoveAccessFAIL>();

            client.call(NFSv3Protocol.NFSPROC3_RMDIR, NFSv3Protocol.NFS_V3, arg1, result_);

            return result_;
        }
예제 #5
0
 public void xdrDecode(XdrDecodingStream xdr)
 {
     this._where = new ItemOperationArguments(xdr);
     this._attributes = new MakeAttributes(xdr);
 }
예제 #6
0
 public void xdrDecode(XdrDecodingStream xdr)
 {
     this._where = new ItemOperationArguments(xdr);
     this._how   = new MakeFileHow(xdr);
 }
예제 #7
0
        /**
         * Call remote procedure NFSPROC3_LOOKUP_3.
         * @param arg1 parameter (of type LOOKUP3args) to the remote procedure call.
         * @return Result from remote procedure call (of type LOOKUP3res).
         * @throws OncRpcException if an ONC/RPC error occurs.
         * @throws IOException if an I/O error occurs.
         */
        public ResultObject<ItemOperationAccessResultOK, ItemOperationAccessResultFAIL> NFSPROC3_LOOKUP(ItemOperationArguments arg1)
        {
            ResultObject<ItemOperationAccessResultOK, ItemOperationAccessResultFAIL> result_ = 
                new ResultObject<ItemOperationAccessResultOK, ItemOperationAccessResultFAIL>();

            client.call(NFSv3Protocol.NFSPROC3_LOOKUP, NFSv3Protocol.NFS_V3, arg1, result_);

            return result_;
        }
예제 #8
0
        public NFSAttributes GetItemAttributes(string ItemFullName, bool ThrowExceptionIfNotFound = true)
        {
            if (_ProtocolV3 == null)
            { throw new NFSConnectionException("NFS Client not connected!"); }

            if (_MountProtocolV3 == null)
            { throw new NFSMountConnectionException("NFS Device not connected!"); }

            NFSAttributes attributes = null;

            if (String.IsNullOrEmpty(ItemFullName))
                ItemFullName = ".";

            NFSHandle currentItem = _RootDirectoryHandleObject;
            String[] PathTree = ItemFullName.Split(@"\".ToCharArray());

            for (int pC = 0; pC < PathTree.Length; pC++)
            {
                ItemOperationArguments dpDrArgs = new ItemOperationArguments();
                dpDrArgs.Directory = currentItem;
                dpDrArgs.Name = new Name(PathTree[pC]);

                ResultObject<ItemOperationAccessResultOK, ItemOperationAccessResultFAIL> pDirOpRes =
                    _ProtocolV3.NFSPROC3_LOOKUP(dpDrArgs);

                if (pDirOpRes != null &&
                    pDirOpRes.Status == NFSStats.NFS_OK)
                {
                    currentItem = pDirOpRes.OK.ItemHandle;

                    if (PathTree.Length - 1 == pC)
                    {
                        attributes = new NFSAttributes(
                                        pDirOpRes.OK.ItemAttributes.Attributes.CreateTime.Seconds,
                                        pDirOpRes.OK.ItemAttributes.Attributes.LastAccessedTime.Seconds,
                                        pDirOpRes.OK.ItemAttributes.Attributes.ModifiedTime.Seconds,
                                        pDirOpRes.OK.ItemAttributes.Attributes.Type,
                                        pDirOpRes.OK.ItemAttributes.Attributes.Mode,
                                        pDirOpRes.OK.ItemAttributes.Attributes.Size,
                                        pDirOpRes.OK.ItemHandle.Value);
                    }
                }
                else
                {
                    if (pDirOpRes == null || pDirOpRes.Status == NFSStats.NFSERR_NOENT)
                    { attributes = null; break; }

                    if(ThrowExceptionIfNotFound)
                        ExceptionHelpers.ThrowException(pDirOpRes.Status);
                }
            }

            return attributes;
        }
        public void dispatchOncRpcCall(OncRpcCallInformation call, int program, int version, int procedure)
        {
            if (version == 3)
            {
                switch (procedure)
                {
                case 0:
                {
                    call.retrieveCall(XdrVoid.XDR_VOID);
                    NFSPROC3_NULL();
                    call.reply(XdrVoid.XDR_VOID);

                    break;
                }

                case 1:
                {
                    GetAttributeArguments args_ = new GetAttributeArguments();
                    call.retrieveCall(args_);

                    ResultObject <GetAttributeAccessOK, GetAttributeAccessOK> result_ =
                        NFSPROC3_GETATTR(args_);
                    call.reply(result_);

                    break;
                }

                case 2:
                {
                    SetAttributeArguments args_ = new SetAttributeArguments();
                    call.retrieveCall(args_);

                    ResultObject <SetAttributeAccessOK, SetAttributeAccessFAIL> result_ =
                        NFSPROC3_SETATTR(args_);
                    call.reply(result_);

                    break;
                }

                case 3:
                {
                    ItemOperationArguments args_ = new ItemOperationArguments();
                    call.retrieveCall(args_);

                    ResultObject <ItemOperationAccessResultOK, ItemOperationAccessResultFAIL> result_ =
                        NFSPROC3_LOOKUP(args_);
                    call.reply(result_);

                    break;
                }

                case 4:
                {
                    AccessArguments args_ = new AccessArguments();
                    call.retrieveCall(args_);

                    ResultObject <AccessAccessOK, AccessAccessFAIL> result_ =
                        NFSPROC3_ACCESS(args_);
                    call.reply(result_);

                    break;
                }

                case 5:
                {
                    ReadLinkArguments args_ = new ReadLinkArguments();
                    call.retrieveCall(args_);

                    ResultObject <ReadLinkAccessOK, ReadLinkAccessFAIL> result_ =
                        NFSPROC3_READLINK(args_);
                    call.reply(result_);

                    break;
                }

                case 6:
                {
                    ReadArguments args_ = new ReadArguments();
                    call.retrieveCall(args_);

                    ResultObject <ReadAccessOK, ReadAccessFAIL> result_ =
                        NFSPROC3_READ(args_);
                    call.reply(result_);

                    break;
                }

                case 7:
                {
                    WriteArguments args_ = new WriteArguments();
                    call.retrieveCall(args_);

                    ResultObject <WriteAccessOK, WriteAccessFAIL> result_ =
                        NFSPROC3_WRITE(args_);
                    call.reply(result_);

                    break;
                }

                case 8:
                {
                    MakeFileArguments args_ = new MakeFileArguments();
                    call.retrieveCall(args_);

                    ResultObject <MakeFileAccessOK, MakeFileAccessFAIL> result_ =
                        NFSPROC3_CREATE(args_);
                    call.reply(result_);

                    break;
                }

                case 9:
                {
                    MakeFolderArguments args_ = new MakeFolderArguments();
                    call.retrieveCall(args_);

                    ResultObject <MakeFolderAccessOK, MakeFolderAccessFAIL> result_ =
                        NFSPROC3_MKDIR(args_);
                    call.reply(result_);

                    break;
                }

                case 10:
                {
                    SymlinkArguments args_ = new SymlinkArguments();
                    call.retrieveCall(args_);

                    ResultObject <SymlinkAccessOK, SymlinkAccessFAIL> result_ =
                        NFSPROC3_SYMLINK(args_);
                    call.reply(result_);

                    break;
                }

                case 11:
                {
                    MakeNodeArguments args_ = new MakeNodeArguments();
                    call.retrieveCall(args_);

                    ResultObject <MakeNodeAccessOK, MakeNodeAccessFAIL> result_ =
                        NFSPROC3_MKNOD(args_);
                    call.reply(result_);

                    break;
                }

                case 12:
                {
                    ItemOperationArguments args_ = new ItemOperationArguments();
                    call.retrieveCall(args_);

                    ResultObject <RemoveAccessOK, RemoveAccessFAIL> result_ =
                        NFSPROC3_REMOVE(args_);
                    call.reply(result_);

                    break;
                }

                case 13:
                {
                    ItemOperationArguments args_ = new ItemOperationArguments();
                    call.retrieveCall(args_);

                    ResultObject <RemoveAccessOK, RemoveAccessFAIL> result_ =
                        NFSPROC3_RMDIR(args_);
                    call.reply(result_);

                    break;
                }

                case 14:
                {
                    RenameArguments args_ = new RenameArguments();
                    call.retrieveCall(args_);

                    ResultObject <RenameAccessOK, RenameAccessFAIL> result_ =
                        NFSPROC3_RENAME(args_);
                    call.reply(result_);

                    break;
                }

                case 15:
                {
                    LinkArguments args_ = new LinkArguments();
                    call.retrieveCall(args_);

                    ResultObject <LinkAccessOK, LinkAccessFAIL> result_ =
                        NFSPROC3_LINK(args_);
                    call.reply(result_);

                    break;
                }

                case 16:
                {
                    ReadFolderArguments args_ = new ReadFolderArguments();
                    call.retrieveCall(args_);

                    ResultObject <ReadFolderAccessResultOK, ReadFolderAccessResultFAIL> result_ =
                        NFSPROC3_READDIR(args_);
                    call.reply(result_);

                    break;
                }

                case 17:
                {
                    ExtendedReadFolderArguments args_ = new ExtendedReadFolderArguments();
                    call.retrieveCall(args_);

                    ResultObject <ExtendedReadFolderAccessOK, ExtendedReadFolderAccessFAIL> result_ =
                        NFSPROC3_READDIRPLUS(args_);
                    call.reply(result_);

                    break;
                }

                case 18:
                {
                    FSStatisticsArguments args_ = new FSStatisticsArguments();
                    call.retrieveCall(args_);

                    ResultObject <FSStatisticsAccessOK, FSStatisticsAccessFAIL> result_ = NFSPROC3_FSSTAT(args_);
                    call.reply(result_);

                    break;
                }

                case 19:
                {
                    FSInfoArguments args_ = new FSInfoArguments();
                    call.retrieveCall(args_);

                    ResultObject <FSInfoAccessOK, FSInfoAccessFAIL> result_ =
                        NFSPROC3_FSINFO(args_);
                    call.reply(result_);

                    break;
                }

                case 20:
                {
                    PathConfigurationArguments args_ = new PathConfigurationArguments();
                    call.retrieveCall(args_);

                    ResultObject <PathConfigurationAccessOK, PathConfigurationAccessFAIL> result_ =
                        NFSPROC3_PATHCONF(args_);
                    call.reply(result_);

                    break;
                }

                case 21:
                {
                    CommitArguments args_ = new CommitArguments();
                    call.retrieveCall(args_);

                    ResultObject <CommitAccessOK, CommitAccessFAIL> result_ =
                        NFSPROC3_COMMIT(args_);
                    call.reply(result_);

                    break;
                }

                default:
                    call.failProcedureUnavailable();
                    break;
                }
            }
            else
            {
                call.failProgramUnavailable();
            }
        }
예제 #10
0
 public void xdrDecode(XdrDecodingStream xdr)
 {
     this._where = new ItemOperationArguments(xdr);
     this._how = new MakeFileHow(xdr);
 }
예제 #11
0
 public void xdrDecode(XdrDecodingStream xdr)
 {
     this._from = new ItemOperationArguments(xdr);
     this._to   = new ItemOperationArguments(xdr);
 }
예제 #12
0
 public void xdrDecode(XdrDecodingStream xdr)
 {
     this._where   = new ItemOperationArguments(xdr);
     this._symlink = new SymlinkData(xdr);
 }
예제 #13
0
        /**
         * Call remote procedure NFSPROC3_LOOKUP_3.
         * @param arg1 parameter (of type LOOKUP3args) to the remote procedure call.
         * @return Result from remote procedure call (of type LOOKUP3res).
         * @throws OncRpcException if an ONC/RPC error occurs.
         * @throws IOException if an I/O error occurs.
         */
        public ResultObject <ItemOperationAccessResultOK, ItemOperationAccessResultFAIL> NFSPROC3_LOOKUP(ItemOperationArguments arg1)
        {
            ResultObject <ItemOperationAccessResultOK, ItemOperationAccessResultFAIL> result_ =
                new ResultObject <ItemOperationAccessResultOK, ItemOperationAccessResultFAIL>();

            client.call(NFSv3Protocol.NFSPROC3_LOOKUP, NFSv3Protocol.NFS_V3, arg1, result_);

            return(result_);
        }
예제 #14
0
 public void xdrDecode(XdrDecodingStream xdr)
 {
     this._where = new ItemOperationArguments(xdr);
     this._symlink = new SymlinkData(xdr);
 }
예제 #15
0
        public void dispatchOncRpcCall(OncRpcCallInformation call, int program, int version, int procedure)
        {
            if (version == 3)
            {
                switch (procedure)
                {
                    case 0:
                        {
                            call.retrieveCall(XdrVoid.XDR_VOID);
                            NFSPROC3_NULL();
                            call.reply(XdrVoid.XDR_VOID);

                            break;
                        }
                    case 1:
                        {
                            GetAttributeArguments args_ = new GetAttributeArguments();
                            call.retrieveCall(args_);

                            ResultObject<GetAttributeAccessOK, GetAttributeAccessOK> result_ =
                                NFSPROC3_GETATTR(args_);
                            call.reply(result_);

                            break;
                        }
                    case 2:
                        {
                            SetAttributeArguments args_ = new SetAttributeArguments();
                            call.retrieveCall(args_);

                            ResultObject<SetAttributeAccessOK, SetAttributeAccessFAIL> result_ =
                                NFSPROC3_SETATTR(args_);
                            call.reply(result_);

                            break;
                        }
                    case 3:
                        {
                            ItemOperationArguments args_ = new ItemOperationArguments();
                            call.retrieveCall(args_);

                            ResultObject<ItemOperationAccessResultOK, ItemOperationAccessResultFAIL> result_ =
                                NFSPROC3_LOOKUP(args_);
                            call.reply(result_);

                            break;
                        }
                    case 4:
                        {
                            AccessArguments args_ = new AccessArguments();
                            call.retrieveCall(args_);

                            ResultObject<AccessAccessOK, AccessAccessFAIL> result_ =
                                NFSPROC3_ACCESS(args_);
                            call.reply(result_);

                            break;
                        }
                    case 5:
                        {
                            ReadLinkArguments args_ = new ReadLinkArguments();
                            call.retrieveCall(args_);

                            ResultObject<ReadLinkAccessOK, ReadLinkAccessFAIL> result_ =
                                NFSPROC3_READLINK(args_);
                            call.reply(result_);

                            break;
                        }
                    case 6:
                        {
                            ReadArguments args_ = new ReadArguments();
                            call.retrieveCall(args_);

                            ResultObject<ReadAccessOK, ReadAccessFAIL> result_ =
                                NFSPROC3_READ(args_);
                            call.reply(result_);

                            break;
                        }
                    case 7:
                        {
                            WriteArguments args_ = new WriteArguments();
                            call.retrieveCall(args_);

                            ResultObject<WriteAccessOK, WriteAccessFAIL> result_ =
                                NFSPROC3_WRITE(args_);
                            call.reply(result_);

                            break;
                        }
                    case 8:
                        {
                            MakeFileArguments args_ = new MakeFileArguments();
                            call.retrieveCall(args_);

                            ResultObject<MakeFileAccessOK, MakeFileAccessFAIL> result_ =
                                NFSPROC3_CREATE(args_);
                            call.reply(result_);

                            break;
                        }
                    case 9:
                        {
                            MakeFolderArguments args_ = new MakeFolderArguments();
                            call.retrieveCall(args_);

                            ResultObject<MakeFolderAccessOK, MakeFolderAccessFAIL> result_ =
                                NFSPROC3_MKDIR(args_);
                            call.reply(result_);

                            break;
                        }
                    case 10:
                        {
                            SymlinkArguments args_ = new SymlinkArguments();
                            call.retrieveCall(args_);

                            ResultObject<SymlinkAccessOK, SymlinkAccessFAIL> result_ =
                                NFSPROC3_SYMLINK(args_);
                            call.reply(result_);

                            break;
                        }
                    case 11:
                        {
                            MakeNodeArguments args_ = new MakeNodeArguments();
                            call.retrieveCall(args_);

                            ResultObject<MakeNodeAccessOK, MakeNodeAccessFAIL> result_ =
                                NFSPROC3_MKNOD(args_);
                            call.reply(result_);

                            break;
                        }
                    case 12:
                        {
                            ItemOperationArguments args_ = new ItemOperationArguments();
                            call.retrieveCall(args_);

                            ResultObject<RemoveAccessOK, RemoveAccessFAIL> result_ =
                                NFSPROC3_REMOVE(args_);
                            call.reply(result_);

                            break;
                        }
                    case 13:
                        {
                            ItemOperationArguments args_ = new ItemOperationArguments();
                            call.retrieveCall(args_);

                            ResultObject<RemoveAccessOK, RemoveAccessFAIL> result_ =
                                NFSPROC3_RMDIR(args_);
                            call.reply(result_);

                            break;
                        }
                    case 14:
                        {
                            RenameArguments args_ = new RenameArguments();
                            call.retrieveCall(args_);

                            ResultObject<RenameAccessOK, RenameAccessFAIL> result_ =
                                NFSPROC3_RENAME(args_);
                            call.reply(result_);

                            break;
                        }
                    case 15:
                        {
                            LinkArguments args_ = new LinkArguments();
                            call.retrieveCall(args_);

                            ResultObject<LinkAccessOK, LinkAccessFAIL> result_ =
                                NFSPROC3_LINK(args_);
                            call.reply(result_);

                            break;
                        }
                    case 16:
                        {
                            ReadFolderArguments args_ = new ReadFolderArguments();
                            call.retrieveCall(args_);

                            ResultObject<ReadFolderAccessResultOK, ReadFolderAccessResultFAIL> result_ =
                                NFSPROC3_READDIR(args_);
                            call.reply(result_);

                            break;
                        }
                    case 17:
                        {
                            ExtendedReadFolderArguments args_ = new ExtendedReadFolderArguments();
                            call.retrieveCall(args_);

                            ResultObject<ExtendedReadFolderAccessOK, ExtendedReadFolderAccessFAIL> result_ =
                                NFSPROC3_READDIRPLUS(args_);
                            call.reply(result_);

                            break;
                        }
                    case 18:
                        {
                            FSStatisticsArguments args_ = new FSStatisticsArguments();
                            call.retrieveCall(args_);

                            ResultObject<FSStatisticsAccessOK, FSStatisticsAccessFAIL> result_ = NFSPROC3_FSSTAT(args_);
                            call.reply(result_);

                            break;
                        }
                    case 19:
                        {
                            FSInfoArguments args_ = new FSInfoArguments();
                            call.retrieveCall(args_);

                            ResultObject<FSInfoAccessOK, FSInfoAccessFAIL> result_ =
                                NFSPROC3_FSINFO(args_);
                            call.reply(result_);

                            break;
                        }
                    case 20:
                        {
                            PathConfigurationArguments args_ = new PathConfigurationArguments();
                            call.retrieveCall(args_);

                            ResultObject<PathConfigurationAccessOK, PathConfigurationAccessFAIL> result_ =
                                NFSPROC3_PATHCONF(args_);
                            call.reply(result_);

                            break;
                        }
                    case 21:
                        {
                            CommitArguments args_ = new CommitArguments();
                            call.retrieveCall(args_);

                            ResultObject<CommitAccessOK, CommitAccessFAIL> result_ =
                                NFSPROC3_COMMIT(args_);
                            call.reply(result_);

                            break;
                        }
                    default:
                        call.failProcedureUnavailable();
                        break;
                }
            }
            else
            {
                call.failProgramUnavailable();
            }
        }
예제 #16
0
 public abstract ResultObject<RemoveAccessOK, RemoveAccessFAIL> NFSPROC3_RMDIR(ItemOperationArguments arg1);
예제 #17
0
 public abstract ResultObject<ItemOperationAccessResultOK, ItemOperationAccessResultFAIL> NFSPROC3_LOOKUP(ItemOperationArguments arg1);
예제 #18
0
        public void DeleteFile(string FileFullName)
        {
            if (_ProtocolV3 == null)
            { throw new NFSConnectionException("NFS Client not connected!"); }

            if (_MountProtocolV3 == null)
            { throw new NFSMountConnectionException("NFS Device not connected!"); }

            string ParentDirectory = System.IO.Path.GetDirectoryName(FileFullName);
            string FileName = System.IO.Path.GetFileName(FileFullName);

            NFSAttributes ParentItemAttributes = GetItemAttributes(ParentDirectory);

            ItemOperationArguments dpArgDelete = new ItemOperationArguments();
            dpArgDelete.Directory = new NFSHandle(ParentItemAttributes.Handle, V3.RPC.NFSv3Protocol.NFS_V3);
            dpArgDelete.Name = new Name(FileName);

            ResultObject<RemoveAccessOK, RemoveAccessFAIL> pRemoveRes =
                _ProtocolV3.NFSPROC3_REMOVE(dpArgDelete);

            if (pRemoveRes == null || pRemoveRes.Status != NFSStats.NFS_OK)
            {
                if (pRemoveRes == null)
                { throw new NFSGeneralException("NFSPROC3_REMOVE: failure"); }

                ExceptionHelpers.ThrowException(pRemoveRes.Status);
            }
        }
예제 #19
0
 public void xdrDecode(XdrDecodingStream xdr)
 {
     this._where = new ItemOperationArguments(xdr);
     this._what = new MakeNodeData(xdr);
 }
 public abstract ResultObject <ItemOperationAccessResultOK, ItemOperationAccessResultFAIL> NFSPROC3_LOOKUP(ItemOperationArguments arg1);
예제 #21
0
 public void xdrDecode(XdrDecodingStream xdr)
 {
     this._where = new ItemOperationArguments(xdr);
     this._what  = new MakeNodeData(xdr);
 }
 public abstract ResultObject <RemoveAccessOK, RemoveAccessFAIL> NFSPROC3_RMDIR(ItemOperationArguments arg1);
예제 #23
0
 public void xdrDecode(XdrDecodingStream xdr)
 {
     this._from = new ItemOperationArguments(xdr);
     this._to = new ItemOperationArguments(xdr);
 }
예제 #24
0
 public void xdrDecode(XdrDecodingStream xdr)
 {
     this._where      = new ItemOperationArguments(xdr);
     this._attributes = new MakeAttributes(xdr);
 }