Пример #1
0
 public void xdrDecode(XdrDecodingStream xdr)
 {
     this._from         = new NFSHandle();
     this._from.Version = V2.RPC.NFSv2Protocol.NFS_VERSION;
     this._from.xdrDecode(xdr);
     this._to = new ItemOperationArguments(xdr);
 }
Пример #2
0
 public void xdrDecode(XdrDecodingStream xdr)
 {
     this._from = new NFSHandle();
     this._from.Version = V2.RPC.NFSv2Protocol.NFS_VERSION;
     this._from.xdrDecode(xdr);
     this._to = new ItemOperationArguments(xdr);
 }
Пример #3
0
        /**
         * Call remote procedure NFSPROC_LOOKUP_2.
         * @param arg1 parameter (of type diropargs) to the remote procedure call.
         * @return Result from remote procedure call (of type diropres).
         * @throws OncRpcException if an ONC/RPC error occurs.
         * @throws IOException if an I/O error occurs.
         */

        public ItemOperationStatus NFSPROC_LOOKUP(ItemOperationArguments arg1)
        {
            ItemOperationStatus result_ = new ItemOperationStatus();

            client.call(NFSv2Protocol.NFSPROC_LOOKUP, NFSv2Protocol.NFS_VERSION, arg1, result_);

            return(result_);
        }
Пример #4
0
        /**
         * Call remote procedure NFSPROC_RMDIR_2.
         * @param arg1 parameter (of type diropargs) to the remote procedure call.
         * @return Result from remote procedure call (of type nfsstat).
         * @throws OncRpcException if an ONC/RPC error occurs.
         * @throws IOException if an I/O error occurs.
         */

        public int NFSPROC_RMDIR(ItemOperationArguments arg1)
        {
            XdrInt result_ = new XdrInt();

            client.call(NFSv2Protocol.NFSPROC_RMDIR, NFSv2Protocol.NFS_VERSION, arg1, result_);

            return(result_.intValue());
        }
Пример #5
0
        /**
         * Call remote procedure NFSPROC_LOOKUP_2.
         * @param arg1 parameter (of type diropargs) to the remote procedure call.
         * @return Result from remote procedure call (of type diropres).
         * @throws OncRpcException if an ONC/RPC error occurs.
         * @throws IOException if an I/O error occurs.
         */
        public ItemOperationStatus NFSPROC_LOOKUP(ItemOperationArguments arg1)
        {
            ItemOperationStatus result_ = new ItemOperationStatus();

            client.call(NFSv2Protocol.NFSPROC_LOOKUP, NFSv2Protocol.NFS_VERSION, arg1, result_);

            return result_;
        }
 public abstract int NFSPROC_REMOVE(ItemOperationArguments arg1);
Пример #7
0
 public void xdrDecode(XdrDecodingStream xdr)
 {
     this._from = new ItemOperationArguments(xdr);
     this._to = new Name(xdr);
     this._attributes = new CreateAttributes(xdr);
 }
Пример #8
0
 public void xdrDecode(XdrDecodingStream xdr)
 {
     this._from = new ItemOperationArguments(xdr);
     this._to = new ItemOperationArguments(xdr);
 }
Пример #9
0
        public void DeleteFile(string FileFullName)
        {
            if (_ProtocolV2 == null)
            { 
                throw new NFSConnectionException("NFS Client not connected!"); 
            }

            if (_MountProtocolV2 == 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, V2.RPC.NFSv2Protocol.NFS_VERSION);
            dpArgDelete.Name = new Name(FileName);

            NFSStats Status = (NFSStats)_ProtocolV2.NFSPROC_REMOVE(dpArgDelete);

            if (Status != NFSStats.NFS_OK)
            { 
                ExceptionHelpers.ThrowException(Status); 
            }
        }
Пример #10
0
        public NFSAttributes GetItemAttributes(String ItemFullName, bool ThrowExceptionIfNotFound = true)
        {
            if (_ProtocolV2 == null)
            { 
                throw new NFSConnectionException("NFS Client not connected!"); 
            }

            if (_MountProtocolV2 == 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]);

                ItemOperationStatus pDirOpRes =
                    _ProtocolV2.NFSPROC_LOOKUP(dpDrArgs);

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

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

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

            return attributes;
        }
