diff options
author | Matthias Wachs <wachs@net.in.tum.de> | 2013-07-05 09:55:42 +0000 |
---|---|---|
committer | Matthias Wachs <wachs@net.in.tum.de> | 2013-07-05 09:55:42 +0000 |
commit | 98dce660a7b76c70da2462995729d0445749233b (patch) | |
tree | 18514ec1c034609ba3e8af76bc98c2cb607042c1 /src/ats/gnunet-service-ats_addresses.c | |
parent | 9bde041f15f890cb36d67cc0d085e6bc143112cb (diff) | |
download | gnunet-98dce660a7b76c70da2462995729d0445749233b.tar.gz gnunet-98dce660a7b76c70da2462995729d0445749233b.zip |
split up update function and using normalized values
Diffstat (limited to 'src/ats/gnunet-service-ats_addresses.c')
-rw-r--r-- | src/ats/gnunet-service-ats_addresses.c | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/src/ats/gnunet-service-ats_addresses.c b/src/ats/gnunet-service-ats_addresses.c index dd12613fd..16f9d3450 100644 --- a/src/ats/gnunet-service-ats_addresses.c +++ b/src/ats/gnunet-service-ats_addresses.c | |||
@@ -939,6 +939,7 @@ GAS_addresses_update (struct GAS_Addresses_Handle *handle, | |||
939 | if (GNUNET_ATS_NETWORK_TYPE == ntohl (atsi_delta[c1].type)) | 939 | if (GNUNET_ATS_NETWORK_TYPE == ntohl (atsi_delta[c1].type)) |
940 | { | 940 | { |
941 | /* Network type changed */ | 941 | /* Network type changed */ |
942 | GNUNET_break (0); | ||
942 | handle->s_address_update_network (handle->solver, aa, | 943 | handle->s_address_update_network (handle->solver, aa, |
943 | ntohl (atsi_delta[c1].value), | 944 | ntohl (atsi_delta[c1].value), |
944 | get_performance_info (aa, GNUNET_ATS_NETWORK_TYPE)); | 945 | get_performance_info (aa, GNUNET_ATS_NETWORK_TYPE)); |
@@ -1356,18 +1357,19 @@ normalized_preference_changed_cb (void *cls, | |||
1356 | /** | 1357 | /** |
1357 | * The relative value for a property changed | 1358 | * The relative value for a property changed |
1358 | * | 1359 | * |
1359 | * @param solver the address handle | 1360 | * @param cls the address handle |
1360 | * @param peer the peer | 1361 | * @param peer the peer |
1361 | * @param type the ATS type | 1362 | * @param type the ATS type |
1362 | * @param prop_rel the new relative preference value | 1363 | * @param prop_rel the new relative preference value |
1363 | */ | 1364 | */ |
1364 | static void | 1365 | static void |
1365 | normalized_property_changed_cb (void *solver, | 1366 | normalized_property_changed_cb (void *cls, |
1366 | struct ATS_Address *address, | 1367 | struct ATS_Address *address, |
1367 | uint32_t type, | 1368 | uint32_t type, |
1368 | double prop_rel) | 1369 | double prop_rel) |
1369 | { | 1370 | { |
1370 | GNUNET_assert (NULL != solver); | 1371 | struct GAS_Addresses_Handle *ah = (struct GAS_Addresses_Handle *) cls; |
1372 | GNUNET_assert (NULL != ah); | ||
1371 | 1373 | ||
1372 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 1374 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
1373 | "Normalized property %s for peer `%s' changed to %.3f \n", | 1375 | "Normalized property %s for peer `%s' changed to %.3f \n", |
@@ -1375,7 +1377,7 @@ normalized_property_changed_cb (void *solver, | |||
1375 | GNUNET_i2s (&address->peer), | 1377 | GNUNET_i2s (&address->peer), |
1376 | prop_rel); | 1378 | prop_rel); |
1377 | 1379 | ||
1378 | GAS_proportional_address_property_changed (solver, | 1380 | ah->s_address_update_property (ah->solver, |
1379 | address, | 1381 | address, |
1380 | type, | 1382 | type, |
1381 | 0, | 1383 | 0, |
@@ -1678,6 +1680,7 @@ GAS_addresses_init (const struct GNUNET_CONFIGURATION_Handle *cfg, | |||
1678 | ah->s_address_update_property = &GAS_mlp_address_property_changed; | 1680 | ah->s_address_update_property = &GAS_mlp_address_property_changed; |
1679 | ah->s_address_update_session = &GAS_mlp_address_session_changed; | 1681 | ah->s_address_update_session = &GAS_mlp_address_session_changed; |
1680 | ah->s_address_update_inuse = &GAS_mlp_address_inuse_changed; | 1682 | ah->s_address_update_inuse = &GAS_mlp_address_inuse_changed; |
1683 | ah->s_address_update_network = &GAS_mlp_address_change_network; | ||
1681 | ah->s_get = &GAS_mlp_get_preferred_address; | 1684 | ah->s_get = &GAS_mlp_get_preferred_address; |
1682 | ah->s_get_stop = &GAS_mlp_stop_get_preferred_address; | 1685 | ah->s_get_stop = &GAS_mlp_stop_get_preferred_address; |
1683 | ah->s_pref = &GAS_mlp_address_change_preference; | 1686 | ah->s_pref = &GAS_mlp_address_change_preference; |