diff options
author | Christian Grothoff <christian@grothoff.org> | 2015-05-22 15:04:17 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2015-05-22 15:04:17 +0000 |
commit | 8d5551b3b718683d369bf343cb9cdb33c06d5906 (patch) | |
tree | c13f539ece60aca48985087c847fc5b3b698a3d2 /src/ats/gnunet-service-ats_addresses.c | |
parent | 8aea11bce3118cc01c66d3afb5c2ec02b766c95c (diff) | |
download | gnunet-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_addresses.c')
-rw-r--r-- | src/ats/gnunet-service-ats_addresses.c | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/src/ats/gnunet-service-ats_addresses.c b/src/ats/gnunet-service-ats_addresses.c index 6fd345af5..1cf8368a2 100644 --- a/src/ats/gnunet-service-ats_addresses.c +++ b/src/ats/gnunet-service-ats_addresses.c | |||
@@ -37,7 +37,6 @@ | |||
37 | struct GNUNET_CONTAINER_MultiPeerMap *GSA_addresses; | 37 | struct GNUNET_CONTAINER_MultiPeerMap *GSA_addresses; |
38 | 38 | ||
39 | 39 | ||
40 | |||
41 | /** | 40 | /** |
42 | * Update statistic on number of addresses. | 41 | * Update statistic on number of addresses. |
43 | */ | 42 | */ |
@@ -71,6 +70,7 @@ free_address (struct ATS_Address *addr) | |||
71 | addr->addr_len, | 70 | addr->addr_len, |
72 | GNUNET_NO, | 71 | GNUNET_NO, |
73 | NULL, | 72 | NULL, |
73 | addr->local_address_info, | ||
74 | GNUNET_BANDWIDTH_ZERO, | 74 | GNUNET_BANDWIDTH_ZERO, |
75 | GNUNET_BANDWIDTH_ZERO); | 75 | GNUNET_BANDWIDTH_ZERO); |
76 | GNUNET_free (addr->plugin); | 76 | GNUNET_free (addr->plugin); |
@@ -257,6 +257,7 @@ GAS_addresses_add (const struct GNUNET_PeerIdentity *peer, | |||
257 | new_address->addr_len, | 257 | new_address->addr_len, |
258 | new_address->active, | 258 | new_address->active, |
259 | &new_address->properties, | 259 | &new_address->properties, |
260 | new_address->local_address_info, | ||
260 | GNUNET_BANDWIDTH_value_init (new_address->assigned_bw_out), | 261 | GNUNET_BANDWIDTH_value_init (new_address->assigned_bw_out), |
261 | GNUNET_BANDWIDTH_value_init (new_address->assigned_bw_in)); | 262 | GNUNET_BANDWIDTH_value_init (new_address->assigned_bw_in)); |
262 | } | 263 | } |
@@ -304,6 +305,7 @@ GAS_addresses_update (const struct GNUNET_PeerIdentity *peer, | |||
304 | aa->addr_len, | 305 | aa->addr_len, |
305 | aa->active, | 306 | aa->active, |
306 | prop, | 307 | prop, |
308 | aa->local_address_info, | ||
307 | GNUNET_BANDWIDTH_value_init (aa->assigned_bw_out), | 309 | GNUNET_BANDWIDTH_value_init (aa->assigned_bw_out), |
308 | GNUNET_BANDWIDTH_value_init (aa->assigned_bw_in)); | 310 | GNUNET_BANDWIDTH_value_init (aa->assigned_bw_in)); |
309 | 311 | ||
@@ -448,6 +450,7 @@ peerinfo_it (void *cls, | |||
448 | addr->addr_len, | 450 | addr->addr_len, |
449 | addr->active, | 451 | addr->active, |
450 | &addr->properties, | 452 | &addr->properties, |
453 | addr->local_address_info, | ||
451 | GNUNET_BANDWIDTH_value_init (addr->assigned_bw_out), | 454 | GNUNET_BANDWIDTH_value_init (addr->assigned_bw_out), |
452 | GNUNET_BANDWIDTH_value_init (addr->assigned_bw_in)); | 455 | GNUNET_BANDWIDTH_value_init (addr->assigned_bw_in)); |
453 | return GNUNET_OK; | 456 | return GNUNET_OK; |
@@ -494,6 +497,7 @@ GAS_addresses_get_peer_info (const struct GNUNET_PeerIdentity *peer, | |||
494 | NULL, NULL, NULL, 0, | 497 | NULL, NULL, NULL, 0, |
495 | GNUNET_NO, | 498 | GNUNET_NO, |
496 | NULL, | 499 | NULL, |
500 | GNUNET_HELLO_ADDRESS_INFO_NONE, | ||
497 | GNUNET_BANDWIDTH_ZERO, | 501 | GNUNET_BANDWIDTH_ZERO, |
498 | GNUNET_BANDWIDTH_ZERO); | 502 | GNUNET_BANDWIDTH_ZERO); |
499 | } | 503 | } |
@@ -534,6 +538,7 @@ struct AddressIteration | |||
534 | * @param plugin_addr_len length of @a plugin_addr | 538 | * @param plugin_addr_len length of @a plugin_addr |
535 | * @param active #GNUNET_YES if this address is actively used | 539 | * @param active #GNUNET_YES if this address is actively used |
536 | * @param prop performance information | 540 | * @param prop performance information |
541 | * @param local_address_info flags for the address | ||
537 | * @param bandwidth_out current outbound bandwidth assigned to address | 542 | * @param bandwidth_out current outbound bandwidth assigned to address |
538 | * @param bandwidth_in current inbound bandwidth assigned to address | 543 | * @param bandwidth_in current inbound bandwidth assigned to address |
539 | */ | 544 | */ |
@@ -545,6 +550,7 @@ transmit_req_addr (struct AddressIteration *ai, | |||
545 | size_t plugin_addr_len, | 550 | size_t plugin_addr_len, |
546 | int active, | 551 | int active, |
547 | const struct GNUNET_ATS_Properties *prop, | 552 | const struct GNUNET_ATS_Properties *prop, |
553 | enum GNUNET_HELLO_AddressInfo local_address_info, | ||
548 | struct GNUNET_BANDWIDTH_Value32NBO bandwidth_out, | 554 | struct GNUNET_BANDWIDTH_Value32NBO bandwidth_out, |
549 | struct GNUNET_BANDWIDTH_Value32NBO bandwidth_in) | 555 | struct GNUNET_BANDWIDTH_Value32NBO bandwidth_in) |
550 | 556 | ||
@@ -585,6 +591,7 @@ transmit_req_addr (struct AddressIteration *ai, | |||
585 | memset (&msg->properties, | 591 | memset (&msg->properties, |
586 | 0, | 592 | 0, |
587 | sizeof (struct GNUNET_ATS_Properties)); | 593 | sizeof (struct GNUNET_ATS_Properties)); |
594 | msg->address_local_info = htonl ((uint32_t) local_address_info); | ||
588 | addrp = (char *) &msg[1]; | 595 | addrp = (char *) &msg[1]; |
589 | if (NULL != plugin_addr) | 596 | if (NULL != plugin_addr) |
590 | memcpy (addrp, plugin_addr, plugin_addr_len); | 597 | memcpy (addrp, plugin_addr, plugin_addr_len); |
@@ -616,6 +623,7 @@ transmit_req_addr (struct AddressIteration *ai, | |||
616 | * @param plugin_addr_len length of @a plugin_addr | 623 | * @param plugin_addr_len length of @a plugin_addr |
617 | * @param active is address actively used | 624 | * @param active is address actively used |
618 | * @param prop performance information | 625 | * @param prop performance information |
626 | * @param local_address_info additional local info for the address | ||
619 | * @param bandwidth_out current outbound bandwidth assigned to address | 627 | * @param bandwidth_out current outbound bandwidth assigned to address |
620 | * @param bandwidth_in current inbound bandwidth assigned to address | 628 | * @param bandwidth_in current inbound bandwidth assigned to address |
621 | */ | 629 | */ |
@@ -627,6 +635,7 @@ req_addr_peerinfo_it (void *cls, | |||
627 | size_t plugin_addr_len, | 635 | size_t plugin_addr_len, |
628 | int active, | 636 | int active, |
629 | const struct GNUNET_ATS_Properties *prop, | 637 | const struct GNUNET_ATS_Properties *prop, |
638 | enum GNUNET_HELLO_AddressInfo local_address_info, | ||
630 | struct GNUNET_BANDWIDTH_Value32NBO bandwidth_out, | 639 | struct GNUNET_BANDWIDTH_Value32NBO bandwidth_out, |
631 | struct GNUNET_BANDWIDTH_Value32NBO bandwidth_in) | 640 | struct GNUNET_BANDWIDTH_Value32NBO bandwidth_in) |
632 | { | 641 | { |
@@ -658,6 +667,7 @@ req_addr_peerinfo_it (void *cls, | |||
658 | plugin_addr, plugin_addr_len, | 667 | plugin_addr, plugin_addr_len, |
659 | active, | 668 | active, |
660 | prop, | 669 | prop, |
670 | local_address_info, | ||
661 | bandwidth_out, | 671 | bandwidth_out, |
662 | bandwidth_in); | 672 | bandwidth_in); |
663 | } | 673 | } |
@@ -712,6 +722,7 @@ GAS_handle_request_address_list (void *cls, | |||
712 | NULL, NULL, NULL, | 722 | NULL, NULL, NULL, |
713 | 0, GNUNET_NO, | 723 | 0, GNUNET_NO, |
714 | NULL, | 724 | NULL, |
725 | GNUNET_HELLO_ADDRESS_INFO_NONE, | ||
715 | GNUNET_BANDWIDTH_ZERO, | 726 | GNUNET_BANDWIDTH_ZERO, |
716 | GNUNET_BANDWIDTH_ZERO); | 727 | GNUNET_BANDWIDTH_ZERO); |
717 | GNUNET_SERVER_receive_done (client, | 728 | GNUNET_SERVER_receive_done (client, |