The RDP_RTT_RESPONSE structure is used to respond to round-trip time measurement operations initiated by the RTT Measure Request (section 2.2.14.1.1) message.
Inheritance: NETWORK_DETECTION_RESPONSE
 /// <summary>
 /// Parse Network Detection Response Structures
 /// </summary>
 /// <param name="data"></param>
 /// <param name="currentIndex"></param>
 /// <returns>A specific Network Detection Response Structure</returns>
 public NETWORK_DETECTION_RESPONSE ParseNetworkDetectionResponse(byte[] data, ref int currentIndex, bool isSubHeader = false)
 {
     byte headerLength = (byte)data.Length;
     HeaderTypeId_Values headerTypeId = HeaderTypeId_Values.TYPE_ID_AUTODETECT_RESPONSE;
     if (isSubHeader)
     {
         headerLength += 2;
     }
     else
     {
         headerLength = ParseByte(data, ref currentIndex);
         headerTypeId = (HeaderTypeId_Values)ParseByte(data, ref currentIndex);
     }
     ushort sequenceNumber = ParseUInt16(data, ref currentIndex, false);
     AUTO_DETECT_RESPONSE_TYPE responseType = (AUTO_DETECT_RESPONSE_TYPE)ParseUInt16(data, ref currentIndex, false);
     if (responseType == AUTO_DETECT_RESPONSE_TYPE.RDP_RTT_RESPONSE)
     {
         RDP_RTT_RESPONSE rttResp = new RDP_RTT_RESPONSE();
         rttResp.headerLength = headerLength;
         rttResp.headerTypeId = headerTypeId;
         rttResp.sequenceNumber = sequenceNumber;
         rttResp.responseType = responseType;
         return rttResp;
     }
     else if (responseType == AUTO_DETECT_RESPONSE_TYPE.RDP_BW_RESULTS_AFTER_CONNECT || responseType == AUTO_DETECT_RESPONSE_TYPE.RDP_BW_RESULTS_DURING_CONNECT)
     {
         RDP_BW_RESULTS bwResults = new RDP_BW_RESULTS();
         bwResults.headerLength = headerLength;
         bwResults.headerTypeId = headerTypeId;
         bwResults.sequenceNumber = sequenceNumber;
         bwResults.responseType = responseType;
         bwResults.timeDelta = ParseUInt32(data, ref currentIndex, false);
         bwResults.byteCount = ParseUInt32(data, ref currentIndex, false);
         return bwResults;
     }
     else if (responseType == AUTO_DETECT_RESPONSE_TYPE.RDP_NETCHAR_SYNC)
     {
         RDP_NETCHAR_SYNC netCharSync = new RDP_NETCHAR_SYNC();
         netCharSync.headerLength = headerLength;
         netCharSync.headerTypeId = headerTypeId;
         netCharSync.sequenceNumber = sequenceNumber;
         netCharSync.responseType = responseType;
         netCharSync.bandwidth = ParseUInt32(data, ref currentIndex, false);
         netCharSync.rtt = ParseUInt32(data, ref currentIndex, false);
         return netCharSync;
     }
     else
     {
         throw new FormatException(ConstValue.ERROR_MESSAGE_ENUM_UNRECOGNIZED);
     }
 }
 /// <summary>
 /// Verify RDP RTT Measure Response packet
 /// </summary>
 /// <param name="rttResponse">RDP RTT Measure Response packet</param>
 /// <param name="sequenceNumber">The sequence Number</param>
 private void VerifyTunnelDataPdu_RTTResponse(RDP_RTT_RESPONSE rttResponse, ushort sequenceNumber)
 {
     if (rttResponse == null)
     {
         Site.Assert.Fail("Not get Bandwidth Measure Result");
     }
     if (rttResponse.sequenceNumber != sequenceNumber)
     {
         Site.Assert.Fail("Expect sequence Number is {0}, but receive sequence Number: {1}", sequenceNumber, rttResponse.sequenceNumber);
     }
 }
Exemplo n.º 3
0
        public override NETWORK_DETECTION_RESPONSE Clone()
        {
            RDP_RTT_RESPONSE rttResp = new RDP_RTT_RESPONSE();
            rttResp.headerLength = this.headerLength;
            rttResp.headerTypeId = this.headerTypeId;
            rttResp.sequenceNumber = this.sequenceNumber;
            rttResp.responseType = this.responseType;

            return rttResp;
        }