aboutsummaryrefslogtreecommitdiff
path: root/src/ats/gnunet-service-ats_performance.c
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2015-05-22 15:04:17 +0000
committerChristian Grothoff <christian@grothoff.org>2015-05-22 15:04:17 +0000
commit8d5551b3b718683d369bf343cb9cdb33c06d5906 (patch)
treec13f539ece60aca48985087c847fc5b3b698a3d2 /src/ats/gnunet-service-ats_performance.c
parent8aea11bce3118cc01c66d3afb5c2ec02b766c95c (diff)
downloadgnunet-8d5551b3b718683d369bf343cb9cdb33c06d5906.tar.gz
gnunet-8d5551b3b718683d369bf343cb9cdb33c06d5906.zip
-do pass local_address_info flag from/to ATS also for performance monitor
Diffstat (limited to 'src/ats/gnunet-service-ats_performance.c')
-rw-r--r--src/ats/gnunet-service-ats_performance.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/ats/gnunet-service-ats_performance.c b/src/ats/gnunet-service-ats_performance.c
index 00b5de51c..d08a2d2de 100644
--- a/src/ats/gnunet-service-ats_performance.c
+++ b/src/ats/gnunet-service-ats_performance.c
@@ -22,6 +22,9 @@
22 * @brief ats service, interaction with 'performance' API 22 * @brief ats service, interaction with 'performance' API
23 * @author Matthias Wachs 23 * @author Matthias Wachs
24 * @author Christian Grothoff 24 * @author Christian Grothoff
25 *
26 * TODO:
27 * - simplify functions by passing a `struct GNUNET_HELLO_Address`
25 */ 28 */
26#include "platform.h" 29#include "platform.h"
27#include "gnunet-service-ats.h" 30#include "gnunet-service-ats.h"
@@ -55,6 +58,7 @@ static struct GNUNET_SERVER_NotificationContext *nc_pic;
55 * #GNUNET_NO if the address is not actively used; 58 * #GNUNET_NO if the address is not actively used;
56 * #GNUNET_SYSERR if this address is no longer available for ATS 59 * #GNUNET_SYSERR if this address is no longer available for ATS
57 * @param prop performance data for the address 60 * @param prop performance data for the address
61 * @param local_address_info information about the local flags for the address
58 * @param bandwidth_out assigned outbound bandwidth 62 * @param bandwidth_out assigned outbound bandwidth
59 * @param bandwidth_in assigned inbound bandwidth 63 * @param bandwidth_in assigned inbound bandwidth
60 */ 64 */
@@ -66,6 +70,7 @@ notify_client (struct GNUNET_SERVER_Client *client,
66 size_t plugin_addr_len, 70 size_t plugin_addr_len,
67 int active, 71 int active,
68 const struct GNUNET_ATS_Properties *prop, 72 const struct GNUNET_ATS_Properties *prop,
73 enum GNUNET_HELLO_AddressInfo local_address_info,
69 struct GNUNET_BANDWIDTH_Value32NBO bandwidth_out, 74 struct GNUNET_BANDWIDTH_Value32NBO bandwidth_out,
70 struct GNUNET_BANDWIDTH_Value32NBO bandwidth_in) 75 struct GNUNET_BANDWIDTH_Value32NBO bandwidth_in)
71{ 76{
@@ -98,6 +103,7 @@ notify_client (struct GNUNET_SERVER_Client *client,
98 memset (&msg->properties, 103 memset (&msg->properties,
99 0, 104 0,
100 sizeof (struct GNUNET_ATS_Properties)); 105 sizeof (struct GNUNET_ATS_Properties));
106 msg->address_local_info = htonl (local_address_info);
101 addrp = (char *) &msg[1]; 107 addrp = (char *) &msg[1];
102 memcpy (addrp, plugin_addr, plugin_addr_len); 108 memcpy (addrp, plugin_addr, plugin_addr_len);
103 strcpy (&addrp[plugin_addr_len], plugin_name); 109 strcpy (&addrp[plugin_addr_len], plugin_name);
@@ -138,6 +144,7 @@ notify_client (struct GNUNET_SERVER_Client *client,
138 * #GNUNET_NO if the address is not actively used; 144 * #GNUNET_NO if the address is not actively used;
139 * #GNUNET_SYSERR if this address is no longer available for ATS 145 * #GNUNET_SYSERR if this address is no longer available for ATS
140 * @param prop performance data for the address 146 * @param prop performance data for the address
147 * @param local_address_info information about the local flags for the address
141 * @param bandwidth_out assigned outbound bandwidth 148 * @param bandwidth_out assigned outbound bandwidth
142 * @param bandwidth_in assigned inbound bandwidth 149 * @param bandwidth_in assigned inbound bandwidth
143 */ 150 */
@@ -148,6 +155,7 @@ GAS_performance_notify_all_clients (const struct GNUNET_PeerIdentity *peer,
148 size_t plugin_addr_len, 155 size_t plugin_addr_len,
149 int active, 156 int active,
150 const struct GNUNET_ATS_Properties *prop, 157 const struct GNUNET_ATS_Properties *prop,
158 enum GNUNET_HELLO_AddressInfo local_address_info,
151 struct GNUNET_BANDWIDTH_Value32NBO bandwidth_out, 159 struct GNUNET_BANDWIDTH_Value32NBO bandwidth_out,
152 struct GNUNET_BANDWIDTH_Value32NBO bandwidth_in) 160 struct GNUNET_BANDWIDTH_Value32NBO bandwidth_in)
153{ 161{
@@ -158,6 +166,7 @@ GAS_performance_notify_all_clients (const struct GNUNET_PeerIdentity *peer,
158 plugin_addr_len, 166 plugin_addr_len,
159 active, 167 active,
160 prop, 168 prop,
169 local_address_info,
161 bandwidth_out, 170 bandwidth_out,
162 bandwidth_in); 171 bandwidth_in);
163 GNUNET_STATISTICS_update (GSA_stats, 172 GNUNET_STATISTICS_update (GSA_stats,
@@ -177,6 +186,7 @@ GAS_performance_notify_all_clients (const struct GNUNET_PeerIdentity *peer,
177 * @param plugin_addr_len length of @a plugin_addr 186 * @param plugin_addr_len length of @a plugin_addr
178 * @param active is address actively used 187 * @param active is address actively used
179 * @param prop performance information 188 * @param prop performance information
189 * @param local_address_info information about the local flags for the address
180 * @param bandwidth_out current outbound bandwidth assigned to address 190 * @param bandwidth_out current outbound bandwidth assigned to address
181 * @param bandwidth_in current inbound bandwidth assigned to address 191 * @param bandwidth_in current inbound bandwidth assigned to address
182 */ 192 */
@@ -188,6 +198,7 @@ peerinfo_it (void *cls,
188 size_t plugin_addr_len, 198 size_t plugin_addr_len,
189 int active, 199 int active,
190 const struct GNUNET_ATS_Properties *prop, 200 const struct GNUNET_ATS_Properties *prop,
201 enum GNUNET_HELLO_AddressInfo local_address_info,
191 struct GNUNET_BANDWIDTH_Value32NBO bandwidth_out, 202 struct GNUNET_BANDWIDTH_Value32NBO bandwidth_out,
192 struct GNUNET_BANDWIDTH_Value32NBO bandwidth_in) 203 struct GNUNET_BANDWIDTH_Value32NBO bandwidth_in)
193{ 204{
@@ -208,6 +219,7 @@ peerinfo_it (void *cls,
208 plugin_addr_len, 219 plugin_addr_len,
209 active, 220 active,
210 prop, 221 prop,
222 local_address_info,
211 bandwidth_out, 223 bandwidth_out,
212 bandwidth_in); 224 bandwidth_in);
213} 225}