Пример #11
0
        public void dispatchOncRpcCall(OncRpcCallInformation call, int program, int version, int procedure)
        {
            if (version == 2)
            {
                switch (procedure)
                {
                    case 0:
                        {
                            call.retrieveCall(XdrVoid.XDR_VOID);
                            NFSPROC_NULL();
                            call.reply(XdrVoid.XDR_VOID);

                            break;
                        }
                    case 1:
                        {
                            NFSHandle args_ = new NFSHandle();
                            args_.Version = V2.RPC.NFSv2Protocol.NFS_VERSION;
                            call.retrieveCall(args_);

                            FileStatus result_ = NFSPROC_GETATTR(args_);
                            call.reply(result_);

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

                            FileStatus result_ = NFSPROC_SETATTR(args_);
                            call.reply(result_);

                            break;
                        }
                    case 3:
                        {
                            call.retrieveCall(XdrVoid.XDR_VOID);
                            NFSPROC_ROOT();
                            call.reply(XdrVoid.XDR_VOID);

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

                            ItemOperationStatus result_ = NFSPROC_LOOKUP(args_);
                            call.reply(result_);

                            break;
                        }
                    case 5:
                        {
                            NFSHandle args_ = new NFSHandle();
                            args_.Version = V2.RPC.NFSv2Protocol.NFS_VERSION;
                            call.retrieveCall(args_);

                            LinkStatus result_ = NFSPROC_READLINK(args_);
                            call.reply(result_);

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

                            ReadStatus result_ = NFSPROC_READ(args_);
                            call.reply(result_);

                            break;
                        }
                    case 7:
                        {
                            call.retrieveCall(XdrVoid.XDR_VOID);
                            NFSPROC_WRITECACHE();
                            call.reply(XdrVoid.XDR_VOID);

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

                            FileStatus result_ = NFSPROC_WRITE(args_);
                            call.reply(result_);

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

                            ItemOperationStatus result_ = NFSPROC_CREATE(args_);
                            call.reply(result_);

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

                            XdrInt result_ = new XdrInt(NFSPROC_REMOVE(args_));
                            call.reply(result_);

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

                            XdrInt result_ = new XdrInt(NFSPROC_RENAME(args_));
                            call.reply(result_);

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

                            XdrInt result_ = new XdrInt(NFSPROC_LINK(args_));
                            call.reply(result_);

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

                            XdrInt result_ = new XdrInt(NFSPROC_SYMLINK(args_));
                            call.reply(result_);

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

                            ItemOperationStatus result_ = NFSPROC_MKDIR(args_);
                            call.reply(result_);

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

                            XdrInt result_ = new XdrInt(NFSPROC_RMDIR(args_));
                            call.reply(result_);

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

                            ItemStatus result_ = NFSPROC_READDIR(args_);
                            call.reply(result_);

                            break;
                        }
                    case 17:
                        {
                            NFSHandle args_ = new NFSHandle();
                            args_.Version = V2.RPC.NFSv2Protocol.NFS_VERSION;
                            call.retrieveCall(args_);

                            FSStatStatus result_ = NFSPROC_STATFS(args_);
                            call.reply(result_);

                            break;
                        }
                    default:
                        {
                            call.failProcedureUnavailable();

                            break;
                        }
                }
            }
            else
            { call.failProgramUnavailable(); }
        }
Пример #12
0
 public abstract ItemOperationStatus NFSPROC_LOOKUP(ItemOperationArguments arg1);
