[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[GNUnet-SVN] r27722 - gnunet/src/ats
From: |
gnunet |
Subject: |
[GNUnet-SVN] r27722 - gnunet/src/ats |
Date: |
Tue, 2 Jul 2013 15:30:53 +0200 |
Author: wachs
Date: 2013-07-02 15:30:52 +0200 (Tue, 02 Jul 2013)
New Revision: 27722
Modified:
gnunet/src/ats/gnunet-service-ats-solver_mlp.c
gnunet/src/ats/gnunet-service-ats-solver_mlp.h
gnunet/src/ats/gnunet-service-ats-solver_proportional.c
gnunet/src/ats/gnunet-service-ats-solver_proportional.h
gnunet/src/ats/gnunet-service-ats_addresses.c
gnunet/src/ats/gnunet-service-ats_addresses.h
Log:
adding functions for bulkmode
Modified: gnunet/src/ats/gnunet-service-ats-solver_mlp.c
===================================================================
--- gnunet/src/ats/gnunet-service-ats-solver_mlp.c 2013-07-02 11:52:21 UTC
(rev 27721)
+++ gnunet/src/ats/gnunet-service-ats-solver_mlp.c 2013-07-02 13:30:52 UTC
(rev 27722)
@@ -1507,6 +1507,25 @@
/**
+ * Start a bulk operation
+ *
+ * @param solver the solver
+ */
+void
+GAS_mlp_bulk_start (void *solver)
+{
+
+}
+
+void
+GAS_mlp_bulk_stop (void *solver)
+{
+
+}
+
+
+
+/**
* Stop notifying about address and bandwidth changes for this peer
*
* @param solver the MLP handle
Modified: gnunet/src/ats/gnunet-service-ats-solver_mlp.h
===================================================================
--- gnunet/src/ats/gnunet-service-ats-solver_mlp.h 2013-07-02 11:52:21 UTC
(rev 27721)
+++ gnunet/src/ats/gnunet-service-ats-solver_mlp.h 2013-07-02 13:30:52 UTC
(rev 27722)
@@ -450,6 +450,22 @@
/**
+ * Start a bulk operation
+ *
+ * @param solver the solver
+ */
+void
+GAS_mlp_bulk_start (void *solver);
+
+
+/**
+ * Bulk operation done
+ */
+void
+GAS_mlp_bulk_stop (void *solver);
+
+
+/**
* Get the preferred address for a specific peer
*
* @param solver the MLP Handle
Modified: gnunet/src/ats/gnunet-service-ats-solver_proportional.c
===================================================================
--- gnunet/src/ats/gnunet-service-ats-solver_proportional.c 2013-07-02
11:52:21 UTC (rev 27721)
+++ gnunet/src/ats/gnunet-service-ats-solver_proportional.c 2013-07-02
13:30:52 UTC (rev 27722)
@@ -1030,6 +1030,27 @@
/**
+ * Start a bulk operation
+ *
+ * @param solver the solver
+ */
+void
+GAS_proportional_bulk_start (void *solver)
+{
+
+}
+
+/**
+ * Bulk operation done
+ */
+void
+GAS_proportional_bulk_stop (void *solver)
+{
+
+}
+
+
+/**
* Add a new single address to a network
*
* @param solver the solver Handle
Modified: gnunet/src/ats/gnunet-service-ats-solver_proportional.h
===================================================================
--- gnunet/src/ats/gnunet-service-ats-solver_proportional.h 2013-07-02
11:52:21 UTC (rev 27721)
+++ gnunet/src/ats/gnunet-service-ats-solver_proportional.h 2013-07-02
13:30:52 UTC (rev 27722)
@@ -150,6 +150,21 @@
/**
+ * Start a bulk operation
+ *
+ * @param solver the solver
+ */
+void
+GAS_proportional_bulk_start (void *solver);
+
+
+/**
+ * Bulk operation done
+ */
+void
+GAS_proportional_bulk_stop (void *solver);
+
+/**
* Stop notifying about address and bandwidth changes for this peer
*
* @param solver the MLP handle
Modified: gnunet/src/ats/gnunet-service-ats_addresses.c
===================================================================
--- gnunet/src/ats/gnunet-service-ats_addresses.c 2013-07-02 11:52:21 UTC
(rev 27721)
+++ gnunet/src/ats/gnunet-service-ats_addresses.c 2013-07-02 13:30:52 UTC
(rev 27722)
@@ -364,6 +364,16 @@
GAS_solver_address_change_preference s_pref;
/**
+ * Start a bulk operation
+ */
+ GAS_solver_bulk_start s_bulk_start;
+
+ /**
+ * Bulk operation done
+ */
+ GAS_solver_bulk_stop s_bulk_stop;
+
+ /**
* Shutdown solver
*/
GAS_solver_done s_done;
@@ -938,7 +948,9 @@
prev_session = aa->session_id;
aa->session_id = session_id;
+ handle->s_bulk_start (handle->solver);
GAS_normalization_normalize_property (handle->addresses, aa, atsi,
atsi_count);
+ handle->s_bulk_stop (handle->solver);
/* Tell solver about update */
handle->s_update (handle->solver, handle->addresses, aa, prev_session,
aa->used, atsi_delta, atsi_delta_count);
@@ -1404,7 +1416,9 @@
return;
}
/* Tell normalization about change, normalization will call callback if
preference changed */
+ handle->s_bulk_start (handle->solver);
GAS_normalization_normalize_preference (client, peer, kind, score_abs);
+ handle->s_bulk_stop (handle->solver);
}
@@ -1636,6 +1650,8 @@
ah->s_get_stop = &GAS_mlp_stop_get_preferred_address;
ah->s_pref = &GAS_mlp_address_change_preference;
ah->s_del = &GAS_mlp_address_delete;
+ ah->s_bulk_start = &GAS_mlp_bulk_start;
+ ah->s_bulk_stop = &GAS_mlp_bulk_stop;
ah->s_done = &GAS_mlp_done;
#else
GNUNET_free (ah);
@@ -1652,6 +1668,8 @@
ah->s_get_stop = &GAS_proportional_stop_get_preferred_address;
ah->s_pref = &GAS_proportional_address_change_preference;
ah->s_del = &GAS_proportional_address_delete;
+ ah->s_bulk_start = &GAS_proportional_bulk_start;
+ ah->s_bulk_stop = &GAS_proportional_bulk_stop;
ah->s_done = &GAS_proportional_done;
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "ATS started in %s mode\n",
"SIMPLISTIC");
break;
@@ -1668,6 +1686,8 @@
GNUNET_assert (NULL != ah->s_pref);
GNUNET_assert (NULL != ah->s_del);
GNUNET_assert (NULL != ah->s_done);
+ GNUNET_assert (NULL != ah->s_bulk_start);
+ GNUNET_assert (NULL != ah->s_bulk_stop);
GAS_normalization_start (&normalized_preference_changed_cb, ah,
&normalized_property_changed_cb, ah);
Modified: gnunet/src/ats/gnunet-service-ats_addresses.h
===================================================================
--- gnunet/src/ats/gnunet-service-ats_addresses.h 2013-07-02 11:52:21 UTC
(rev 27721)
+++ gnunet/src/ats/gnunet-service-ats_addresses.h 2013-07-02 13:30:52 UTC
(rev 27722)
@@ -448,6 +448,12 @@
enum GNUNET_ATS_PreferenceKind kind,
double pref_rel);
+typedef void
+(*GAS_solver_bulk_start) (void *solver);
+
+typedef void
+(*GAS_solver_bulk_stop) (void *solver);
+
/**
* Add a single address within a network to the solver
*
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [GNUnet-SVN] r27722 - gnunet/src/ats,
gnunet <=