Exemplo n.º 1
0
 internal PortMap2Mapping(XdrDataReader reader)
 {
     Program  = reader.ReadInt32();
     Version  = reader.ReadInt32();
     Protocol = (PortMap2Protocol)reader.ReadUInt32();
     Port     = reader.ReadUInt32();
 }
Exemplo n.º 2
0
 internal Nfs3ExportResult(XdrDataReader reader)
 {
     Exports = new List <Nfs3Export>();
     while (reader.ReadBool())
     {
         Exports.Add(new Nfs3Export(reader));
     }
 }
Exemplo n.º 3
0
 public RpcCallHeader(XdrDataReader reader)
 {
     RpcVersion  = reader.ReadUInt32();
     Program     = reader.ReadUInt32();
     Version     = reader.ReadUInt32();
     Proc        = reader.ReadInt32();
     Credentials = new RpcAuthentication(reader);
     Verifier    = new RpcAuthentication(reader);
 }
 public RpcAcceptedReplyHeader(XdrDataReader reader)
 {
     Verifier     = new RpcAuthentication(reader);
     AcceptStatus = (RpcAcceptStatus)reader.ReadInt32();
     if (AcceptStatus == RpcAcceptStatus.ProgramVersionMismatch)
     {
         MismatchInfo = new RpcMismatchInfo(reader);
     }
 }
Exemplo n.º 5
0
 internal Nfs3MountResult(XdrDataReader reader)
 {
     FileHandle = new Nfs3FileHandle(reader);
     int numAuthFlavours = reader.ReadInt32();
     AuthFlavours = new List<int>(numAuthFlavours);
     for (int i = 0; i < numAuthFlavours; ++i)
     {
         AuthFlavours.Add(reader.ReadInt32());
     }
 }
Exemplo n.º 6
0
        internal Nfs3AccessResult(XdrDataReader reader)
        {
            Status = (Nfs3Status)reader.ReadInt32();
            if (reader.ReadBool())
            {
                ObjectAttributes = new Nfs3FileAttributes(reader);
            }

            Access = (Nfs3AccessPermissions)reader.ReadInt32();
        }
Exemplo n.º 7
0
        public RpcMessageHeader(XdrDataReader reader)
        {
            TransactionId = reader.ReadUInt32();
            RpcMessageType type = (RpcMessageType)reader.ReadInt32();
            if (type != RpcMessageType.Reply)
            {
                throw new NotSupportedException("Parsing RPC call messages");
            }

            ReplyHeader = new RpcReplyHeader(reader);
        }
Exemplo n.º 8
0
        protected RpcReply DoSend(MemoryStream ms)
        {
            RpcTcpTransport transport = _client.GetTransport(Identifier, Version);

            byte[] buffer = ms.ToArray();
            buffer = transport.Send(buffer);

            XdrDataReader reader = new XdrDataReader(new MemoryStream(buffer));
            RpcMessageHeader header = new RpcMessageHeader(reader);
            return new RpcReply() { Header = header, BodyReader = reader };
        }
Exemplo n.º 9
0
 internal Nfs3WriteResult(XdrDataReader reader)
 {
     Status           = (Nfs3Status)reader.ReadInt32();
     CacheConsistency = new Nfs3WeakCacheConsistency(reader);
     if (Status == Nfs3Status.Ok)
     {
         Count         = reader.ReadInt32();
         HowCommitted  = (Nfs3StableHow)reader.ReadInt32();
         WriteVerifier = reader.ReadUInt64();
     }
 }
        internal Nfs3MountResult(XdrDataReader reader)
        {
            FileHandle = new Nfs3FileHandle(reader);
            int numAuthFlavours = reader.ReadInt32();

            AuthFlavours = new List <int>(numAuthFlavours);
            for (int i = 0; i < numAuthFlavours; ++i)
            {
                AuthFlavours.Add(reader.ReadInt32());
            }
        }
Exemplo n.º 11
0
        internal Nfs3Export(XdrDataReader reader)
        {
            DirPath = reader.ReadString(Nfs3Mount.MaxPathLength);

            List<string> groups = new List<string>();
            while (reader.ReadBool())
            {
                groups.Add(reader.ReadString(Nfs3Mount.MaxNameLength));
            }
            Groups = groups;
        }
