Ejemplo n.º 1
0
        public void xdrDecode(XdrDecodingStream xdr)
        {
            this._fhs_status = (NFSMountStats)xdr.xdrDecodeInt();

            switch (this._fhs_status)
            {
                case NFSMountStats.MNT_OK:
                    this._mountinfo = new MountAccessOK(xdr);
                    break;
                default:
                    break;
            }
        }
Ejemplo n.º 2
0
        public void xdrDecode(XdrDecodingStream xdr)
        {
            this._fhs_status = (NFSMountStats)xdr.xdrDecodeInt();

            switch (this._fhs_status)
            {
            case NFSMountStats.MNT_OK:
                this._mountinfo = new MountAccessOK(xdr);
                break;

            default:
                break;
            }
        }
Ejemplo n.º 3
0
        public void xdrDecode(XdrDecodingStream xdr)
        {
            this._status = (NFSMountStats)xdr.xdrDecodeInt();

            switch (this._status)
            {
                case NFSMountStats.MNT_OK:
                    this._handle = new NFSHandle();
                    this._handle.Version = V2.RPC.NFSv2Protocol.NFS_VERSION;
                    this._handle.xdrDecode(xdr);

                    break;
                default:
                    break;
            }
        }
Ejemplo n.º 4
0
        public void xdrDecode(XdrDecodingStream xdr)
        {
            this._status = (NFSMountStats)xdr.xdrDecodeInt();

            switch (this._status)
            {
            case NFSMountStats.MNT_OK:
                this._handle         = new NFSHandle();
                this._handle.Version = V2.RPC.NFSv2Protocol.NFS_VERSION;
                this._handle.xdrDecode(xdr);

                break;

            default:
                break;
            }
        }
Ejemplo n.º 5
0
        public static void ThrowException(NFSMountStats ErrorCode)
        {
            if (ErrorCode != NFSMountStats.MNT_OK)
            {
                System.Collections.Generic.Dictionary <NFSMountStats, String> exceptionMessages =
                    MountExceptionHelpers.ExceptionList();

                if (exceptionMessages.ContainsKey(ErrorCode))
                {
                    String Message = exceptionMessages[ErrorCode];

                    switch (ErrorCode)
                    {
                    case NFSMountStats.MNTERR_ACCES:
                        throw new NFSMountAuthenticationException(Message);

                    case NFSMountStats.MNTERR_EXIST:
                    case NFSMountStats.MNTERR_FBIG:
                    case NFSMountStats.MNTERR_IO:
                    case NFSMountStats.MNTERR_ISDIR:
                    case NFSMountStats.MNTERR_NAMETOOLONG:
                    case NFSMountStats.MNTERR_NOENT:
                    case NFSMountStats.MNTERR_NOSPC:
                    case NFSMountStats.MNTERR_NOTDIR:
                    case NFSMountStats.MNTERR_NXIO:
                        throw new NFSMountIOException(Message);

                    case NFSMountStats.MNTERR_PERM:
                    case NFSMountStats.MNTERR_ROFS:
                        throw new NFSMountUnauthorizedAccessException(Message);

                    case NFSMountStats.MNTERR_FAULT:
                    case NFSMountStats.MNTERR_BUSY:
                    case NFSMountStats.MNTERR_AGAIN:
                    case NFSMountStats.MNTERR_SERVERFAULT:
                        throw new NFSMountCommunicationException(Message);

                    case NFSMountStats.MNTERR_TXTBSY:
                    case NFSMountStats.MNTERR_TOOBIG:
                    case NFSMountStats.MNTERR_SRCH:
                    case NFSMountStats.MNTERR_NOTTY:
                    case NFSMountStats.MNTERR_NOTBLK:
                    case NFSMountStats.MNTERR_NOMEM:
                    case NFSMountStats.MNTERR_NOEXEC:
                    case NFSMountStats.MNTERR_INVAL:
                    case NFSMountStats.MNTERR_INTR:
                    case NFSMountStats.MNTERR_CHILD:
                    case NFSMountStats.MNTERR_BADF:
                    case NFSMountStats.MNTERR_XDEV:
                    case NFSMountStats.MNTERR_NOTSUPP:
                    case NFSMountStats.MNTERR_NODEV:
                    case NFSMountStats.MNTERR_MLINK:
                    case NFSMountStats.MNTERR_MFILE:
                    case NFSMountStats.MNTERR_NFILE:
                    case NFSMountStats.MNTERR_PIPE:
                    case NFSMountStats.MNTERR_SPIPE:
                        throw new NFSMountGeneralException(Message);

                    default:
                        throw new NFSMountGeneralException("General Exception Occured!");
                    }
                }
                else
                {
                    throw new NFSMountGeneralException("Unknown Exception Occured!");
                }
            }
        }
