aboutsummaryrefslogtreecommitdiff
path: root/src/ats/plugin_ats_mlp.c
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2015-02-05 12:52:20 +0000
committerChristian Grothoff <christian@grothoff.org>2015-02-05 12:52:20 +0000
commitc55971f17dc99f9833af48e078c8f681be771cb7 (patch)
tree544fd671b67903506419c98d463d086a696e25a1 /src/ats/plugin_ats_mlp.c
parent15dd8e6cc1199d611d804853e134882bf13b234a (diff)
big ATS refactoring, no serious semantic changes should stem from this
Diffstat (limited to 'src/ats/plugin_ats_mlp.c')
-rw-r--r--src/ats/plugin_ats_mlp.c127
1 files changed, 0 insertions, 127 deletions
diff --git a/src/ats/plugin_ats_mlp.c b/src/ats/plugin_ats_mlp.c
index 15fa5e6bd4..eeffb3454a 100644
--- a/src/ats/plugin_ats_mlp.c
+++ b/src/ats/plugin_ats_mlp.c
@@ -2043,131 +2043,6 @@ GAS_mlp_address_property_changed (void *solver,
/**
- * Transport session for this address has changed
- *
- * NOTE: values in addresses are already updated
- *
- * @param solver solver handle
- * @param address the address
- * @param cur_session the current session
- * @param new_session the new session
- */
-static void
-GAS_mlp_address_session_changed (void *solver,
- struct ATS_Address *address,
- uint32_t cur_session,
- uint32_t new_session)
-{
- /* Nothing to do here */
- return;
-}
-
-
-/**
- * Network scope for this address has changed
- *
- * NOTE: values in addresses are already updated
- *
- * @param solver solver handle
- * @param address the address
- * @param current_network the current network
- * @param new_network the new network
- */
-static void
-GAS_mlp_address_change_network (void *solver,
- struct ATS_Address *address,
- uint32_t current_network,
- uint32_t new_network)
-{
- struct MLP_information *mlpi = address->solver_information;
- struct GAS_MLP_Handle *mlp = solver;
- int nets_avail[] = GNUNET_ATS_NetworkType;
- int c1;
-
- GNUNET_assert (NULL != solver);
- GNUNET_assert (NULL != address);
-
- if (GNUNET_ATS_NetworkTypeCount <= new_network)
- {
- GNUNET_break (0);
- return;
- }
-
- if (NULL == mlpi)
- {
- GNUNET_break (0);
- return;
- }
-
- if (mlpi->c_b == MLP_UNDEFINED)
- return; /* This address is not yet in the matrix*/
-
- if (NULL ==
- GNUNET_CONTAINER_multipeermap_get (mlp->requested_peers,
- &address->peer))
- {
- /* Peer is not requested, so no need to update problem */
- GNUNET_break (0);
- return;
- }
-
- if (current_network == new_network)
- {
- GNUNET_break (0);
- return;
- }
-
- for (c1 = 0; c1 < GNUNET_ATS_NetworkTypeCount ; c1 ++)
- {
- if (nets_avail[c1] == new_network)
- break;
- }
-
- if (GNUNET_ATS_NetworkTypeCount == c1)
- {
- /* Invalid network */
- GNUNET_break (0);
- return;
- }
-
- LOG (GNUNET_ERROR_TYPE_DEBUG, "Updating network for peer `%s' from `%s' to `%s'\n",
- GNUNET_i2s (&address->peer),
- GNUNET_ATS_print_network_type(current_network),
- GNUNET_ATS_print_network_type(new_network));
-
- for (c1 = 0; c1 < GNUNET_ATS_NetworkTypeCount; c1++)
- {
- if (mlp->pv.quota_index[c1] == current_network)
- {
- /* Remove from old network */
- mlp_create_problem_update_value (&mlp->p,
- mlp->p.r_quota[c1],
- mlpi->c_b, 0.0, __LINE__);
- break;
- }
- }
-
- for (c1 = 0; c1 < GNUNET_ATS_NetworkTypeCount; c1++)
- {
- if (mlp->pv.quota_index[c1] == new_network)
- {
- /* Remove from old network */
- if (GNUNET_SYSERR == mlp_create_problem_update_value (&mlp->p,
- mlp->p.r_quota[c1],
- mlpi->c_b, 1.0, __LINE__))
- {
- /* This quota did not exist in the problem, recreate */
- GNUNET_break (0);
- }
- break;
- }
- }
-
- mlp->stat_mlp_prob_changed = GNUNET_YES;
-}
-
-
-/**
* Find the active address in the set of addresses of a peer
* @param cls destination
* @param key peer id
@@ -2953,8 +2828,6 @@ libgnunet_plugin_ats_mlp_init (void *cls)
mlp->env = env;
env->sf.s_add = &GAS_mlp_address_add;
env->sf.s_address_update_property = &GAS_mlp_address_property_changed;
- env->sf.s_address_update_session = &GAS_mlp_address_session_changed;
- env->sf.s_address_update_network = &GAS_mlp_address_change_network;
env->sf.s_get = &GAS_mlp_get_preferred_address;
env->sf.s_get_stop = &GAS_mlp_stop_get_preferred_address;
env->sf.s_pref = &GAS_mlp_address_change_preference;