[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[GNUnet-SVN] r33864 - gnunet/src/ats
From: |
gnunet |
Subject: |
[GNUnet-SVN] r33864 - gnunet/src/ats |
Date: |
Thu, 26 Jun 2014 14:40:53 +0200 |
Author: wachs
Date: 2014-06-26 14:40:53 +0200 (Thu, 26 Jun 2014)
New Revision: 33864
Modified:
gnunet/src/ats/plugin_ats_proportional.c
Log:
fix fixmes
+ minor debug
Modified: gnunet/src/ats/plugin_ats_proportional.c
===================================================================
--- gnunet/src/ats/plugin_ats_proportional.c 2014-06-26 12:25:46 UTC (rev
33863)
+++ gnunet/src/ats/plugin_ats_proportional.c 2014-06-26 12:40:53 UTC (rev
33864)
@@ -352,12 +352,12 @@
char *stat_active;
/**
- * FIXME.
+ * Linked list of addresses in this network: head
*/
struct AddressWrapper *head;
/**
- * FIXME.
+ * Linked list of addresses in this network: tail
*/
struct AddressWrapper *tail;
};
@@ -661,17 +661,24 @@
/**
- * FIXME.
+ * Context for finding the best address* Linked list of addresses in this
network: head
*/
struct FindBestAddressCtx
{
+ /**
+ * The solver handle
+ */
struct GAS_PROPORTIONAL_Handle *s;
+
+ /**
+ * The currently best address
+ */
struct ATS_Address *best;
};
/**
- * FIXME.
+ * Find index of a ATS property type in the array.
*/
static int
find_property_index (uint32_t type)
@@ -1037,7 +1044,11 @@
/**
- * FIXME.
+ * Compares addresses
+ *
+ * @param a address a
+ * @param b address b
+ * @return GNUNET_YES if equal, GNUNET_NO else
*/
static int
address_eq (struct ATS_Address *a, struct ATS_Address *b)
@@ -1057,7 +1068,10 @@
/**
- * FIXME.
+ * Notify bandwidth changes to addresses
+ *
+ * @param s solver handle
+ * @param net the network to propagate changes in
*/
static void
propagate_bandwidth (struct GAS_PROPORTIONAL_Handle *s,
@@ -1172,8 +1186,14 @@
/**
- * FIXME
- */
+ * Update active address for a peer:
+ * Check if active address exists and what the best address is, if addresses
+ * are different switch
+ *
+ * @param s solver handle
+ * @param peer the peer to check
+ * return the new address or NULL if no update was performed
+ */
static const struct ATS_Address *
update_active_address (struct GAS_PROPORTIONAL_Handle *s,
const struct GNUNET_PeerIdentity *peer)
@@ -1189,9 +1209,20 @@
/* Find active address */
current_address = get_active_address (s, s->addresses, peer);
+
+ LOG (GNUNET_ERROR_TYPE_INFO,
+ "Peer `%s' has active address %p\n",
+ GNUNET_i2s (peer),
+ current_address);
+
+
/* Find best address */
best_address = get_best_address (s,s->addresses, peer);
+ LOG (GNUNET_ERROR_TYPE_INFO,
+ "Peer `%s' has best address %p\n",
+ GNUNET_i2s (peer), best_address);
+
if (NULL != current_address)
{
if ((NULL == best_address) || ((NULL != best_address) &&
@@ -1338,7 +1369,7 @@
*
* @param solver the solver handle
* @param peer the identity of the peer
- * @return FIXME
+ * @return best address
*/
static const struct ATS_Address *
GAS_proportional_get_preferred_address (void *solver,
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [GNUnet-SVN] r33864 - gnunet/src/ats,
gnunet <=