Ejemplo n.º 6
0
        public static void ThrowException(NFSMountStats ErrorCode)
        {
            if (ErrorCode != NFSMountStats.MNT_OK)
            {
                System.Collections.Generic.Dictionary<NFSMountStats, String> exceptionMessages =
                    MountExceptionHelpers.ExceptionList();

                if (exceptionMessages.ContainsKey(ErrorCode))
                {
                    String Message = exceptionMessages[ErrorCode];

                    switch (ErrorCode)
                    {
                        case NFSMountStats.MNTERR_ACCES:
                            throw new NFSMountAuthenticationException(Message);
                                                    
                        case NFSMountStats.MNTERR_EXIST:
                        case NFSMountStats.MNTERR_FBIG:
                        case NFSMountStats.MNTERR_IO:
                        case NFSMountStats.MNTERR_ISDIR:
                        case NFSMountStats.MNTERR_NAMETOOLONG:
                        case NFSMountStats.MNTERR_NOENT:
                        case NFSMountStats.MNTERR_NOSPC:
                        case NFSMountStats.MNTERR_NOTDIR:
                        case NFSMountStats.MNTERR_NXIO:
                            throw new NFSMountIOException(Message);

                        case NFSMountStats.MNTERR_PERM:
                        case NFSMountStats.MNTERR_ROFS:
                            throw new NFSMountUnauthorizedAccessException(Message);

                        case NFSMountStats.MNTERR_FAULT:
                        case NFSMountStats.MNTERR_BUSY:
                        case NFSMountStats.MNTERR_AGAIN:
                        case NFSMountStats.MNTERR_SERVERFAULT:
                            throw new NFSMountCommunicationException(Message);

                        case NFSMountStats.MNTERR_TXTBSY:
                        case NFSMountStats.MNTERR_TOOBIG:
                        case NFSMountStats.MNTERR_SRCH:
                        case NFSMountStats.MNTERR_NOTTY:
                        case NFSMountStats.MNTERR_NOTBLK:
                        case NFSMountStats.MNTERR_NOMEM:
                        case NFSMountStats.MNTERR_NOEXEC:
                        case NFSMountStats.MNTERR_INVAL:
                        case NFSMountStats.MNTERR_INTR:
                        case NFSMountStats.MNTERR_CHILD:
                        case NFSMountStats.MNTERR_BADF:
                        case NFSMountStats.MNTERR_XDEV:
                        case NFSMountStats.MNTERR_NOTSUPP:
                        case NFSMountStats.MNTERR_NODEV:
                        case NFSMountStats.MNTERR_MLINK:
                        case NFSMountStats.MNTERR_MFILE:
                        case NFSMountStats.MNTERR_NFILE:
                        case NFSMountStats.MNTERR_PIPE:
                        case NFSMountStats.MNTERR_SPIPE:
                            throw new NFSMountGeneralException(Message);

                        default:
                            throw new NFSMountGeneralException("General Exception Occured!");

                    }
                }
                else
                { throw new NFSMountGeneralException("Unknown Exception Occured!"); }
            }
        }