/// <summary>
        /// Send DVC Capabilities Request PDU
        /// </summary>
        /// <param name="version">Version of Cap Request</param>
        /// <param name="transportType">transport Type</param>
        private void SendDVCCapRequestPDU(DYNVC_CAPS_Version version,
                                          DynamicVC_TransportType transportType = DynamicVC_TransportType.RDP_TCP)
        {
            DynamicVCPDU capReq = null;

            if (version == DYNVC_CAPS_Version.VERSION1)
            {
                capReq = pduBuilder.CreateCapsV1ReqPdu();
            }
            else if (version == DYNVC_CAPS_Version.VERSION2)
            {
                capReq = pduBuilder.CreateCapsV2ReqPdu();
            }
            else
            {
                capReq = pduBuilder.CreateCapsV3ReqPdu();
            }

            this.Send(capReq, transportType);
        }
Beispiel #2
0
        /// <summary>
        /// Exchange DVC capability, negotiate the version
        /// </summary>
        /// <param name="version"></param>
        public void ExchangeCapabilities(TimeSpan timeout)
        {
            DynamicVCPDU pdu = this.ExpectDVCCapRequestPDU(timeout);

            if (pdu == null)
            {
                throw new System.IO.IOException("Cannot receive a DVC Capabilities Request PDU!");
            }
            DYNVC_CAPS_Version version = DYNVC_CAPS_Version.VERSION3;

            if (pdu is CapsVer1ReqDvcPdu)
            {
                version = DYNVC_CAPS_Version.VERSION1;
            }
            else if (pdu is CapsVer2ReqDvcPdu)
            {
                version = DYNVC_CAPS_Version.VERSION2;
            }

            this.SendDVCCapResponsePDU(version);
        }
Beispiel #3
0
        public void S1_EDYC_SendCompressedDataSequence()
        {
            #region Test Code

            this.rdpedycAdapter.Initialize(this.Site);

            // Set up RDPBCGR connection with server
            this.rdpedycAdapter.ConnectToServer(transportProtocol, requestProtocol, new string[] { RdpConstValue.SVCNAME_RDPEDYC }, CompressionType.PACKET_COMPR_TYPE_NONE, false, true);

            // Capability exchange
            this.Site.Log.Add(LogEntryKind.Debug, "Expect the Exchange Capabilites PDU from SUT.");

            // This PDU MUST NOT be used unless both DVC managers support version 3 of the Remote Desktop Protocol: dynamic Virtual Channel Extension, and a reliable transport is being used (UDP-Random or TCP).)
            DYNVC_CAPS_Version capVersion = this.rdpedycAdapter.ExchangeCapabilities(timeout);

            if (capVersion != DYNVC_CAPS_Version.VERSION3)
            {
                this.Site.Assert.Inconclusive("Compressed data only be used when DVC managers support Version 3 of the EDYC channel.");
            }

            // Expect the geometry channel create request from server
            this.Site.Log.Add(LogEntryKind.Debug, "Expect the DVC channel create PDU from SUT.");

            DynamicVirtualChannel channel = this.rdpedycAdapter.ExpectChannel(timeout, DynamicVC_TransportType.RDP_TCP);

            // Send compressed data sequence to server
            this.Site.Log.Add(LogEntryKind.Debug, "Expect the DYNVC_Data PDU from SUT.");

            this.rdpedycAdapter.SendCompressedSequencePdu(channel.ChannelId, DynamicVC_TransportType.RDP_TCP);

            // Expect the geometry channel close request from server
            this.Site.Log.Add(LogEntryKind.Debug, "Expect the DVC channel close PDU from SUT.");

            this.rdpedycAdapter.CloseChannel(timeout, (ushort)channel.ChannelId);

            this.Site.Log.Add(LogEntryKind.Debug, "The DVC channel is closed successfully.");

            #endregion Test Code
        }
        /// <summary>
        /// Send a DVC Capabilities Response PDU
        /// </summary>
        /// <param name="version">Version</param>
        /// <param name="transportType">Transport Type</param>
        private void SendDVCCapResponsePDU(DYNVC_CAPS_Version version, DynamicVC_TransportType transportType = DynamicVC_TransportType.RDP_TCP)
        {
            CapsRespDvcPdu capResp = pduBuilder.CreateCapsRespPdu((ushort)version);

            this.Send(capResp, transportType);
        }
        /// <summary>
        /// Send DVC Capabilities Request PDU
        /// </summary>
        /// <param name="version">Version of Cap Request</param>
        /// <param name="transportType">transport Type</param>
        private void SendDVCCapRequestPDU(DYNVC_CAPS_Version version,
            DynamicVC_TransportType transportType = DynamicVC_TransportType.RDP_TCP)
        {
            DynamicVCPDU capReq = null;
            if (version == DYNVC_CAPS_Version.VERSION1)
            {
                capReq = pduBuilder.CreateCapsV1ReqPdu();
            }
            else if (version == DYNVC_CAPS_Version.VERSION2)
            {
                capReq = pduBuilder.CreateCapsV2ReqPdu();
            }
            else
            {
                capReq = pduBuilder.CreateCapsV3ReqPdu();
            }

            this.Send(capReq, transportType);
        }
 /// <summary>
 /// Exchange DVC capability, negotiate the version 
 /// </summary>
 /// <param name="version"></param>
 public ushort ExchangeCapabilities(TimeSpan timeout, DYNVC_CAPS_Version version = DYNVC_CAPS_Version.VERSION3)
 {
     this.SendDVCCapRequestPDU(version);
     CapsRespDvcPdu capResp = this.ExpectDVCCapResponsePDU(timeout);
     if (capResp == null)
     {
         throw new System.IO.IOException("Cannot receive a DVC Capabilities Response PDU!");
     }
     return capResp.Version;
 }
 /// <summary>
 /// Send a DVC Capabilities Response PDU
 /// </summary>
 /// <param name="version">Version</param>
 /// <param name="transportType">Transport Type</param>
 private void SendDVCCapResponsePDU(DYNVC_CAPS_Version version, DynamicVC_TransportType transportType = DynamicVC_TransportType.RDP_TCP)
 {
     CapsRespDvcPdu capResp = pduBuilder.CreateCapsRespPdu((ushort)version);
     this.Send(capResp, transportType);
 }