예제 #1
0
        public Command23(CommandBuilder command)
        {
            if (command == null)
            {
                throw new ArgumentNullException("command");
            }

            m_Command        = command;
            m_CommandID      = m_Command.ReadBytes(48);
            m_SenderPeerID   = m_Command.ReadBytes(48);
            m_ReceiverPeerID = m_Command.ReadBytes(48);
            m_SearchID       = m_Command.ReadBytes(48);
            m_SearchResults  = new RList <SearchResult>();
            ushort searchResultsCount = m_Command.ReadUInt16();

            for (int n = 0; n < searchResultsCount; n++)
            {
                byte[] fileHash = m_Command.ReadBytes(64);
                uint   fileSize = m_Command.ReadUInt32();
                string fileName = m_Command.ReadString();
                RIndexedHashtable <string, string> metaData = new RIndexedHashtable <string, string>();
                ushort metaDataCount = m_Command.ReadUInt16();
                for (int m = 0; m < metaDataCount; m++)
                {
                    metaData.Add(m_Command.ReadString(), m_Command.ReadString());
                }
                m_SearchResults.Add(new SearchResult(fileHash, fileSize, fileName, metaData, m_Command.ReadString(), m_Command.ReadByte()));
            }
        }
예제 #2
0
        public Command54(CommandBuilder command)
        {
            if (command == null)
            {
                throw new ArgumentNullException("command");
            }

            m_Command        = command;
            m_CommandID      = m_Command.ReadBytes(48);
            m_SenderPeerID   = m_Command.ReadBytes(48);
            m_ReceiverPeerID = m_Command.ReadBytes(48);
            m_SourceSearchID = m_Command.ReadBytes(48);
            m_FileSize       = m_Command.ReadUInt32();
            m_FileName       = m_Command.ReadString();
            m_MetaData       = new RIndexedHashtable <string, string>();
            ushort metaDataCount = m_Command.ReadUInt16();

            for (int n = 0; n < metaDataCount; n++)
            {
                m_MetaData.Add(m_Command.ReadString(), m_Command.ReadString());
            }
            m_Comment    = m_Command.ReadString();
            m_Rating     = m_Command.ReadByte();
            m_SectorsMap = m_Command.ReadBytes(m_Command.ReadUInt16());
        }
예제 #3
0
        public Command10(CommandBuilder command)
        {
            if (command == null)
                throw new ArgumentNullException("command");

            m_Command = command;
            m_Keys.Modulus = m_Command.ReadBytes(command.ReadUInt16());
            m_Keys.Exponent = m_Command.ReadBytes(command.ReadUInt16());
        }
예제 #4
0
        public Command11(CommandBuilder command)
        {
            if (command == null)
            {
                throw new ArgumentNullException("command");
            }

            m_Command       = command;
            m_Keys.Modulus  = m_Command.ReadBytes(command.ReadUInt16());
            m_Keys.Exponent = m_Command.ReadBytes(command.ReadUInt16());
        }
예제 #5
0
        public Command21(CommandBuilder command)
        {
            if (command == null)
                throw new ArgumentNullException("command");

            m_Command = command;
            m_CommandID = m_Command.ReadBytes(48);
            m_Reserved = m_Command.ReadUInt16();
            m_HopCount = m_Command.ReadUInt16();
            m_SenderPeerID = m_Command.ReadBytes(48);
            m_SearchID = m_Command.ReadBytes(48);
            m_SearchPattern = m_Command.ReadString();
        }
예제 #6
0
        public Command61(CommandBuilder command)
        {
            if (command == null)
                throw new ArgumentNullException("command");

            m_Command = command;
            m_CommandID = m_Command.ReadBytes(48);
            m_Reserved = m_Command.ReadUInt16();
            m_HopCount = m_Command.ReadUInt16();
            m_SenderPeerID = m_Command.ReadBytes(48);
            m_SourceSearchID = m_Command.ReadBytes(48);
            m_HashedFileHash = m_Command.ReadBytes(64);
        }
예제 #7
0
        public Command12(CommandBuilder command)
        {
            if (command == null)
                throw new ArgumentNullException("command");

            m_Command = command;
            m_Keys.BlockSize = m_Command.ReadUInt16();
            m_Keys.FeedbackSize = m_Command.ReadUInt16();
            m_Keys.KeySize = m_Command.ReadUInt16();
            m_Keys.Mode = (CipherMode)m_Command.ReadByte();
            m_Keys.Padding = (PaddingMode)m_Command.ReadByte();
            m_Keys.IV = m_Command.ReadBytes(m_Command.ReadByte());
            m_Keys.Key = m_Command.ReadBytes(m_Command.ReadByte());
        }
예제 #8
0
        public Command61(CommandBuilder command)
        {
            if (command == null)
            {
                throw new ArgumentNullException("command");
            }

            m_Command        = command;
            m_CommandID      = m_Command.ReadBytes(48);
            m_Reserved       = m_Command.ReadUInt16();
            m_HopCount       = m_Command.ReadUInt16();
            m_SenderPeerID   = m_Command.ReadBytes(48);
            m_SourceSearchID = m_Command.ReadBytes(48);
            m_HashedFileHash = m_Command.ReadBytes(64);
        }
