/// <summary> /// [TD Reference 3.2.5.3.19] /// Decode Synchronize PDU /// </summary> /// <param name="data">data to be parsed</param> /// <param name="decryptedUserData">decrypted user data to be parsed</param> /// <param name="type">security header type</param> /// <returns>decoded Synchronize PDU</returns> public StackPacket DecodeSynchronizePDU( byte[] data, byte[] decryptedUserData, SecurityHeaderType type) { Server_Synchronize_Pdu pdu = new Server_Synchronize_Pdu(); // data index int dataIndex = 0; // SynchronizePDU: commonHeader pdu.commonHeader = ParseMcsCommonHeader(data, ref dataIndex, type); // user data index int userDataIndex = 0; // SynchronizePDU: synchronizePduData pdu.synchronizePduData = ParseTsSynchronizePdu(decryptedUserData, ref userDataIndex); // Check if data length exceeded expectation VerifyDataLength(decryptedUserData.Length, userDataIndex, ConstValue.ERROR_MESSAGE_DATA_LENGTH_EXCEEDED); return pdu; }
/// <summary> /// Create an instance of the class that is identical to the current PDU. /// </summary> /// <returns>The new instance.</returns> public override StackPacket Clone() { Server_Synchronize_Pdu cloneSychronizePdu = new Server_Synchronize_Pdu(serverSessionContext); cloneSychronizePdu.commonHeader = commonHeader.Clone(); cloneSychronizePdu.synchronizePduData = synchronizePduData; return cloneSychronizePdu; }