aboutsummaryrefslogtreecommitdiff
path: root/src/transport/gnunet-service-transport_clients.c
diff options
context:
space:
mode:
authorMatthias Wachs <wachs@net.in.tum.de>2012-07-06 13:24:20 +0000
committerMatthias Wachs <wachs@net.in.tum.de>2012-07-06 13:24:20 +0000
commit56389a7d277b05c9c2968b7ebd529a12f8be15eb (patch)
tree693ef3440c9db0a2c0662d321f91fcea166176fc /src/transport/gnunet-service-transport_clients.c
parent88d047688f2aa11526316fdeaedb4c607bba3cf1 (diff)
downloadgnunet-56389a7d277b05c9c2968b7ebd529a12f8be15eb.tar.gz
gnunet-56389a7d277b05c9c2968b7ebd529a12f8be15eb.zip
- implementation for mantis 0002485
Diffstat (limited to 'src/transport/gnunet-service-transport_clients.c')
-rw-r--r--src/transport/gnunet-service-transport_clients.c16
1 files changed, 13 insertions, 3 deletions
diff --git a/src/transport/gnunet-service-transport_clients.c b/src/transport/gnunet-service-transport_clients.c
index b2981951d..c530a9da4 100644
--- a/src/transport/gnunet-service-transport_clients.c
+++ b/src/transport/gnunet-service-transport_clients.c
@@ -437,7 +437,9 @@ notify_client_about_neighbour (void *cls,
437 const struct GNUNET_PeerIdentity *peer, 437 const struct GNUNET_PeerIdentity *peer,
438 const struct GNUNET_ATS_Information *ats, 438 const struct GNUNET_ATS_Information *ats,
439 uint32_t ats_count, 439 uint32_t ats_count,
440 const struct GNUNET_HELLO_Address *address) 440 const struct GNUNET_HELLO_Address *address,
441 struct GNUNET_BANDWIDTH_Value32NBO bandwidth_in,
442 struct GNUNET_BANDWIDTH_Value32NBO bandwidth_out)
441{ 443{
442 struct TransportClient *tc = cls; 444 struct TransportClient *tc = cls;
443 struct ConnectInfoMessage *cim; 445 struct ConnectInfoMessage *cim;
@@ -453,6 +455,8 @@ notify_client_about_neighbour (void *cls,
453 cim->header.type = htons (GNUNET_MESSAGE_TYPE_TRANSPORT_CONNECT); 455 cim->header.type = htons (GNUNET_MESSAGE_TYPE_TRANSPORT_CONNECT);
454 cim->ats_count = htonl (ats_count); 456 cim->ats_count = htonl (ats_count);
455 cim->id = *peer; 457 cim->id = *peer;
458 cim->quota_in = bandwidth_in;
459 cim->quota_out = bandwidth_out;
456 ap = (struct GNUNET_ATS_Information *) &cim[1]; 460 ap = (struct GNUNET_ATS_Information *) &cim[1];
457 memcpy (ap, ats, ats_count * sizeof (struct GNUNET_ATS_Information)); 461 memcpy (ap, ats, ats_count * sizeof (struct GNUNET_ATS_Information));
458 unicast (tc, &cim->header, GNUNET_NO); 462 unicast (tc, &cim->header, GNUNET_NO);
@@ -832,11 +836,15 @@ compose_address_iterate_response_message (const struct GNUNET_PeerIdentity
832 * @param ats performance data 836 * @param ats performance data
833 * @param ats_count number of entries in ats (excluding 0-termination) 837 * @param ats_count number of entries in ats (excluding 0-termination)
834 * @param address the address 838 * @param address the address
839 * @param bandwidth_in inbound quota in NBO
840 * @param bandwidth_out outbound quota in NBO
835 */ 841 */
836static void 842static void
837output_address (void *cls, const struct GNUNET_PeerIdentity *peer, 843output_address (void *cls, const struct GNUNET_PeerIdentity *peer,
838 const struct GNUNET_ATS_Information *ats, uint32_t ats_count, 844 const struct GNUNET_ATS_Information *ats, uint32_t ats_count,
839 const struct GNUNET_HELLO_Address *address) 845 const struct GNUNET_HELLO_Address *address,
846 struct GNUNET_BANDWIDTH_Value32NBO bandwidth_in,
847 struct GNUNET_BANDWIDTH_Value32NBO bandwidth_out)
840{ 848{
841 struct GNUNET_SERVER_TransmitContext *tc = cls; 849 struct GNUNET_SERVER_TransmitContext *tc = cls;
842 struct AddressIterateResponseMessage *msg; 850 struct AddressIterateResponseMessage *msg;
@@ -900,7 +908,9 @@ clients_handle_address_iterate (void *cls, struct GNUNET_SERVER_Client *client,
900 /* just return one neighbour */ 908 /* just return one neighbour */
901 address = GST_neighbour_get_current_address (&msg->peer); 909 address = GST_neighbour_get_current_address (&msg->peer);
902 if (address != NULL) 910 if (address != NULL)
903 output_address (tc, &msg->peer, NULL, 0, address); 911 output_address (tc, &msg->peer, NULL, 0, address,
912 GNUNET_CONSTANTS_DEFAULT_BW_IN_OUT,
913 GNUNET_CONSTANTS_DEFAULT_BW_IN_OUT);
904 } 914 }
905 if (GNUNET_YES != ntohl (msg->one_shot)) 915 if (GNUNET_YES != ntohl (msg->one_shot))
906 setup_monitoring_client (client, &msg->peer); 916 setup_monitoring_client (client, &msg->peer);