Exemplo n.º 12
0
 public RpcReplyHeader(XdrDataReader reader)
 {
     Status = (RpcReplyStatus)reader.ReadInt32();
     if (Status == RpcReplyStatus.Accepted)
     {
         AcceptReply = new RpcAcceptedReplyHeader(reader);
     }
     else
     {
         RejectedReply = new RpcRejectedReplyHeader(reader);
     }
 }
Exemplo n.º 13
0
        internal Nfs3WeakCacheConsistency(XdrDataReader reader)
        {
            if (reader.ReadBool())
            {
                Before = new Nfs3WeakCacheConsistencyAttr(reader);
            }

            if (reader.ReadBool())
            {
                After = new Nfs3FileAttributes(reader);
            }
        }
Exemplo n.º 14
0
 public RpcRejectedReplyHeader(XdrDataReader reader)
 {
     Status = (RpcRejectedStatus)reader.ReadInt32();
     if (Status == RpcRejectedStatus.RpcMismatch)
     {
         MismatchInfo = new RpcMismatchInfo(reader);
     }
     else
     {
         AuthenticationStatus = (RpcAuthenticationStatus)reader.ReadInt32();
     }
 }
Exemplo n.º 15
0
        public RpcMessageHeader(XdrDataReader reader)
        {
            TransactionId = reader.ReadUInt32();
            RpcMessageType type = (RpcMessageType)reader.ReadInt32();

            if (type != RpcMessageType.Reply)
            {
                throw new NotSupportedException("Parsing RPC call messages");
            }

            ReplyHeader = new RpcReplyHeader(reader);
        }
Exemplo n.º 16
0
        internal Nfs3Export(XdrDataReader reader)
        {
            DirPath = reader.ReadString(Nfs3Mount.MaxPathLength);

            List <string> groups = new List <string>();

            while (reader.ReadBool())
            {
                groups.Add(reader.ReadString(Nfs3Mount.MaxNameLength));
            }
            Groups = groups;
        }
Exemplo n.º 17
0
 internal Nfs3FileSystemInfo(XdrDataReader reader)
 {
     ReadMaxBytes            = reader.ReadUInt32();
     ReadPreferredBytes      = reader.ReadUInt32();
     ReadMultipleSize        = reader.ReadUInt32();
     WriteMaxBytes           = reader.ReadUInt32();
     WritePreferredBytes     = reader.ReadUInt32();
     WriteMultipleSize       = reader.ReadUInt32();
     DirectoryPreferredBytes = reader.ReadUInt32();
     MaxFileSize             = reader.ReadInt64();
     TimePrecision           = new Nfs3FileTime(reader);
     FileSystemProperties    = (Nfs3FileSystemProperties)reader.ReadInt32();
 }
        internal Nfs3FileSystemStatResult(XdrDataReader reader)
        {
            Status = (Nfs3Status)reader.ReadInt32();
            if (reader.ReadBool())
            {
                PostOpAttributes = new Nfs3FileAttributes(reader);
            }

            if (Status == Nfs3Status.Ok)
            {
                FileSystemStat = new Nfs3FileSystemStat(reader);
            }
        }
Exemplo n.º 19
0
        protected RpcReply DoSend(MemoryStream ms)
        {
            RpcTcpTransport transport = _client.GetTransport(Identifier, Version);

            byte[] buffer = ms.ToArray();
            buffer = transport.Send(buffer);

            XdrDataReader    reader = new XdrDataReader(new MemoryStream(buffer));
            RpcMessageHeader header = new RpcMessageHeader(reader);

            return(new RpcReply {
                Header = header, BodyReader = reader
            });
        }
Exemplo n.º 20
0
        internal Nfs3DirectoryEntry(XdrDataReader reader)
        {
            FileId = reader.ReadUInt64();
            Name   = reader.ReadString();
            Cookie = reader.ReadUInt64();
            if (reader.ReadBool())
            {
                FileAttributes = new Nfs3FileAttributes(reader);
            }

            if (reader.ReadBool())
            {
                FileHandle = new Nfs3FileHandle(reader);
            }
        }
Exemplo n.º 21
0
        public Nfs3PathConfResult(XdrDataReader reader)
        {
            Status           = (Nfs3Status)reader.ReadInt32();
            ObjectAttributes = new Nfs3FileAttributes(reader);

            if (Status == Nfs3Status.Ok)
            {
                LinkMax         = reader.ReadUInt32();
                NameMax         = reader.ReadUInt32();
                NoTrunc         = reader.ReadBool();
                ChownRestricted = reader.ReadBool();
                CaseInsensitive = reader.ReadBool();
                CasePreserving  = reader.ReadBool();
            }
        }
