#define DEBUG_MLP GNUNET_EXTRA_LOGGING
+#define MLP_AVERAGING_QUEUE_LENGTH 3
+
#define MLP_MAX_EXEC_DURATION GNUNET_TIME_relative_multiply(GNUNET_TIME_UNIT_SECONDS, 3)
#define MLP_MAX_ITERATIONS INT_MAX
struct ATS_Address *tail;
};
+struct ATS_PreferedAddress
+{
+ uint32_t bandwidth_out;
+ uint32_t bandwidth_in;
+ struct ATS_Address *address;
+};
+
/**
* MLP Handle
*/
/* Quality information row indices */
unsigned int r_q[GNUNET_ATS_QualityPropertiesCount];
- /* Quality information column indices */
- unsigned int c_q[GNUNET_ATS_QualityPropertiesCount];
-
/* Quality information */
- double q[GNUNET_ATS_QualityPropertiesCount];
+ double q[GNUNET_ATS_QualityPropertiesCount][MLP_AVERAGING_QUEUE_LENGTH];
+
+ /* Quality information averaged */
+ double q_averaged[GNUNET_ATS_QualityPropertiesCount];
+
+ /* Averaging index */
+ int q_avg_i[GNUNET_ATS_QualityPropertiesCount];
};
* Get the preferred address for a specific peer
*
* @param mlp the MLP Handle
+ * @param addresses address hashmap
* @param peer the peer
* @return suggested address
*/
-struct ATS_Address *
+struct ATS_PreferedAddress *
GAS_mlp_get_preferred_address (struct GAS_MLP_Handle *mlp,
struct GNUNET_CONTAINER_MultiHashMap * addresses,
const struct GNUNET_PeerIdentity *peer);