[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[GNUnet-SVN] r25233 - gnunet/src/ats
From: |
gnunet |
Subject: |
[GNUnet-SVN] r25233 - gnunet/src/ats |
Date: |
Tue, 4 Dec 2012 16:09:39 +0100 |
Author: wachs
Date: 2012-12-04 16:09:39 +0100 (Tue, 04 Dec 2012)
New Revision: 25233
Modified:
gnunet/src/ats/gnunet-service-ats_addresses.c
gnunet/src/ats/gnunet-service-ats_addresses_simplistic.c
gnunet/src/ats/gnunet-service-ats_addresses_simplistic.h
Log:
docu
Modified: gnunet/src/ats/gnunet-service-ats_addresses.c
===================================================================
--- gnunet/src/ats/gnunet-service-ats_addresses.c 2012-12-04 14:57:01 UTC
(rev 25232)
+++ gnunet/src/ats/gnunet-service-ats_addresses.c 2012-12-04 15:09:39 UTC
(rev 25233)
@@ -946,9 +946,6 @@
}
-
-// FIXME: this function should likely end up in the LP-subsystem and
-// not with 'addresses' in the future...
void
GAS_addresses_change_preference (const struct GNUNET_PeerIdentity *peer,
enum GNUNET_ATS_PreferenceKind kind,
Modified: gnunet/src/ats/gnunet-service-ats_addresses_simplistic.c
===================================================================
--- gnunet/src/ats/gnunet-service-ats_addresses_simplistic.c 2012-12-04
14:57:01 UTC (rev 25232)
+++ gnunet/src/ats/gnunet-service-ats_addresses_simplistic.c 2012-12-04
15:09:39 UTC (rev 25233)
@@ -19,8 +19,8 @@
*/
/**
- * @file ats/gnunet-service-ats_addresses_simplistic.c
- * @brief ats mlp problem solver
+ * @file ats/gnunet-service-ats_addresses_simplistic.h
+ * @brief ats simplistic ressource assignment
* @author Matthias Wachs
* @author Christian Grothoff
*/
@@ -29,17 +29,22 @@
#include "gnunet-service-ats_addresses.h"
#include "gnunet_statistics_service.h"
+
+/**
+ * A handle for the simplistic solver
+ */
struct GAS_SIMPLISTIC_Handle
{
};
+
/**
* Init the simplistic problem solving component
*
* @param cfg configuration handle
* @param stats the GNUNET_STATISTICS handle
- * @return struct GAS_SIMPLISTIC_Handle * on success, NULL on fail
+ * @return handle for the solver on success, NULL on fail
*/
void *
GAS_simplistic_init (const struct GNUNET_CONFIGURATION_Handle *cfg,
@@ -49,22 +54,25 @@
return solver;
}
+
/**
* Shutdown the simplistic problem solving component
+ *
+ * @param solver the respective handle to shutdown
*/
void
GAS_simplistic_done (void *solver)
{
+ GNUNET_assert (solver != NULL);
GNUNET_free (solver);
}
/**
- * Updates a single address
+ * Updates a single address in the solve
*
* @param solver the solver Handle
- * @param addresses the address hashmap
- * the address has to be already removed from the hashmap
- * @param address the address to update
+ * @param addresses the address hashmap containing all addresses
+ * @param address the update address
*/
void
GAS_simplistic_address_update (void *solver, struct
GNUNET_CONTAINER_MultiHashMap * addresses, struct ATS_Address *address)
@@ -72,6 +80,14 @@
}
+
+/**
+ * Remove an address from the solver
+ *
+ * @param solver the solver handle
+ * @param addresses the address hashmap containing all addresses
+ * @param address the address to remove
+ */
void
GAS_simplistic_address_delete (void *solver, struct
GNUNET_CONTAINER_MultiHashMap * addresses, struct ATS_Address *address)
{
@@ -79,19 +95,27 @@
}
+/**
+ * Get the prefered address for a specific peer
+ *
+ * @param solver the solver handle
+ * @param addresses the address hashmap containing all addresses
+ * @param peer the identity of the peer
+ */
struct ATS_PreferedAddress *
GAS_simplistic_get_preferred_address (void *solver,
struct GNUNET_CONTAINER_MultiHashMap *
addresses,
const struct GNUNET_PeerIdentity *peer)
{
-
+ return NULL;
}
+
/**
- * Changes the preferences for a peer in the problem
+ * Changes the preferences for a peer in the problem
*
* @param solver the solver handle
- * @param peer the peer
+ * @param peer the peer to change the preference for
* @param kind the kind to change the preference
* @param score the score
*/
Modified: gnunet/src/ats/gnunet-service-ats_addresses_simplistic.h
===================================================================
--- gnunet/src/ats/gnunet-service-ats_addresses_simplistic.h 2012-12-04
14:57:01 UTC (rev 25232)
+++ gnunet/src/ats/gnunet-service-ats_addresses_simplistic.h 2012-12-04
15:09:39 UTC (rev 25233)
@@ -20,7 +20,7 @@
/**
* @file ats/gnunet-service-ats_addresses_simplistic.h
- * @brief ats mlp problem solver
+ * @brief ats simplistic ressource assignment
* @author Matthias Wachs
* @author Christian Grothoff
*/
@@ -28,14 +28,13 @@
#include "gnunet_statistics_service.h"
#include "gnunet-service-ats_addresses.h"
-struct GAS_SIMPLISTIC_Handle;
/**
* Init the simplistic problem solving component
*
* @param cfg configuration handle
* @param stats the GNUNET_STATISTICS handle
- * @return struct GAS_SIMPLISTIC_Handle * on success, NULL on fail
+ * @return handle for the solver on success, NULL on fail
*/
void *
GAS_simplistic_init (const struct GNUNET_CONFIGURATION_Handle *cfg,
@@ -43,35 +42,53 @@
/**
* Shutdown the simplistic problem solving component
+ *
+ * @param solver the respective handle to shutdown
*/
void
GAS_simplistic_done (void * solver);
/**
- * Updates a single address
+ * Updates a single address in the solve
*
* @param solver the solver Handle
- * @param addresses the address hashmap
- * the address has to be already removed from the hashmap
- * @param address the address to update
+ * @param addresses the address hashmap containing all addresses
+ * @param address the update address
*/
void
GAS_simplistic_address_update (void *solver, struct
GNUNET_CONTAINER_MultiHashMap * addresses, struct ATS_Address *address);
+
+/**
+ * Remove an address from the solver
+ *
+ * @param solver the solver handle
+ * @param addresses the address hashmap containing all addresses
+ * @param address the address to remove
+ */
void
GAS_simplistic_address_delete (void *solver, struct
GNUNET_CONTAINER_MultiHashMap * addresses, struct ATS_Address *address);
+
+/**
+ * Get the prefered address for a specific peer
+ *
+ * @param solver the solver handle
+ * @param addresses the address hashmap containing all addresses
+ * @param peer the identity of the peer
+ */
struct ATS_PreferedAddress *
GAS_simplistic_get_preferred_address (void *solver,
struct GNUNET_CONTAINER_MultiHashMap *
addresses,
const struct GNUNET_PeerIdentity *peer);
+
/**
- * Changes the preferences for a peer in the problem
+ * Changes the preferences for a peer in the problem
*
* @param solver the solver handle
- * @param peer the peer
+ * @param peer the peer to change the preference for
* @param kind the kind to change the preference
* @param score the score
*/
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [GNUnet-SVN] r25233 - gnunet/src/ats,
gnunet <=