aboutsummaryrefslogtreecommitdiff
path: root/src/ats/ats_api_scheduling.c
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2012-05-27 17:41:52 +0000
committerChristian Grothoff <christian@grothoff.org>2012-05-27 17:41:52 +0000
commit6a3aa5797d49178e806fc5cc5713806647cbd040 (patch)
tree1036536717420988f348741fb3af5eda76cd74a7 /src/ats/ats_api_scheduling.c
parent9d398608d565f1c15faeb9755a8a3f06e7ccfbfb (diff)
downloadgnunet-6a3aa5797d49178e806fc5cc5713806647cbd040.tar.gz
gnunet-6a3aa5797d49178e806fc5cc5713806647cbd040.zip
-fix #2378
Diffstat (limited to 'src/ats/ats_api_scheduling.c')
-rw-r--r--src/ats/ats_api_scheduling.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/src/ats/ats_api_scheduling.c b/src/ats/ats_api_scheduling.c
index 583ada8f7..5a4e8831f 100644
--- a/src/ats/ats_api_scheduling.c
+++ b/src/ats/ats_api_scheduling.c
@@ -145,7 +145,6 @@ struct GNUNET_ATS_SchedulingHandle
145 */ 145 */
146 struct ATS_Network * net_tail; 146 struct ATS_Network * net_tail;
147 147
148
149 /** 148 /**
150 * Array of session objects (we need to translate them to numbers and back 149 * Array of session objects (we need to translate them to numbers and back
151 * for the protocol; the offset in the array is the session number on the 150 * for the protocol; the offset in the array is the session number on the
@@ -162,7 +161,6 @@ struct GNUNET_ATS_SchedulingHandle
162 /** 161 /**
163 * Task retrieving interfaces from the system 162 * Task retrieving interfaces from the system
164 */ 163 */
165
166 GNUNET_SCHEDULER_TaskIdentifier interface_task; 164 GNUNET_SCHEDULER_TaskIdentifier interface_task;
167 165
168 166
@@ -619,10 +617,10 @@ reconnect (struct GNUNET_ATS_SchedulingHandle *sh)
619 do_transmit (sh); 617 do_transmit (sh);
620} 618}
621 619
620
622/** 621/**
623 * delete the current network list 622 * delete the current network list
624 */ 623 */
625
626static void 624static void
627delete_networks (struct GNUNET_ATS_SchedulingHandle *sh) 625delete_networks (struct GNUNET_ATS_SchedulingHandle *sh)
628{ 626{
@@ -735,7 +733,6 @@ interface_proc (void *cls, const char *name,
735} 733}
736 734
737 735
738
739/** 736/**
740 * Periodically get list of addresses 737 * Periodically get list of addresses
741 * @param cls closure 738 * @param cls closure
@@ -753,14 +750,15 @@ get_addresses (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
753 sh); 750 sh);
754} 751}
755 752
753
756/** 754/**
757 * Returns where the address is located: LAN or WAN or ... 755 * Returns where the address is located: LAN or WAN or ...
756 *
758 * @param sh the scheduling handle 757 * @param sh the scheduling handle
759 * @param addr address 758 * @param addr address
760 * @param addrlen address length 759 * @param addrlen address length
761 * @return location as GNUNET_ATS_Information 760 * @return location as GNUNET_ATS_Information
762 */ 761 */
763
764struct GNUNET_ATS_Information 762struct GNUNET_ATS_Information
765GNUNET_ATS_address_get_type (struct GNUNET_ATS_SchedulingHandle * sh, const struct sockaddr * addr, socklen_t addrlen) 763GNUNET_ATS_address_get_type (struct GNUNET_ATS_SchedulingHandle * sh, const struct sockaddr * addr, socklen_t addrlen)
766{ 764{
@@ -852,6 +850,7 @@ GNUNET_ATS_address_get_type (struct GNUNET_ATS_SchedulingHandle * sh, const stru
852 return (const struct GNUNET_ATS_Information) ats; 850 return (const struct GNUNET_ATS_Information) ats;
853} 851}
854 852
853
855/** 854/**
856 * Initialize the ATS subsystem. 855 * Initialize the ATS subsystem.
857 * 856 *
@@ -959,6 +958,8 @@ GNUNET_ATS_suggest_address (struct GNUNET_ATS_SchedulingHandle *sh,
959 struct PendingMessage *p; 958 struct PendingMessage *p;
960 struct RequestAddressMessage *m; 959 struct RequestAddressMessage *m;
961 960
961 // FIXME: ATS needs to remember this in case of
962 // a disconnect!
962 p = GNUNET_malloc (sizeof (struct PendingMessage) + 963 p = GNUNET_malloc (sizeof (struct PendingMessage) +
963 sizeof (struct RequestAddressMessage)); 964 sizeof (struct RequestAddressMessage));
964 p->size = sizeof (struct RequestAddressMessage); 965 p->size = sizeof (struct RequestAddressMessage);
@@ -999,6 +1000,7 @@ GNUNET_ATS_suggest_address_cancel (struct GNUNET_ATS_SchedulingHandle *sh,
999 do_transmit (sh); 1000 do_transmit (sh);
1000} 1001}
1001 1002
1003
1002/** 1004/**
1003 * We have updated performance statistics for a given address. Note 1005 * We have updated performance statistics for a given address. Note
1004 * that this function can be called for addresses that are currently 1006 * that this function can be called for addresses that are currently
@@ -1123,10 +1125,10 @@ GNUNET_ATS_address_in_use (struct GNUNET_ATS_SchedulingHandle *sh,
1123 memcpy (pm, address->address, address->address_length); 1125 memcpy (pm, address->address, address->address_length);
1124 memcpy (&pm[address->address_length], address->transport_name, namelen); 1126 memcpy (&pm[address->address_length], address->transport_name, namelen);
1125 GNUNET_CONTAINER_DLL_insert_tail (sh->pending_head, sh->pending_tail, p); 1127 GNUNET_CONTAINER_DLL_insert_tail (sh->pending_head, sh->pending_tail, p);
1126
1127 do_transmit (sh); 1128 do_transmit (sh);
1128} 1129}
1129 1130
1131
1130/** 1132/**
1131 * A session got destroyed, stop including it as a valid address. 1133 * A session got destroyed, stop including it as a valid address.
1132 * 1134 *