From b795dc777c7577cc162ae462f36710ad8dbb05ab Mon Sep 17 00:00:00 2001 From: Matthias Wachs Date: Tue, 11 Jun 2013 08:20:33 +0000 Subject: [PATCH] docu --- .../gnunet-service-ats-solver_proportional.c | 76 ++++++++++++++++++- .../gnunet-service-ats-solver_proportional.h | 17 ++--- 2 files changed, 82 insertions(+), 11 deletions(-) diff --git a/src/ats/gnunet-service-ats-solver_proportional.c b/src/ats/gnunet-service-ats-solver_proportional.c index 119c97bf3..261e5fb68 100644 --- a/src/ats/gnunet-service-ats-solver_proportional.c +++ b/src/ats/gnunet-service-ats-solver_proportional.c @@ -310,38 +310,112 @@ struct Network }; +/** + * Wrapper for addresses to store them in network's linked list + */ struct AddressWrapper { + /** + * Next in DLL + */ struct AddressWrapper *next; + + /** + * Previous in DLL + */ struct AddressWrapper *prev; + /** + * The address + */ struct ATS_Address *addr; }; +/** + * Preference client + */ struct PreferenceClient { + /** + * Next in DLL + */ struct PreferenceClient *prev; + + /** + * Next in DLL + */ + struct PreferenceClient *next; + + /** + * Client handle + */ void *client; + /** + * Total preference for this peer + */ double f_total[GNUNET_ATS_PreferenceCount]; + /** + * List of peer preferences for this client + */ + + /** + * Head of peer list + */ struct PreferencePeer *p_head; + + /** + * Tail of peer list + */ struct PreferencePeer *p_tail; }; - +/** + * Preference peer + */ struct PreferencePeer { + /** + * Next in DLL + */ struct PreferencePeer *next; + + /** + * Previous in DLL + */ struct PreferencePeer *prev; + + /** + * Client + */ struct PreferenceClient *client; + + /** + * Solver handle + */ struct GAS_PROPORTIONAL_Handle *s; + + /** + * Peer id + */ struct GNUNET_PeerIdentity id; + /** + * Preference Values + */ double f[GNUNET_ATS_PreferenceCount]; + + /** + * Relative Preference Values + */ double f_rel[GNUNET_ATS_PreferenceCount]; + + /** + * Relative Total Preference Value + */ double f_rel_total; GNUNET_SCHEDULER_TaskIdentifier aging_task; diff --git a/src/ats/gnunet-service-ats-solver_proportional.h b/src/ats/gnunet-service-ats-solver_proportional.h index 2416be795..b76796c21 100644 --- a/src/ats/gnunet-service-ats-solver_proportional.h +++ b/src/ats/gnunet-service-ats-solver_proportional.h @@ -29,16 +29,13 @@ #include "gnunet-service-ats_addresses.h" /** - * ATS simplistic solver + * ATS proportional solver * * General description */ - - - /** - * Init the simplistic problem solving component + * Init the proportional problem solver * * Quotas: * network[i] contains the network type as type GNUNET_ATS_NetworkType[i] @@ -71,12 +68,12 @@ GAS_proportional_init (const struct GNUNET_CONFIGURATION_Handle *cfg, GAS_bandwidth_changed_cb bw_changed_cb, void *bw_changed_cb_cls); + /** - * Shutdown the simplistic problem solving component + * Shutdown the proportional problem solver * * @param solver the respective handle to shutdown */ -void GAS_proportional_done (void * solver); /** @@ -89,9 +86,9 @@ GAS_proportional_done (void * solver); */ void GAS_proportional_address_add (void *solver, - struct GNUNET_CONTAINER_MultiHashMap *addresses, - struct ATS_Address *address, - uint32_t network); + struct GNUNET_CONTAINER_MultiHashMap *addresses, + struct ATS_Address *address, + uint32_t network); /** -- 2.25.1