From 592bcf569f3915d95ba806bbf004fe6c83dfcdfc Mon Sep 17 00:00:00 2001 From: Matthias Wachs Date: Fri, 13 Jan 2012 11:39:47 +0000 Subject: [PATCH] - more mlp --- src/ats/gnunet-service-ats_addresses.h | 6 ++++ src/ats/gnunet-service-ats_addresses_mlp.h | 36 ++++++++++++++++++++-- 2 files changed, 40 insertions(+), 2 deletions(-) diff --git a/src/ats/gnunet-service-ats_addresses.h b/src/ats/gnunet-service-ats_addresses.h index ad34c94f2..a5230b4f3 100644 --- a/src/ats/gnunet-service-ats_addresses.h +++ b/src/ats/gnunet-service-ats_addresses.h @@ -46,6 +46,8 @@ struct ATS_Address char *plugin; + void *mlp_information; + struct GNUNET_ATS_Information *ats; struct GNUNET_TIME_Relative atsp_latency; @@ -73,6 +75,10 @@ struct ATS_Address */ int active; + /** + * Is this the address for this peer in use? + */ + int used; }; /** diff --git a/src/ats/gnunet-service-ats_addresses_mlp.h b/src/ats/gnunet-service-ats_addresses_mlp.h index 2555846ff..28cffdf36 100644 --- a/src/ats/gnunet-service-ats_addresses_mlp.h +++ b/src/ats/gnunet-service-ats_addresses_mlp.h @@ -117,6 +117,15 @@ struct GAS_MLP_Handle }; +/** + * Address specific MLP information + */ +struct MLP_information +{ + +}; + + /** * Init the MLP problem solving component * @@ -131,10 +140,33 @@ GAS_mlp_init (const struct GNUNET_STATISTICS_Handle *stats, unsigned int max_iterations); /** - * Update address in the MLP problem + * Updates a single address in the MLP problem + * + * If the address did not exist before in the problem: + * The MLP problem has to be recreated and the problem has to be resolved + * + * Otherwise the addresses' values can be updated and the existing base can + * be reused */ void -GAS_mlp_update (struct ATS_Address *address); +GAS_mlp_address_update (struct GNUNET_CONTAINER_MultiHashMap * addresses, struct ATS_Address *address); + + +/** + * Deletes a single address in the MLP problem + * + * The MLP problem has to be recreated and the problem has to be resolved + */ +void +GAS_mlp_address_delete (struct GNUNET_CONTAINER_MultiHashMap * addresses, struct ATS_Address *address); + + +/** + * Deletes a single address in the MLP problem + */ +void +GAS_mlp_address_change_preference (struct GNUNET_CONTAINER_MultiHashMap * addresses, struct ATS_Address *address); + /** * Shutdown the MLP problem solving component -- 2.25.1