/*
 * Automatically generated by jrpcgen 1.0.7 on 29.11.2012
 * jrpcgen is part of the "Remote Tea.Net" ONC/RPC package for C#
 * See http://remotetea.sourceforge.net for details
 */
using NFSLibrary.Protocols.Commons;
using org.acplt.oncrpc;

namespace NFSLibrary.Protocols.V3.RPC.Mount
{
    public class MountStatus : XdrAble
    {
        private NFSMountStats _fhs_status;
        private MountAccessOK _mountinfo;

        public MountStatus()
        { }

        public MountStatus(XdrDecodingStream xdr)
        { xdrDecode(xdr); }

        public void xdrEncode(XdrEncodingStream xdr)
        {
            xdr.xdrEncodeInt((int)this._fhs_status);

            switch (this._fhs_status)
            {
                case NFSMountStats.MNT_OK:
                    this._mountinfo.xdrEncode(xdr);
                    break;
                default:
                    break;
            }
        }

        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;
            }
        }

        public NFSMountStats Status
        {
            get
            { return this._fhs_status; }
        }

        public MountAccessOK MountInfo
        {
            get
            { return this._mountinfo; }
        }
    }

    public class MountAccessOK : XdrAble
    {
        private NFSHandle _fhandle;
        private int[] _auth_flavors;

        public MountAccessOK()
        { }

        public MountAccessOK(XdrDecodingStream xdr)
        { xdrDecode(xdr); }

        public void xdrEncode(XdrEncodingStream xdr)
        {
            this._fhandle.Version = NFSv3MountProtocol.MOUNTVERS;
            this._fhandle.xdrEncode(xdr);
            xdr.xdrEncodeIntVector(this._auth_flavors);
        }

        public void xdrDecode(XdrDecodingStream xdr)
        {
            this._fhandle = new NFSHandle();
            this._fhandle.Version = NFSv3MountProtocol.MOUNTVERS;
            this._fhandle.xdrDecode(xdr);
            this._auth_flavors = xdr.xdrDecodeIntVector();
        }

        public NFSHandle MountHandle
        {
            get
            { return this._fhandle; }
        }

        public int[] AuthFlavors
        {
            get
            { return this._auth_flavors; }
        }
    }
    // End of mountres3.cs
}