コード例 #1
0
 internal PortMap2Mapping(XdrDataReader reader)
 {
     Program  = reader.ReadInt32();
     Version  = reader.ReadInt32();
     Protocol = (PortMap2Protocol)reader.ReadUInt32();
     Port     = reader.ReadUInt32();
 }
コード例 #2
0
 internal Nfs3ExportResult(XdrDataReader reader)
 {
     Exports = new List <Nfs3Export>();
     while (reader.ReadBool())
     {
         Exports.Add(new Nfs3Export(reader));
     }
 }
コード例 #3
0
ファイル: RpcCallHeader.cs プロジェクト: Lukas0610/ndiscutils
 public RpcCallHeader(XdrDataReader reader)
 {
     RpcVersion  = reader.ReadUInt32();
     Program     = reader.ReadUInt32();
     Version     = reader.ReadUInt32();
     Proc        = reader.ReadInt32();
     Credentials = new RpcAuthentication(reader);
     Verifier    = new RpcAuthentication(reader);
 }
コード例 #4
0
 public RpcAcceptedReplyHeader(XdrDataReader reader)
 {
     Verifier     = new RpcAuthentication(reader);
     AcceptStatus = (RpcAcceptStatus)reader.ReadInt32();
     if (AcceptStatus == RpcAcceptStatus.ProgramVersionMismatch)
     {
         MismatchInfo = new RpcMismatchInfo(reader);
     }
 }
コード例 #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());
     }
 }
コード例 #6
0
        internal Nfs3AccessResult(XdrDataReader reader)
        {
            Status = (Nfs3Status)reader.ReadInt32();
            if (reader.ReadBool())
            {
                ObjectAttributes = new Nfs3FileAttributes(reader);
            }

            Access = (Nfs3AccessPermissions)reader.ReadInt32();
        }
コード例 #7
0
ファイル: RpcMessageHeader.cs プロジェクト: alexcmd/DiscUtils
        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);
        }
コード例 #8
0
ファイル: RpcProgram.cs プロジェクト: JGTM2016/discutils
        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 };
        }
コード例 #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();
     }
 }
コード例 #10
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());
            }
        }
コード例 #11
0
ファイル: Nfs3Export.cs プロジェクト: joconno4/MediaPortal-2
        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;
        }
コード例 #12
0
 public RpcReplyHeader(XdrDataReader reader)
 {
     Status = (RpcReplyStatus)reader.ReadInt32();
     if (Status == RpcReplyStatus.Accepted)
     {
         AcceptReply = new RpcAcceptedReplyHeader(reader);
     }
     else
     {
         RejectedReply = new RpcRejectedReplyHeader(reader);
     }
 }
コード例 #13
0
        internal Nfs3WeakCacheConsistency(XdrDataReader reader)
        {
            if (reader.ReadBool())
            {
                Before = new Nfs3WeakCacheConsistencyAttr(reader);
            }

            if (reader.ReadBool())
            {
                After = new Nfs3FileAttributes(reader);
            }
        }
コード例 #14
0
 public RpcRejectedReplyHeader(XdrDataReader reader)
 {
     Status = (RpcRejectedStatus)reader.ReadInt32();
     if (Status == RpcRejectedStatus.RpcMismatch)
     {
         MismatchInfo = new RpcMismatchInfo(reader);
     }
     else
     {
         AuthenticationStatus = (RpcAuthenticationStatus)reader.ReadInt32();
     }
 }
コード例 #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);
        }
コード例 #16
0
ファイル: Nfs3Export.cs プロジェクト: git-thinh/MediaPortal-2
        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;
        }
コード例 #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();
 }
コード例 #18
0
        internal Nfs3FileSystemStatResult(XdrDataReader reader)
        {
            Status = (Nfs3Status)reader.ReadInt32();
            if (reader.ReadBool())
            {
                PostOpAttributes = new Nfs3FileAttributes(reader);
            }

            if (Status == Nfs3Status.Ok)
            {
                FileSystemStat = new Nfs3FileSystemStat(reader);
            }
        }
コード例 #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
            });
        }
コード例 #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);
            }
        }
コード例 #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();
            }
        }
コード例 #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();
            }
        }
コード例 #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);
            }
        }
コード例 #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);
 }
コード例 #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);
        }
コード例 #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);
            }
        }
コード例 #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();
            }
        }
コード例 #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);
            }
        }
コード例 #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();
            }
        }
コード例 #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();
            }
        }
コード例 #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);
            }
        }
コード例 #32
0
 internal Nfs3FileHandle(XdrDataReader reader)
 {
     Value = reader.ReadBuffer(Nfs3Mount.MaxFileHandleSize);
 }
コード例 #33
0
 public RpcAuthentication(XdrDataReader reader)
 {
     _flavour = (RpcAuthFlavour)reader.ReadInt32();
     _body = reader.ReadBuffer(400);
 }
コード例 #34
0
 public RpcAuthentication(XdrDataReader reader)
 {
     _flavour = (RpcAuthFlavour)reader.ReadInt32();
     _body    = reader.ReadBuffer(400);
 }
コード例 #35
0
 public RpcMismatchInfo(XdrDataReader reader)
 {
     Low  = reader.ReadUInt32();
     High = reader.ReadUInt32();
 }
コード例 #36
0
 public Nfs3FileTime(XdrDataReader reader)
 {
     _seconds = reader.ReadUInt32();
     _nseconds = reader.ReadUInt32();
 }
コード例 #37
0
 public Nfs3FileTime(XdrDataReader reader)
 {
     _seconds  = reader.ReadUInt32();
     _nseconds = reader.ReadUInt32();
 }