aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMatthias Wachs <wachs@net.in.tum.de>2013-04-02 14:39:11 +0000
committerMatthias Wachs <wachs@net.in.tum.de>2013-04-02 14:39:11 +0000
commit2b0ae8e74d1f6851e7b323cf066e5038b0980544 (patch)
treef152470be8a403e051855cc6aeb5603659b3a09c /src
parent457a16442aaa51f16a93394eb72a76a3a0262b37 (diff)
downloadgnunet-2b0ae8e74d1f6851e7b323cf066e5038b0980544.tar.gz
gnunet-2b0ae8e74d1f6851e7b323cf066e5038b0980544.zip
docu
Diffstat (limited to 'src')
-rw-r--r--src/ats/gnunet-service-ats_addresses.c59
1 files changed, 58 insertions, 1 deletions
diff --git a/src/ats/gnunet-service-ats_addresses.c b/src/ats/gnunet-service-ats_addresses.c
index 2d3abefac..dfbef6eb2 100644
--- a/src/ats/gnunet-service-ats_addresses.c
+++ b/src/ats/gnunet-service-ats_addresses.c
@@ -485,6 +485,7 @@ disassemble_ats_information (const struct GNUNET_ATS_Information *src,
485 485
486/** 486/**
487 * Free the given address 487 * Free the given address
488 *
488 * @param addr address to destroy 489 * @param addr address to destroy
489 */ 490 */
490static void 491static void
@@ -496,6 +497,7 @@ free_address (struct ATS_Address *addr)
496 497
497/** 498/**
498 * Create a ATS_address with the given information 499 * Create a ATS_address with the given information
500 *
499 * @param peer peer 501 * @param peer peer
500 * @param plugin_name plugin 502 * @param plugin_name plugin
501 * @param plugin_addr address 503 * @param plugin_addr address
@@ -559,6 +561,14 @@ struct CompareAddressContext
559 struct ATS_Address *base_address; 561 struct ATS_Address *base_address;
560}; 562};
561 563
564/**
565 * Comapre addresses
566 *
567 * @param cls a CompareAddressContext containin the source address
568 * @param key peer id
569 * @param value the address to compare with
570 * @return GNUNET_YES to continue, GNUNET_NO if address is founce
571 */
562 572
563static int 573static int
564compare_address_it (void *cls, const struct GNUNET_HashCode * key, void *value) 574compare_address_it (void *cls, const struct GNUNET_HashCode * key, void *value)
@@ -655,6 +665,21 @@ find_equivalent_address (struct GAS_Addresses_Handle *handle,
655} 665}
656 666
657 667
668/**
669 * Lookup an ATS address by the address properties and session or return an
670 * equivalent address with a session == 0
671 *
672 * @param handle the address handle to use
673 * @param peer peer
674 * @param plugin_name transport plugin name
675 * @param plugin_addr plugin address
676 * @param plugin_addr_len length of the plugin address
677 * @param session_id session id, can be 0
678 * @param atsi performance information for this address
679 * @param atsi_count number of performance information contained
680 * @return an ATS_address or NULL
681 */
682
658static struct ATS_Address * 683static struct ATS_Address *
659lookup_address (struct GAS_Addresses_Handle *handle, 684lookup_address (struct GAS_Addresses_Handle *handle,
660 const struct GNUNET_PeerIdentity *peer, 685 const struct GNUNET_PeerIdentity *peer,
@@ -1193,8 +1218,16 @@ GAS_addresses_request_address (struct GAS_Addresses_Handle *handle,
1193} 1218}
1194 1219
1195 1220
1221/**
1222 * Iterator to reset address blocking
1223 *
1224 * @param cls not used
1225 * @param key the peer
1226 * @param value the address to reset
1227 * @return GNUNET_OK to continue
1228 */
1196static int 1229static int
1197reset_address_it (void *cls, const struct GNUNET_HashCode * key, void *value) 1230reset_address_it (void *cls, const struct GNUNET_HashCode *key, void *value)
1198{ 1231{
1199 struct ATS_Address *aa = value; 1232 struct ATS_Address *aa = value;
1200 1233
@@ -1374,6 +1407,12 @@ load_quotas (const struct GNUNET_CONFIGURATION_Handle *cfg, unsigned long long *
1374} 1407}
1375 1408
1376 1409
1410/**
1411 * Callback for solver to notify about assignment changes
1412 *
1413 * @param cls the GAS_Addresses_Handle
1414 * @param address the address with changes
1415 */
1377static void 1416static void
1378bandwidth_changed_cb (void *cls, struct ATS_Address *address) 1417bandwidth_changed_cb (void *cls, struct ATS_Address *address)
1379{ 1418{
@@ -1617,6 +1656,7 @@ GAS_addresses_done (struct GAS_Addresses_Handle *handle)
1617 1656
1618} 1657}
1619 1658
1659
1620struct PeerIteratorContext 1660struct PeerIteratorContext
1621{ 1661{
1622 GNUNET_ATS_Peer_Iterator it; 1662 GNUNET_ATS_Peer_Iterator it;
@@ -1624,6 +1664,15 @@ struct PeerIteratorContext
1624 struct GNUNET_CONTAINER_MultiHashMap *peers_returned; 1664 struct GNUNET_CONTAINER_MultiHashMap *peers_returned;
1625}; 1665};
1626 1666
1667
1668/**
1669 * Iterator to iterate over all peers
1670 *
1671 * @param cls a PeerIteratorContext
1672 * @param key the peer id
1673 * @param value the ATS_address
1674 * @return GNUNET_OK to continue
1675 */
1627static int 1676static int
1628peer_it (void *cls, 1677peer_it (void *cls,
1629 const struct GNUNET_HashCode * key, 1678 const struct GNUNET_HashCode * key,
@@ -1682,6 +1731,14 @@ struct PeerInfoIteratorContext
1682}; 1731};
1683 1732
1684 1733
1734/**
1735 * Iterator to iterate over a peer's addresses
1736 *
1737 * @param cls a PeerInfoIteratorContext
1738 * @param key the peer id
1739 * @param value the ATS_address
1740 * @return GNUNET_OK to continue
1741 */
1685static int 1742static int
1686peerinfo_it (void *cls, 1743peerinfo_it (void *cls,
1687 const struct GNUNET_HashCode * key, 1744 const struct GNUNET_HashCode * key,