aboutsummaryrefslogtreecommitdiff
path: root/src/rps
diff options
context:
space:
mode:
authorJulius Bünger <buenger@mytum.de>2016-05-16 21:18:43 +0000
committerJulius Bünger <buenger@mytum.de>2016-05-16 21:18:43 +0000
commit8a9054a5a5ca6bb4d4a255b43bb8e956ca40ee87 (patch)
treeb24f9bb119a673307308eab761807259110f51c3 /src/rps
parentd6d45150cab02055da7bd6ce612f2db53a07e3e8 (diff)
downloadgnunet-8a9054a5a5ca6bb4d4a255b43bb8e956ca40ee87.tar.gz
gnunet-8a9054a5a5ca6bb4d4a255b43bb8e956ca40ee87.zip
-rps: rename and doxygen
Diffstat (limited to 'src/rps')
-rw-r--r--src/rps/gnunet-service-rps.c14
-rw-r--r--src/rps/gnunet-service-rps_peers.c22
-rw-r--r--src/rps/gnunet-service-rps_peers.h18
3 files changed, 27 insertions, 27 deletions
diff --git a/src/rps/gnunet-service-rps.c b/src/rps/gnunet-service-rps.c
index f56627a54..69082adac 100644
--- a/src/rps/gnunet-service-rps.c
+++ b/src/rps/gnunet-service-rps.c
@@ -673,7 +673,7 @@ insert_in_sampler (void *cls,
673 if (0 < RPS_sampler_count_id (prot_sampler, peer)) 673 if (0 < RPS_sampler_count_id (prot_sampler, peer))
674 { 674 {
675 /* Make sure we 'know' about this peer */ 675 /* Make sure we 'know' about this peer */
676 (void) Peers_insert_peer_check_liveliness (peer); 676 (void) Peers_check_peer_live (peer);
677 /* Establish a channel towards that peer to indicate we are going to send 677 /* Establish a channel towards that peer to indicate we are going to send
678 * messages to it */ 678 * messages to it */
679 Peers_indicate_sending_intention (peer); 679 Peers_indicate_sending_intention (peer);
@@ -691,7 +691,7 @@ static void
691got_peer (const struct GNUNET_PeerIdentity *peer) 691got_peer (const struct GNUNET_PeerIdentity *peer)
692{ 692{
693 /* If we did not know this peer already, insert it into sampler and view */ 693 /* If we did not know this peer already, insert it into sampler and view */
694 if (GNUNET_YES == Peers_insert_peer_check_liveliness (peer)) 694 if (GNUNET_YES == Peers_check_peer_live (peer))
695 { 695 {
696 Peers_schedule_operation (peer, insert_in_sampler); 696 Peers_schedule_operation (peer, insert_in_sampler);
697 Peers_schedule_operation (peer, insert_in_view); 697 Peers_schedule_operation (peer, insert_in_view);
@@ -1386,7 +1386,7 @@ handle_peer_pull_reply (void *cls,
1386 &peers[i])) 1386 &peers[i]))
1387 { 1387 {
1388 /* Make sure we 'know' about this peer */ 1388 /* Make sure we 'know' about this peer */
1389 (void) Peers_insert_peer_check_liveliness (&peers[i]); 1389 (void) Peers_check_peer_live (&peers[i]);
1390 1390
1391 if (GNUNET_YES == Peers_check_peer_valid (&peers[i])) 1391 if (GNUNET_YES == Peers_check_peer_valid (&peers[i]))
1392 { 1392 {
@@ -1605,7 +1605,7 @@ handle_client_act_malicious (void *cls,
1605 /* Set the flag of the attacked peer to valid to avoid problems */ 1605 /* Set the flag of the attacked peer to valid to avoid problems */
1606 if (GNUNET_NO == Peers_check_peer_known (&attacked_peer)) 1606 if (GNUNET_NO == Peers_check_peer_known (&attacked_peer))
1607 { 1607 {
1608 Peers_insert_peer_check_liveliness (&attacked_peer); 1608 Peers_check_peer_live (&attacked_peer);
1609 Peers_issue_peer_liveliness_check (&attacked_peer); 1609 Peers_issue_peer_liveliness_check (&attacked_peer);
1610 } 1610 }
1611 1611
@@ -1696,7 +1696,7 @@ do_mal_round (void *cls)
1696 * Send as many pushes to the attacked peer as possible 1696 * Send as many pushes to the attacked peer as possible
1697 * That is one push per round as it will ignore more. 1697 * That is one push per round as it will ignore more.
1698 */ 1698 */
1699 Peers_insert_peer_check_liveliness (&attacked_peer); 1699 Peers_check_peer_live (&attacked_peer);
1700 if (GNUNET_YES == Peers_check_peer_valid (&attacked_peer)) 1700 if (GNUNET_YES == Peers_check_peer_valid (&attacked_peer))
1701 send_push (&attacked_peer); 1701 send_push (&attacked_peer);
1702 } 1702 }
@@ -1708,7 +1708,7 @@ do_mal_round (void *cls)
1708 /* Send PUSH to attacked peers */ 1708 /* Send PUSH to attacked peers */
1709 if (GNUNET_YES == Peers_check_peer_known (&attacked_peer)) 1709 if (GNUNET_YES == Peers_check_peer_known (&attacked_peer))
1710 { 1710 {
1711 Peers_insert_peer_check_liveliness (&attacked_peer); 1711 Peers_check_peer_live (&attacked_peer);
1712 if (GNUNET_YES == Peers_check_peer_valid (&attacked_peer)) 1712 if (GNUNET_YES == Peers_check_peer_valid (&attacked_peer))
1713 { 1713 {
1714 LOG (GNUNET_ERROR_TYPE_DEBUG, 1714 LOG (GNUNET_ERROR_TYPE_DEBUG,
@@ -1720,7 +1720,7 @@ do_mal_round (void *cls)
1720 Peers_issue_peer_liveliness_check (&attacked_peer); 1720 Peers_issue_peer_liveliness_check (&attacked_peer);
1721 } 1721 }
1722 else 1722 else
1723 Peers_insert_peer_check_liveliness (&attacked_peer); 1723 Peers_check_peer_live (&attacked_peer);
1724 Peers_issue_peer_liveliness_check (&attacked_peer); 1724 Peers_issue_peer_liveliness_check (&attacked_peer);
1725 1725
1726 /* The maximum of pushes we're going to send this round */ 1726 /* The maximum of pushes we're going to send this round */
diff --git a/src/rps/gnunet-service-rps_peers.c b/src/rps/gnunet-service-rps_peers.c
index 29b08adc8..5179f46dc 100644
--- a/src/rps/gnunet-service-rps_peers.c
+++ b/src/rps/gnunet-service-rps_peers.c
@@ -992,7 +992,8 @@ Peers_get_valid_peers (PeersIterator iterator,
992 * @param peer the new #GNUNET_PeerIdentity 992 * @param peer the new #GNUNET_PeerIdentity
993 * 993 *
994 * @return #GNUNET_YES if peer was inserted 994 * @return #GNUNET_YES if peer was inserted
995 * #GNUNET_NO if peer was already known 995 * #GNUNET_NO otherwise (if peer was already known or
996 * peer was #own_identity)
996 */ 997 */
997int 998int
998Peers_insert_peer (const struct GNUNET_PeerIdentity *peer) 999Peers_insert_peer (const struct GNUNET_PeerIdentity *peer)
@@ -1008,27 +1009,26 @@ Peers_insert_peer (const struct GNUNET_PeerIdentity *peer)
1008 1009
1009 1010
1010/** 1011/**
1011 * @brief Add peer to known peers and check for liveliness. 1012 * @brief Try connecting to a peer to see whether it is online
1012 * 1013 *
1013 * This function is called on new peer_ids from 'external' sources 1014 * If not known yet, insert into known peers
1014 * (client seed, cadet get_peers(), ...)
1015 *
1016 * @param peer the new #GNUNET_PeerIdentity
1017 * 1015 *
1018 * @return #GNUNET_YES if peer was inserted 1016 * @param peer the peer whose liveliness is to be checked
1019 * #GNUNET_NO if peer was already known 1017 * @return #GNUNET_YES if peer had to be inserted
1018 * #GNUNET_NO otherwise (if peer was already known or
1019 * peer was #own_identity)
1020 */ 1020 */
1021int 1021int
1022Peers_insert_peer_check_liveliness (const struct GNUNET_PeerIdentity *peer) 1022Peers_check_peer_live (const struct GNUNET_PeerIdentity *peer)
1023{ 1023{
1024 struct PeerContext *peer_ctx; 1024 struct PeerContext *peer_ctx;
1025 int ret; 1025 int ret;
1026 1026
1027 ret = Peers_insert_peer (peer);
1028 if (0 == GNUNET_CRYPTO_cmp_peer_identity (peer, own_identity)) 1027 if (0 == GNUNET_CRYPTO_cmp_peer_identity (peer, own_identity))
1029 { 1028 {
1030 return ret; 1029 return GNUNET_NO;
1031 } 1030 }
1031 ret = Peers_insert_peer (peer);
1032 peer_ctx = get_peer_ctx (peer); 1032 peer_ctx = get_peer_ctx (peer);
1033 if (GNUNET_NO == Peers_check_peer_valid (peer)) 1033 if (GNUNET_NO == Peers_check_peer_valid (peer))
1034 { 1034 {
diff --git a/src/rps/gnunet-service-rps_peers.h b/src/rps/gnunet-service-rps_peers.h
index 2a7bae6f4..a6018265c 100644
--- a/src/rps/gnunet-service-rps_peers.h
+++ b/src/rps/gnunet-service-rps_peers.h
@@ -152,24 +152,24 @@ Peers_get_valid_peers (PeersIterator iterator,
152 * @param peer the new #GNUNET_PeerIdentity 152 * @param peer the new #GNUNET_PeerIdentity
153 * 153 *
154 * @return #GNUNET_YES if peer was inserted 154 * @return #GNUNET_YES if peer was inserted
155 * #GNUNET_NO if peer was already known 155 * #GNUNET_NO otherwise (if peer was already known or
156 * peer was #own_identity)
156 */ 157 */
157int 158int
158Peers_insert_peer (const struct GNUNET_PeerIdentity *peer); 159Peers_insert_peer (const struct GNUNET_PeerIdentity *peer);
159 160
160/** 161/**
161 * @brief Add peer to known peers and check for liveliness. 162 * @brief Try connecting to a peer to see whether it is online
162 * 163 *
163 * This function is called on new peer_ids from 'external' sources 164 * If not known yet, insert into known peers
164 * (client seed, cadet get_peers(), ...)
165 * 165 *
166 * @param peer the new #GNUNET_PeerIdentity 166 * @param peer the peer whose liveliness is to be checked
167 * 167 * @return #GNUNET_YES if peer had to be inserted
168 * @return #GNUNET_YES if peer was inserted 168 * #GNUNET_NO otherwise (if peer was already known or
169 * #GNUNET_NO if peer was already known 169 * peer was #own_identity)
170 */ 170 */
171int 171int
172Peers_insert_peer_check_liveliness (const struct GNUNET_PeerIdentity *peer); 172Peers_check_peer_live (const struct GNUNET_PeerIdentity *peer);
173 173
174/** 174/**
175 * @brief Remove unecessary data 175 * @brief Remove unecessary data