From 1b49510e7736620d7e10a33326076e2d75c86943 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Julius=20B=C3=BCnger?= Date: Tue, 1 Dec 2015 18:25:37 +0000 Subject: [PATCH] -removed obsolete functions MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Julius Bünger --- src/rps/gnunet-service-rps.c | 90 ------------------------------------ 1 file changed, 90 deletions(-) diff --git a/src/rps/gnunet-service-rps.c b/src/rps/gnunet-service-rps.c index f3fb37c68..fbf42a808 100644 --- a/src/rps/gnunet-service-rps.c +++ b/src/rps/gnunet-service-rps.c @@ -67,11 +67,6 @@ static const struct GNUNET_CONFIGURATION_Handle *cfg; static struct GNUNET_PeerIdentity own_identity; - struct GNUNET_PeerIdentity * -get_rand_peer_ignore_list (const struct GNUNET_PeerIdentity *peer_list, unsigned int size, - const struct GNUNET_PeerIdentity *ignore_list, unsigned int ignore_size); - - /*********************************************************************** * Housekeeping with peers ***********************************************************************/ @@ -543,30 +538,6 @@ void peer_clean (const struct GNUNET_PeerIdentity *peer); -/** - * Check if peer is already in peer array. - */ - int -in_arr (const struct GNUNET_PeerIdentity *array, - unsigned int arr_size, - const struct GNUNET_PeerIdentity *peer) -{ - GNUNET_assert (NULL != peer); - - if (0 == arr_size) - return GNUNET_NO; - - GNUNET_assert (NULL != array); - - unsigned int i; - - for (i = 0; i < arr_size ; i++) - if (0 == GNUNET_CRYPTO_cmp_peer_identity (&array[i], peer)) - return GNUNET_YES; - return GNUNET_NO; -} - - /** * Print peerlist to log. */ @@ -622,67 +593,6 @@ rem_from_list (struct GNUNET_PeerIdentity **peer_list, *peer_list = tmp; } -/** - * Get random peer from the given list but don't return one from the @a ignore_list. - */ - struct GNUNET_PeerIdentity * -get_rand_peer_ignore_list (const struct GNUNET_PeerIdentity *peer_list, - uint32_t list_size, - const struct GNUNET_PeerIdentity *ignore_list, - uint32_t ignore_size) -{ - uint32_t r_index; - uint32_t tmp_size; - struct GNUNET_PeerIdentity *tmp_peer_list; - struct GNUNET_PeerIdentity *peer; - - GNUNET_assert (NULL != peer_list); - if (0 == list_size) - return NULL; - - tmp_size = 0; - tmp_peer_list = NULL; - GNUNET_array_grow (tmp_peer_list, tmp_size, list_size); - memcpy (tmp_peer_list, - peer_list, - list_size * sizeof (struct GNUNET_PeerIdentity)); - peer = GNUNET_new (struct GNUNET_PeerIdentity); - - /**; - * Choose the r_index of the peer we want to return - * at random from the interval of the view - */ - r_index = GNUNET_CRYPTO_random_u64 (GNUNET_CRYPTO_QUALITY_STRONG, - tmp_size); - *peer = tmp_peer_list[r_index]; - - while (in_arr (ignore_list, ignore_size, peer)) - { - rem_from_list (&tmp_peer_list, &tmp_size, peer); - - print_peer_list (tmp_peer_list, tmp_size); - - if (0 == tmp_size) - { - GNUNET_free (peer); - return NULL; - } - - /**; - * Choose the r_index of the peer we want to return - * at random from the interval of the view - */ - r_index = GNUNET_CRYPTO_random_u64 (GNUNET_CRYPTO_QUALITY_STRONG, - tmp_size); - *peer = tmp_peer_list[r_index]; - } - - - GNUNET_array_grow (tmp_peer_list, tmp_size, 0); - - return peer; -} - /** * Get the context of a peer. If not existing, create. -- 2.25.1