Ejemplo n.º 1
0
Archivo: rts.c Proyecto: orosam/FreeRDP
int rts_recv_out_of_sequence_pdu(rdpRpc* rpc, BYTE* buffer, UINT32 length)
{
	UINT32 SignatureId;
	rpcconn_rts_hdr_t* rts;
	RtsPduSignature signature;

	rts = (rpcconn_rts_hdr_t*) buffer;

	rts_extract_pdu_signature(rpc, &signature, rts);
	SignatureId = rts_identify_pdu_signature(rpc, &signature, NULL);

	switch (SignatureId)
	{
		case RTS_PDU_FLOW_CONTROL_ACK:
			return rts_recv_flow_control_ack_pdu(rpc, buffer, length);

		case RTS_PDU_FLOW_CONTROL_ACK_WITH_DESTINATION:
			return rts_recv_flow_control_ack_with_destination_pdu(rpc, buffer, length);

		case RTS_PDU_PING:
			return rts_send_ping_pdu(rpc);

		case RTS_PDU_OUT_R1_A2:
			return rts_recv_OUT_R1_A2_pdu(rpc, buffer, length);

		default:
			WLog_ERR(TAG, "unimplemented signature id: 0x%08X", SignatureId);
			rts_print_pdu_signature(rpc, &signature);
			break;
	}

	return 0;
}
Ejemplo n.º 2
0
Archivo: rts.c Proyecto: 4hosi/FreeRDP
int rts_recv_out_of_sequence_pdu(rdpRpc* rpc, BYTE* buffer, UINT32 length)
{
	UINT32 SignatureId;
	rpcconn_rts_hdr_t* rts;
	RtsPduSignature signature;

	rts = (rpcconn_rts_hdr_t*) buffer;

	rts_extract_pdu_signature(rpc, &signature, rts);
	SignatureId = rts_identify_pdu_signature(rpc, &signature, NULL);

	if (SignatureId == RTS_PDU_FLOW_CONTROL_ACK)
	{
		return rts_recv_flow_control_ack_pdu(rpc, buffer, length);
	}
	else if (SignatureId == RTS_PDU_FLOW_CONTROL_ACK_WITH_DESTINATION)
	{
		return rts_recv_flow_control_ack_with_destination_pdu(rpc, buffer, length);
	}
	else if (SignatureId == RTS_PDU_PING)
	{
		rts_send_ping_pdu(rpc);
	}
	else
	{
		printf("Unimplemented signature id: 0x%08X\n", SignatureId);
		rts_print_pdu_signature(rpc, &signature);
	}

	return 0;
}
Ejemplo n.º 3
0
Archivo: rts.c Proyecto: AMV007/FreeRDP
int rts_recv_out_of_sequence_pdu(rdpRpc* rpc, BYTE* buffer, UINT32 length)
{
	int status = -1;
	UINT32 SignatureId;
	rpcconn_rts_hdr_t* rts;
	RtsPduSignature signature;
	RpcVirtualConnection* connection = rpc->VirtualConnection;

	rts = (rpcconn_rts_hdr_t*) buffer;

	rts_extract_pdu_signature(rpc, &signature, rts);
	SignatureId = rts_identify_pdu_signature(rpc, &signature, NULL);

	if (rts_match_pdu_signature(rpc, &RTS_PDU_FLOW_CONTROL_ACK_SIGNATURE, rts))
	{
		status = rts_recv_flow_control_ack_pdu(rpc, buffer, length);
	}
	else if (rts_match_pdu_signature(rpc, &RTS_PDU_FLOW_CONTROL_ACK_WITH_DESTINATION_SIGNATURE, rts))
	{
		status = rts_recv_flow_control_ack_with_destination_pdu(rpc, buffer, length);
	}
	else if (rts_match_pdu_signature(rpc, &RTS_PDU_PING_SIGNATURE, rts))
	{
		status = rts_send_ping_pdu(rpc);
	}
	else
	{
		if (connection->DefaultOutChannel->State == CLIENT_OUT_CHANNEL_STATE_OPENED)
		{
			if (rts_match_pdu_signature(rpc, &RTS_PDU_OUT_R1_A2_SIGNATURE, rts))
			{
				status = rts_recv_OUT_R1_A2_pdu(rpc, buffer, length);
			}
		}
		else if (connection->DefaultOutChannel->State == CLIENT_OUT_CHANNEL_STATE_OPENED_A6W)
		{
			if (rts_match_pdu_signature(rpc, &RTS_PDU_OUT_R2_A6_SIGNATURE, rts))
			{
				status = rts_recv_OUT_R2_A6_pdu(rpc, buffer, length);
			}
		}
		else if (connection->DefaultOutChannel->State == CLIENT_OUT_CHANNEL_STATE_OPENED_B3W)
		{
			if (rts_match_pdu_signature(rpc, &RTS_PDU_OUT_R2_B3_SIGNATURE, rts))
			{
				status = rts_recv_OUT_R2_B3_pdu(rpc, buffer, length);
			}
		}
	}

	if (status < 0)
	{
		WLog_ERR(TAG, "error parsing RTS PDU with signature id: 0x%08X", SignatureId);
		rts_print_pdu_signature(rpc, &signature);
	}

	return status;
}
Ejemplo n.º 4
0
int rts_print_pdu_signature(rdpRpc* rpc, RtsPduSignature* signature)
{
	UINT32 SignatureId;
	RTS_PDU_SIGNATURE_ENTRY* entry;
	WLog_INFO(TAG,  "RTS PDU Signature: Flags: 0x%04X NumberOfCommands: %d",
			  signature->Flags, signature->NumberOfCommands);
	SignatureId = rts_identify_pdu_signature(rpc, signature, &entry);

	if (SignatureId)
		WLog_ERR(TAG,  "Identified %s RTS PDU", entry->PduName);

	return 0;
}