Пример #13
0
 public void xdrDecode(XdrDecodingStream xdr)
 {
     this._from = new ItemOperationArguments(xdr);
     this._to   = new ItemOperationArguments(xdr);
 }
        public void dispatchOncRpcCall(OncRpcCallInformation call, int program, int version, int procedure)
        {
            if (version == 2)
            {
                switch (procedure)
                {
                case 0:
                {
                    call.retrieveCall(XdrVoid.XDR_VOID);
                    NFSPROC_NULL();
                    call.reply(XdrVoid.XDR_VOID);

                    break;
                }

                case 1:
                {
                    NFSHandle args_ = new NFSHandle();
                    args_.Version = V2.RPC.NFSv2Protocol.NFS_VERSION;
                    call.retrieveCall(args_);

                    FileStatus result_ = NFSPROC_GETATTR(args_);
                    call.reply(result_);

                    break;
                }

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

                    FileStatus result_ = NFSPROC_SETATTR(args_);
                    call.reply(result_);

                    break;
                }

                case 3:
                {
                    call.retrieveCall(XdrVoid.XDR_VOID);
                    NFSPROC_ROOT();
                    call.reply(XdrVoid.XDR_VOID);

                    break;
                }

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

                    ItemOperationStatus result_ = NFSPROC_LOOKUP(args_);
                    call.reply(result_);

                    break;
                }

                case 5:
                {
                    NFSHandle args_ = new NFSHandle();
                    args_.Version = V2.RPC.NFSv2Protocol.NFS_VERSION;
                    call.retrieveCall(args_);

                    LinkStatus result_ = NFSPROC_READLINK(args_);
                    call.reply(result_);

                    break;
                }

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

                    ReadStatus result_ = NFSPROC_READ(args_);
                    call.reply(result_);

                    break;
                }

                case 7:
                {
                    call.retrieveCall(XdrVoid.XDR_VOID);
                    NFSPROC_WRITECACHE();
                    call.reply(XdrVoid.XDR_VOID);

                    break;
                }

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

                    FileStatus result_ = NFSPROC_WRITE(args_);
                    call.reply(result_);

                    break;
                }

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

                    ItemOperationStatus result_ = NFSPROC_CREATE(args_);
                    call.reply(result_);

                    break;
                }

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

                    XdrInt result_ = new XdrInt(NFSPROC_REMOVE(args_));
                    call.reply(result_);

                    break;
                }

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

                    XdrInt result_ = new XdrInt(NFSPROC_RENAME(args_));
                    call.reply(result_);

                    break;
                }

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

                    XdrInt result_ = new XdrInt(NFSPROC_LINK(args_));
                    call.reply(result_);

                    break;
                }

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

                    XdrInt result_ = new XdrInt(NFSPROC_SYMLINK(args_));
                    call.reply(result_);

                    break;
                }

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

                    ItemOperationStatus result_ = NFSPROC_MKDIR(args_);
                    call.reply(result_);

                    break;
                }

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

                    XdrInt result_ = new XdrInt(NFSPROC_RMDIR(args_));
                    call.reply(result_);

                    break;
                }

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

                    ItemStatus result_ = NFSPROC_READDIR(args_);
                    call.reply(result_);

                    break;
                }

                case 17:
                {
                    NFSHandle args_ = new NFSHandle();
                    args_.Version = V2.RPC.NFSv2Protocol.NFS_VERSION;
                    call.retrieveCall(args_);

                    FSStatStatus result_ = NFSPROC_STATFS(args_);
                    call.reply(result_);

                    break;
                }

                default:
                {
                    call.failProcedureUnavailable();

                    break;
                }
                }
            }
            else
            {
                call.failProgramUnavailable();
            }
        }
 public abstract int NFSPROC_RMDIR(ItemOperationArguments arg1);
 public abstract int NFSPROC_REMOVE(ItemOperationArguments arg1);
 public abstract ItemOperationStatus NFSPROC_LOOKUP(ItemOperationArguments arg1);
Пример #18
0
        /**
         * Call remote procedure NFSPROC_RMDIR_2.
         * @param arg1 parameter (of type diropargs) to the remote procedure call.
         * @return Result from remote procedure call (of type nfsstat).
         * @throws OncRpcException if an ONC/RPC error occurs.
         * @throws IOException if an I/O error occurs.
         */
        public int NFSPROC_RMDIR(ItemOperationArguments arg1)
        {
            XdrInt result_ = new XdrInt();

            client.call(NFSv2Protocol.NFSPROC_RMDIR, NFSv2Protocol.NFS_VERSION, arg1, result_);

            return result_.intValue();
        }
Пример #19
0
 public void xdrDecode(XdrDecodingStream xdr)
 {
     this._from       = new ItemOperationArguments(xdr);
     this._to         = new Name(xdr);
     this._attributes = new CreateAttributes(xdr);
 }
Пример #20
0
 public abstract int NFSPROC_RMDIR(ItemOperationArguments arg1);