/* Retrieves the connection info structure of a given connection to a host. */
TCP_ConnectionInfo_t* TCP_GetConnectionInfo(const uint16_t Port, const IP_Address_t *RemoteAddress, const uint16_t RemotePort)
/* Retrieves the connection info structure of a given connection to a host. */
TCP_ConnectionInfo_t* TCP_GetConnectionInfo(const uint16_t Port, const IP_Address_t *RemoteAddress, const uint16_t RemotePort)
{
	for (uint8_t CSTableEntry = 0; CSTableEntry < MAX_TCP_CONNECTIONS; CSTableEntry++)
	{
		if ((ConnectionStateTable[CSTableEntry].Port == Port) &&
		     IP_COMPARE(&ConnectionStateTable[CSTableEntry].RemoteAddress, RemoteAddress) &&
			 ConnectionStateTable[CSTableEntry].RemotePort == RemotePort)
		{
			return &ConnectionStateTable[CSTableEntry].Info;
		}
	}
	return NULL;
}