Exemplo n.º 22
0
        internal Nfs3ReadResult(XdrDataReader reader)
        {
            Status = (Nfs3Status)reader.ReadInt32();
            if (reader.ReadBool())
            {
                FileAttributes = new Nfs3FileAttributes(reader);
            }

            if (Status == Nfs3Status.Ok)
            {
                Count = reader.ReadInt32();
                Eof   = reader.ReadBool();
                Data  = reader.ReadBuffer();
            }
        }
Exemplo n.º 23
0
        internal Nfs3LookupResult(XdrDataReader reader)
        {
            Status = (Nfs3Status)reader.ReadInt32();
            if (Status == Nfs3Status.Ok)
            {
                ObjectHandle = new Nfs3FileHandle(reader);
                if (reader.ReadBool())
                {
                    ObjectAttributes = new Nfs3FileAttributes(reader);
                }
            }

            if (reader.ReadBool())
            {
                DirAttributes = new Nfs3FileAttributes(reader);
            }
        }
Exemplo n.º 24
0
 internal Nfs3FileAttributes(XdrDataReader reader)
 {
     Type         = (Nfs3FileType)reader.ReadInt32();
     Mode         = (UnixFilePermissions)reader.ReadInt32();
     LinkCount    = reader.ReadUInt32();
     Uid          = reader.ReadUInt32();
     Gid          = reader.ReadUInt32();
     Size         = reader.ReadInt64();
     BytesUsed    = reader.ReadInt64();
     RdevMajor    = reader.ReadUInt32();
     RdevMinor    = reader.ReadUInt32();
     FileSystemId = reader.ReadUInt64();
     FileId       = reader.ReadUInt64();
     AccessTime   = new Nfs3FileTime(reader);
     ModifyTime   = new Nfs3FileTime(reader);
     ChangeTime   = new Nfs3FileTime(reader);
 }
Exemplo n.º 25
0
        internal Nfs3CreateResult(XdrDataReader reader)
        {
            Status = (Nfs3Status)reader.ReadInt32();
            if (Status == Nfs3Status.Ok)
            {
                if (reader.ReadBool())
                {
                    FileHandle = new Nfs3FileHandle(reader);
                }

                if (reader.ReadBool())
                {
                    FileAttributes = new Nfs3FileAttributes(reader);
                }
            }

            CacheConsistency = new Nfs3WeakCacheConsistency(reader);
        }
Exemplo n.º 26
0
        internal Nfs3MountResult(XdrDataReader reader)
        {
            Status = (Nfs3Status)reader.ReadInt32();

            if (Status == Nfs3Status.Ok)
            {
                FileHandle = new Nfs3FileHandle(reader);
                int numAuthFlavours = reader.ReadInt32();
                AuthFlavours = new List <RpcAuthFlavour>(numAuthFlavours);
                for (int i = 0; i < numAuthFlavours; ++i)
                {
                    AuthFlavours.Add((RpcAuthFlavour)reader.ReadInt32());
                }
            }
            else
            {
                throw new Nfs3Exception(Status);
            }
        }
Exemplo n.º 27
0
        public Nfs3ReadDirPlusResult(XdrDataReader reader)
        {
            Status = (Nfs3Status)reader.ReadInt32();
            if (reader.ReadBool())
            {
                DirAttributes = new Nfs3FileAttributes(reader);
            }
            if (Status == Nfs3Status.Ok)
            {
                CookieVerifier = reader.ReadBytes(Nfs3.CookieVerifierSize);

                DirEntries = new List<Nfs3DirectoryEntry>();
                while (reader.ReadBool())
                {
                    Nfs3DirectoryEntry dirEntry = new Nfs3DirectoryEntry(reader);
                    DirEntries.Add(dirEntry);
                }

                Eof = reader.ReadBool();
            }
        }
