/*
 * 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.V2.RPC.Mount
{
    public class MountList : XdrAble
    {
        private MountBody _value;

        public MountList()
        { }

        public MountList(MountBody value)
        { this._value = value; }

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

        public void xdrEncode(XdrEncodingStream xdr)
        {
            if (this._value != null)
            {
                xdr.xdrEncodeBoolean(true);
                this._value.xdrEncode(xdr);
            }
            else { xdr.xdrEncodeBoolean(false); };
        }

        public void xdrDecode(XdrDecodingStream xdr)
        {
            this._value = xdr.xdrDecodeBoolean() ? new MountBody(xdr) : null;
        }

        public MountBody Value
        {
            get
            { return this._value; }
        }
    }

    public class MountBody : XdrAble
    {
        private Name _hostname;
        private NFSHandle _directory;
        private MountList _nextentry;

        public MountBody()
        { }

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

        public void xdrEncode(XdrEncodingStream xdr)
        {
            this._hostname.xdrEncode(xdr);
            this._directory.xdrEncode(xdr);
            this._nextentry.xdrEncode(xdr);
        }

        public void xdrDecode(XdrDecodingStream xdr)
        {
            this._hostname = new Name(xdr);
            this._directory = new NFSHandle();
            this._directory.Version = V2.RPC.NFSv2Protocol.NFS_VERSION;
            this._directory.xdrDecode(xdr);
            this._nextentry = new MountList(xdr);
        }

        public Name HostName
        {
            get
            { return this._hostname; }
        }

        public NFSHandle Directory
        {
            get
            { return this._directory; }
        }

        public MountList NextEntry
        {
            get
            { return this._nextentry; }
        }
    }
    // End of mountlist.cs
}