/// <summary>
 /// Deep copy constructor.
 /// </summary>
 public SmbTransQueryNmpipeStateRequestPacket(SmbTransQueryNmpipeStateRequestPacket packet)
     : base(packet)
 {
 }
Пример #2
0
        /// <summary>
        /// find the transaction packet.
        /// </summary>
        /// <param name="setupCount">the count of setup</param>
        /// <param name="command">the command of transaction packet</param>
        /// <returns>the target transaction packet</returns>
        private static SmbPacket FindTheTransactionPacket(byte setupCount, TransSubCommand command)
        {
            if (setupCount == 0)
            {
                return(new SmbTransRapRequestPacket());
            }
            else if (setupCount == 3)
            {
                return(new SmbTransMailslotWriteRequestPacket());
            }

            SmbPacket smbPacket = null;

            switch ((TransSubCommand)command)
            {
            case TransSubCommand.TRANS_SET_NMPIPE_STATE:
                smbPacket = new SmbTransSetNmpipeStateRequestPacket();
                break;

            case TransSubCommand.TRANS_QUERY_NMPIPE_STATE:
                smbPacket = new SmbTransQueryNmpipeStateRequestPacket();
                break;

            case TransSubCommand.TRANS_QUERY_NMPIPE_INFO:
                smbPacket = new SmbTransQueryNmpipeInfoRequestPacket();
                break;

            case TransSubCommand.TRANS_PEEK_NMPIPE:
                smbPacket = new SmbTransPeekNmpipeRequestPacket();
                break;

            case TransSubCommand.TRANS_TRANSACT_NMPIPE:
                smbPacket = new SmbTransTransactNmpipeRequestPacket();
                break;

            case TransSubCommand.TRANS_RAW_READ_NMPIPE:
                smbPacket = new SmbTransRawReadNmpipeRequestPacket();
                break;

            case TransSubCommand.TRANS_READ_NMPIPE:
                smbPacket = new SmbTransReadNmpipeRequestPacket();
                break;

            case TransSubCommand.TRANS_WRITE_NMPIPE:
                smbPacket = new SmbTransWriteNmpipeRequestPacket();
                break;

            case TransSubCommand.TRANS_WAIT_NMPIPE:
                smbPacket = new SmbTransWaitNmpipeRequestPacket();
                break;

            case TransSubCommand.TRANS_CALL_NMPIPE:
                smbPacket = new SmbTransCallNmpipeRequestPacket();
                break;

            case TransSubCommand.TRANS_RAW_WRITE_NMPIPE:
                smbPacket = new SmbTransRawWriteNmpipeRequestPacket();
                break;

            default:
                break;
            }
            return(smbPacket);
        }