public void VerifyStructure(TS_UD_CS_CLUSTER cluster) { Site.CaptureRequirementIfAreEqual(cluster.header.type, TS_UD_HEADER_type_Values.CS_CLUSTER, 248, "In Client Cluster Data (TS_UD_CS_CLUSTER), the User Data Header type field MUST be set to CS_CLUSTER (0xC004)."); const uint flags = (uint)Flags_Values.REDIRECTION_SUPPORTED | (uint)Flags_Values.ServerSessionRedirectionVersionMask | (uint)Flags_Values.REDIRECTED_SESSIONID_FIELD_VALID | (uint)Flags_Values.REDIRECTED_SMARTCARD; const uint negFlags = ~flags; site.CaptureRequirementIfIsTrue(((uint)cluster.Flags & negFlags) == 0, 250, @"In Client Cluster Data (TS_UD_CS_CLUSTER), the flags field can take any of the following values: REDIRECTION_SUPPORTED" + @" 0x00000001, ServerSessionRedirectionVersionMask 0x0000003C, REDIRECTED_SESSIONID_FIELD_VALID 0x00000002, " + @"REDIRECTED_SMARTCARD 0x00000040"); }
/// <summary> /// Parse TS_UD_CS_CLUSTER /// (parser index is updated according to parsed length) /// </summary> /// <param name="data">data to be parsed</param> /// <param name="currentIndex">current parser index</param> /// <returns>TS_UD_CS_CLUSTER</returns> private TS_UD_CS_CLUSTER ParseTsUdCsCluster(byte[] data, ref int currentIndex) { TS_UD_CS_CLUSTER cluData = new TS_UD_CS_CLUSTER(); cluData.header.type = (TS_UD_HEADER_type_Values)ParseUInt16(data, ref currentIndex, false); cluData.header.length = ParseUInt16(data, ref currentIndex, false); cluData.Flags = (Flags_Values)ParseUInt32(data, ref currentIndex, false); cluData.RedirectedSessionID = ParseUInt32(data, ref currentIndex, false); return cluData; }