aboutsummaryrefslogtreecommitdiff
path: root/src/transport/gnunet-service-transport.c
diff options
context:
space:
mode:
authorMatthias Wachs <wachs@net.in.tum.de>2011-07-18 15:45:50 +0000
committerMatthias Wachs <wachs@net.in.tum.de>2011-07-18 15:45:50 +0000
commit03f5899ccc1a4d6fdf2d1eae4be2a7cdd90c3021 (patch)
tree759fa9d5b3b4bcd236cfc1bdd7281fced308f091 /src/transport/gnunet-service-transport.c
parent555ebf304585fb4ae296cdd9388961d9b303f7e2 (diff)
downloadgnunet-03f5899ccc1a4d6fdf2d1eae4be2a7cdd90c3021.tar.gz
gnunet-03f5899ccc1a4d6fdf2d1eae4be2a7cdd90c3021.zip
Diffstat (limited to 'src/transport/gnunet-service-transport.c')
-rw-r--r--src/transport/gnunet-service-transport.c31
1 files changed, 16 insertions, 15 deletions
diff --git a/src/transport/gnunet-service-transport.c b/src/transport/gnunet-service-transport.c
index cb73083e0..09a3ef178 100644
--- a/src/transport/gnunet-service-transport.c
+++ b/src/transport/gnunet-service-transport.c
@@ -997,7 +997,7 @@ static int update_addr_value (struct ForeignAddressList *fal, uint32_t value , i
997 fal->quality[c].values[1] = fal->quality[c].values[2]; 997 fal->quality[c].values[1] = fal->quality[c].values[2];
998 fal->quality[c].values[2] = value; 998 fal->quality[c].values[2] = value;
999 set = GNUNET_YES; 999 set = GNUNET_YES;
1000#if HAVE_GLPK 1000#if HAVE_LIBGLPK
1001 ats_modify_problem_state (ats, ATS_QUALITY_UPDATED); 1001 ats_modify_problem_state (ats, ATS_QUALITY_UPDATED);
1002#endif 1002#endif
1003 } 1003 }
@@ -1010,7 +1010,7 @@ static int update_addr_value (struct ForeignAddressList *fal, uint32_t value , i
1010 { 1010 {
1011 fal->ressources[c].c = value; 1011 fal->ressources[c].c = value;
1012 set = GNUNET_YES; 1012 set = GNUNET_YES;
1013#if HAVE_GLPK 1013#if HAVE_LIBGLPK
1014 ats_modify_problem_state (ats, ATS_COST_UPDATED); 1014 ats_modify_problem_state (ats, ATS_COST_UPDATED);
1015#endif 1015#endif
1016 } 1016 }
@@ -2510,7 +2510,7 @@ plugin_env_session_end (void *cls,
2510 } 2510 }
2511 GNUNET_free_non_null(pos->ressources); 2511 GNUNET_free_non_null(pos->ressources);
2512 GNUNET_free_non_null(pos->quality); 2512 GNUNET_free_non_null(pos->quality);
2513#if HAVE_GLPK 2513#if HAVE_LIBGLPK
2514 ats_modify_problem_state (ats, ATS_MODIFIED); 2514 ats_modify_problem_state (ats, ATS_MODIFIED);
2515#endif 2515#endif
2516 if (GNUNET_YES != pos->connected) 2516 if (GNUNET_YES != pos->connected)
@@ -2680,9 +2680,9 @@ notify_clients_connect (const struct GNUNET_PeerIdentity *peer,
2680 /* notify ats about connecting peer */ 2680 /* notify ats about connecting peer */
2681 if ((ats != NULL) && (shutdown_in_progress == GNUNET_NO)) 2681 if ((ats != NULL) && (shutdown_in_progress == GNUNET_NO))
2682 { 2682 {
2683#if HAVE_GLPK 2683#if HAVE_LIBGLPK
2684 ats_modify_problem_state(ats, ATS_MODIFIED); 2684 ats_modify_problem_state(ats, ATS_MODIFIED);
2685 ats_calculate_bandwidth_distribution (ats, stats); 2685 ats_calculate_bandwidth_distribution (ats);
2686#endif 2686#endif
2687 } 2687 }
2688 cpos = clients; 2688 cpos = clients;
@@ -2728,9 +2728,9 @@ notify_clients_disconnect (const struct GNUNET_PeerIdentity *peer)
2728 /* notify ats about connecting peer */ 2728 /* notify ats about connecting peer */
2729 if ((ats != NULL) && (shutdown_in_progress == GNUNET_NO)) 2729 if ((ats != NULL) && (shutdown_in_progress == GNUNET_NO))
2730 { 2730 {
2731#if HAVE_GLPK 2731#if HAVE_LIBGLPK
2732 ats_modify_problem_state(ats, ATS_MODIFIED); 2732 ats_modify_problem_state(ats, ATS_MODIFIED);
2733 ats_calculate_bandwidth_distribution (ats, stats); 2733 ats_calculate_bandwidth_distribution (ats);
2734#endif 2734#endif
2735 } 2735 }
2736 2736
@@ -4896,7 +4896,7 @@ disconnect_neighbour (struct NeighbourList *n, int check)
4896 n->received_pong = GNUNET_NO; 4896 n->received_pong = GNUNET_NO;
4897 notify_clients_disconnect (&n->id); 4897 notify_clients_disconnect (&n->id);
4898 } 4898 }
4899#if HAVE_GLPK 4899#if HAVE_LIBGLPK
4900 ats_modify_problem_state(ats, ATS_MODIFIED); 4900 ats_modify_problem_state(ats, ATS_MODIFIED);
4901#endif 4901#endif
4902 /* clean up all plugins, cancel connections and pending transmissions */ 4902 /* clean up all plugins, cancel connections and pending transmissions */
@@ -5428,7 +5428,7 @@ plugin_env_receive (void *cls, const struct GNUNET_PeerIdentity *peer,
5428 if ((ntohs(message->type) == GNUNET_MESSAGE_TYPE_TRANSPORT_ATS) && 5428 if ((ntohs(message->type) == GNUNET_MESSAGE_TYPE_TRANSPORT_ATS) &&
5429 (ntohs(message->size) == (sizeof (struct GNUNET_MessageHeader) + sizeof (uint32_t)))) 5429 (ntohs(message->size) == (sizeof (struct GNUNET_MessageHeader) + sizeof (uint32_t))))
5430 { 5430 {
5431#if HAVE_GLPK 5431#if HAVE_LIBGLPK
5432 uint32_t value = ntohl(*((uint32_t *) &message[1])); 5432 uint32_t value = ntohl(*((uint32_t *) &message[1]));
5433 //GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "GNUNET_MESSAGE_TYPE_TRANSPORT_ATS: %i \n", value); 5433 //GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "GNUNET_MESSAGE_TYPE_TRANSPORT_ATS: %i \n", value);
5434 /* Force ressource and quality update */ 5434 /* Force ressource and quality update */
@@ -6322,7 +6322,7 @@ shutdown_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
6322 GNUNET_SCHEDULER_cancel(ats_task); 6322 GNUNET_SCHEDULER_cancel(ats_task);
6323 ats_task = GNUNET_SCHEDULER_NO_TASK; 6323 ats_task = GNUNET_SCHEDULER_NO_TASK;
6324 } 6324 }
6325#if HAVE_GLPK 6325#if HAVE_LIBGLPK
6326 if (ats != NULL) 6326 if (ats != NULL)
6327 ats_shutdown (ats); 6327 ats_shutdown (ats);
6328#endif 6328#endif
@@ -6516,8 +6516,8 @@ schedule_ats (void *cls,
6516#if DEBUG_ATS 6516#if DEBUG_ATS
6517 GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Running scheduled calculation\n"); 6517 GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Running scheduled calculation\n");
6518#endif 6518#endif
6519#if HAVE_GLPK 6519#if HAVE_LIBGLPK
6520 ats_calculate_bandwidth_distribution (ats, stats); 6520 ats_calculate_bandwidth_distribution (ats);
6521#endif 6521#endif
6522 last_ats_execution = GNUNET_TIME_absolute_get(); 6522 last_ats_execution = GNUNET_TIME_absolute_get();
6523 6523
@@ -6671,7 +6671,7 @@ run (void *cls,
6671 int co; 6671 int co;
6672 char * section; 6672 char * section;
6673 unsigned long long value; 6673 unsigned long long value;
6674#if HAVE_GLPK 6674#if HAVE_LIBGLPK
6675 double D = 1.0; 6675 double D = 1.0;
6676 double U = 1.0; 6676 double U = 1.0;
6677 double R = 1.0; 6677 double R = 1.0;
@@ -6720,7 +6720,7 @@ run (void *cls,
6720 } 6720 }
6721 GNUNET_free (section); 6721 GNUNET_free (section);
6722 } 6722 }
6723#if HAVE_GLPK 6723#if HAVE_LIBGLPK
6724 ats = ats_init (D, U, R, v_b_min, v_n_min, 6724 ats = ats_init (D, U, R, v_b_min, v_n_min,
6725 ATS_MAX_ITERATIONS, ATS_MAX_EXEC_DURATION, 6725 ATS_MAX_ITERATIONS, ATS_MAX_EXEC_DURATION,
6726 create_ats_information, 6726 create_ats_information,
@@ -6764,8 +6764,9 @@ run (void *cls,
6764 "transport", 6764 "transport",
6765 "ATS_MIN_INTERVAL", 6765 "ATS_MIN_INTERVAL",
6766 &ats_minimum_interval)); 6766 &ats_minimum_interval));
6767#if HAVE_GLPK 6767#if HAVE_LIBGLPK
6768 ats_set_logging_options (ats, 6768 ats_set_logging_options (ats,
6769 stats,
6769 minimum_addresses, 6770 minimum_addresses,
6770 minimum_peers, 6771 minimum_peers,
6771 overwrite_dump, 6772 overwrite_dump,