예제 #9
0
        public Command21(CommandBuilder command)
        {
            if (command == null)
            {
                throw new ArgumentNullException("command");
            }

            m_Command       = command;
            m_CommandID     = m_Command.ReadBytes(48);
            m_Reserved      = m_Command.ReadUInt16();
            m_HopCount      = m_Command.ReadUInt16();
            m_SenderPeerID  = m_Command.ReadBytes(48);
            m_SearchID      = m_Command.ReadBytes(48);
            m_SearchPattern = m_Command.ReadString();
        }
예제 #10
0
        public Command12(CommandBuilder command)
        {
            if (command == null)
            {
                throw new ArgumentNullException("command");
            }

            m_Command           = command;
            m_Keys.BlockSize    = m_Command.ReadUInt16();
            m_Keys.FeedbackSize = m_Command.ReadUInt16();
            m_Keys.KeySize      = m_Command.ReadUInt16();
            m_Keys.Mode         = (CipherMode)m_Command.ReadByte();
            m_Keys.Padding      = (PaddingMode)m_Command.ReadByte();
            m_Keys.IV           = m_Command.ReadBytes(m_Command.ReadByte());
            m_Keys.Key          = m_Command.ReadBytes(m_Command.ReadByte());
        }
예제 #11
0
        public Command54(CommandBuilder command)
        {
            if (command == null)
                throw new ArgumentNullException("command");

            m_Command = command;
            m_CommandID = m_Command.ReadBytes(48);
            m_SenderPeerID = m_Command.ReadBytes(48);
            m_ReceiverPeerID = m_Command.ReadBytes(48);
            m_SourceSearchID = m_Command.ReadBytes(48);
            m_FileSize = m_Command.ReadUInt32();
            m_FileName = m_Command.ReadString();
            m_MetaData = new RIndexedHashtable<string, string>();
            ushort metaDataCount = m_Command.ReadUInt16();
            for (int n = 0; n < metaDataCount; n++)
                m_MetaData.Add(m_Command.ReadString(), m_Command.ReadString());
            m_Comment = m_Command.ReadString();
            m_Rating = m_Command.ReadByte();
            m_SectorsMap = m_Command.ReadBytes(m_Command.ReadUInt16());
        }
예제 #12
0
        public Command64(CommandBuilder command)
        {
            if (command == null)
                throw new ArgumentNullException("command");

            m_Command = command;
            m_CommandID = m_Command.ReadBytes(48);
            m_SenderPeerID = m_Command.ReadBytes(48);
            m_ReceiverPeerID = m_Command.ReadBytes(48);
            m_SourceSearchID = m_Command.ReadBytes(48);
            m_SectorsMap = m_Command.ReadBytes(m_Command.ReadUInt16());
        }
예제 #13
0
        public Command79(CommandBuilder command)
        {
            if (command == null)
                throw new ArgumentNullException("command");

            m_Command = command;
            m_CommandID = m_Command.ReadBytes(48);
            m_SenderPeerID = m_Command.ReadBytes(48);
            m_ReceiverPeerID = m_Command.ReadBytes(48);
            m_DownloadID = m_Command.ReadBytes(48);
            m_Sector = m_Command.ReadUInt32();
            m_SectorData = m_Command.ReadBytes(m_Command.ReadUInt16());
            m_SectorHashCodeResult = m_Command.ReadBytes(64);
        }
예제 #14
0
        public Command64(CommandBuilder command)
        {
            if (command == null)
            {
                throw new ArgumentNullException("command");
            }

            m_Command        = command;
            m_CommandID      = m_Command.ReadBytes(48);
            m_SenderPeerID   = m_Command.ReadBytes(48);
            m_ReceiverPeerID = m_Command.ReadBytes(48);
            m_SourceSearchID = m_Command.ReadBytes(48);
            m_SectorsMap     = m_Command.ReadBytes(m_Command.ReadUInt16());
        }
예제 #15
0
        public Command23(CommandBuilder command)
        {
            if (command == null)
                throw new ArgumentNullException("command");

            m_Command = command;
            m_CommandID = m_Command.ReadBytes(48);
            m_SenderPeerID = m_Command.ReadBytes(48);
            m_ReceiverPeerID = m_Command.ReadBytes(48);
            m_SearchID = m_Command.ReadBytes(48);
            m_SearchResults = new RList<SearchResult>();
            ushort searchResultsCount = m_Command.ReadUInt16();
            for (int n = 0; n < searchResultsCount; n++)
            {
                byte[] fileHash = m_Command.ReadBytes(64);
                uint fileSize = m_Command.ReadUInt32();
                string fileName = m_Command.ReadString();
                RIndexedHashtable<string, string> metaData = new RIndexedHashtable<string, string>();
                ushort metaDataCount = m_Command.ReadUInt16();
                for (int m = 0; m < metaDataCount; m++)
                    metaData.Add(m_Command.ReadString(), m_Command.ReadString());
                m_SearchResults.Add(new SearchResult(fileHash, fileSize, fileName, metaData, m_Command.ReadString(), m_Command.ReadByte()));
            }
        }
예제 #16
0
        public Command79(CommandBuilder command)
        {
            if (command == null)
            {
                throw new ArgumentNullException("command");
            }

            m_Command              = command;
            m_CommandID            = m_Command.ReadBytes(48);
            m_SenderPeerID         = m_Command.ReadBytes(48);
            m_ReceiverPeerID       = m_Command.ReadBytes(48);
            m_DownloadID           = m_Command.ReadBytes(48);
            m_Sector               = m_Command.ReadUInt32();
            m_SectorData           = m_Command.ReadBytes(m_Command.ReadUInt16());
            m_SectorHashCodeResult = m_Command.ReadBytes(64);
        }