Microsoft.Protocols.TestTools.StackSdk.RemoteDesktop.Rdpbcgr.RdpbcgrServerDecoder.ParseMcsCommonHeader C# (CSharp) Method

ParseMcsCommonHeader() private method

Parse MCS Common Header (parser index is updated according to parsed length)
private ParseMcsCommonHeader ( byte data, int &currentIndex, SecurityHeaderType securityHeaderType ) : SlowPathPduCommonHeader
data byte data to be parsed
currentIndex int current parser index
securityHeaderType SecurityHeaderType security header type
return SlowPathPduCommonHeader
        private SlowPathPduCommonHeader ParseMcsCommonHeader(
            byte[] data,
            ref int currentIndex,
            SecurityHeaderType securityHeaderType)
        {
            SlowPathPduCommonHeader header = new SlowPathPduCommonHeader();

            // McsCommonHeader: TpktHeader
            header.tpktHeader = ParseTpktHeader(data, ref currentIndex);

            // McsCommonHeader: x224Data
            header.x224Data = ParseX224Data(data, ref currentIndex);

            // McsCommonHeader: type
            header.type = ParseByte(data, ref currentIndex);

            // McsCommonHeader: initiator
            header.initiator = (UInt16)(ParseUInt16(data, ref currentIndex, true)
                + ConstValue.CHANNEL_INITIATOR_FILTER);

            // McsCommonHeader: channelId
            header.channelId = ParseUInt16(data, ref currentIndex, true);

            // McsCommonHeader: level(dataPriority & segmentation)
            header.level = ParseByte(data, ref currentIndex);

            // McsCommonHeader: user data length
            byte length1 = ParseByte(data, ref currentIndex);
            if ((length1 & 0x80) == 0x80)
            {
                byte length2 = ParseByte(data, ref currentIndex);
                header.userDataLength = (uint)(((length1 & 0x7F)<<8) + length2);
            }
            else
            {
                header.userDataLength = length1;
            }

            // McsCommonHeader: securityHeader
            header.securityHeader = ParseTsSecurityHeader(data, ref currentIndex, securityHeaderType);

            return header;
        }
RdpbcgrServerDecoder