Exemplo n.º 28
0
        internal Nfs3FileSystemStat(XdrDataReader reader)
        {
            TotalSizeBytes             = reader.ReadUInt64();
            FreeSpaceBytes             = reader.ReadUInt64();
            AvailableFreeSpaceBytes    = reader.ReadUInt64();
            FileSlotCount              = reader.ReadUInt64();
            FreeFileSlotCount          = reader.ReadUInt64();
            AvailableFreeFileSlotCount = reader.ReadUInt64();
            uint invarsec = reader.ReadUInt32();

            if (invarsec == UInt32.MaxValue)
            {
                Invariant      = TimeSpan.MaxValue;
                InvariantUntil = DateTime.MaxValue;
            }
            else
            {
                Invariant      = TimeSpan.FromSeconds(invarsec);
                InvariantUntil = DateTime.Now.Add(Invariant);
            }
        }
Exemplo n.º 29
0
        public Nfs3ReadDirPlusResult(XdrDataReader reader)
        {
            Status = (Nfs3Status)reader.ReadInt32();
            if (reader.ReadBool())
            {
                DirAttributes = new Nfs3FileAttributes(reader);
            }
            if (Status == Nfs3Status.Ok)
            {
                CookieVerifier = reader.ReadBytes(Nfs3.CookieVerifierSize);

                DirEntries = new List <Nfs3DirectoryEntry>();
                while (reader.ReadBool())
                {
                    Nfs3DirectoryEntry dirEntry = new Nfs3DirectoryEntry(reader);
                    DirEntries.Add(dirEntry);
                }

                Eof = reader.ReadBool();
            }
        }
Exemplo n.º 30
0
        public Nfs3ReadDirResult(XdrDataReader reader)
        {
            Status = (Nfs3Status)reader.ReadInt32();

            if (reader.ReadBool())
            {
                DirAttributes = new Nfs3FileAttributes(reader);
            }

            DirEntries = new List <Nfs3DirectoryEntry>();
            if (Status == Nfs3Status.Ok)
            {
                CookieVerifier = reader.ReadUInt64();

                while (reader.ReadBool())
                {
                    DirEntries.Add(new Nfs3DirectoryEntry(reader));
                }

                Eof = reader.ReadBool();
            }
        }
Exemplo n.º 31
0
        public Nfs3SetAttributes(XdrDataReader reader)
        {
            SetMode = reader.ReadBool();

            if (SetMode)
            {
                Mode = (UnixFilePermissions)reader.ReadInt32();
            }

            SetUid = reader.ReadBool();
            if (SetUid)
            {
                Uid = reader.ReadUInt32();
            }

            SetGid = reader.ReadBool();
            if (SetGid)
            {
                Gid = reader.ReadUInt32();
            }

            SetSize = reader.ReadBool();
            if (SetSize)
            {
                Size = reader.ReadInt64();
            }

            SetAccessTime = (Nfs3SetTimeMethod)reader.ReadInt32();
            if (SetAccessTime == Nfs3SetTimeMethod.ClientTime)
            {
                AccessTime = new Nfs3FileTime(reader);
            }

            SetModifyTime = (Nfs3SetTimeMethod)reader.ReadInt32();
            if (SetModifyTime == Nfs3SetTimeMethod.ClientTime)
            {
                ModifyTime = new Nfs3FileTime(reader);
            }
        }
 internal Nfs3FileHandle(XdrDataReader reader)
 {
     Value = reader.ReadBuffer(Nfs3Mount.MaxFileHandleSize);
 }
Exemplo n.º 33
0
 public RpcAuthentication(XdrDataReader reader)
 {
     _flavour = (RpcAuthFlavour)reader.ReadInt32();
     _body = reader.ReadBuffer(400);
 }
Exemplo n.º 34
0
 public RpcAuthentication(XdrDataReader reader)
 {
     _flavour = (RpcAuthFlavour)reader.ReadInt32();
     _body    = reader.ReadBuffer(400);
 }
Exemplo n.º 35
0
 public RpcMismatchInfo(XdrDataReader reader)
 {
     Low  = reader.ReadUInt32();
     High = reader.ReadUInt32();
 }
Exemplo n.º 36
0
 public Nfs3FileTime(XdrDataReader reader)
 {
     _seconds = reader.ReadUInt32();
     _nseconds = reader.ReadUInt32();
 }
Exemplo n.º 37
0
 public Nfs3FileTime(XdrDataReader reader)
 {
     _seconds  = reader.ReadUInt32();
     _nseconds = reader.ReadUInt32();
 }