aboutsummaryrefslogtreecommitdiff
path: root/src/nse
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2012-06-12 19:07:40 +0000
committerChristian Grothoff <christian@grothoff.org>2012-06-12 19:07:40 +0000
commit6c471eeb15e27f8226492b4860a3c2acb94c5f25 (patch)
treea3a9dcba12ee5356c03056c10b7aba5367b2ef34 /src/nse
parent16bcbbea7133fd2265d46bd2ae1dc70e8c9ba96f (diff)
downloadgnunet-6c471eeb15e27f8226492b4860a3c2acb94c5f25.tar.gz
gnunet-6c471eeb15e27f8226492b4860a3c2acb94c5f25.zip
-consistently use struct GNUNET_HashCode
Diffstat (limited to 'src/nse')
-rw-r--r--src/nse/gnunet-service-nse.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/nse/gnunet-service-nse.c b/src/nse/gnunet-service-nse.c
index af8c7c081..3031e6853 100644
--- a/src/nse/gnunet-service-nse.c
+++ b/src/nse/gnunet-service-nse.c
@@ -477,7 +477,7 @@ static uint32_t
477get_matching_bits (struct GNUNET_TIME_Absolute timestamp, 477get_matching_bits (struct GNUNET_TIME_Absolute timestamp,
478 const struct GNUNET_PeerIdentity *id) 478 const struct GNUNET_PeerIdentity *id)
479{ 479{
480 GNUNET_HashCode timestamp_hash; 480 struct GNUNET_HashCode timestamp_hash;
481 481
482 GNUNET_CRYPTO_hash (&timestamp.abs_value, sizeof (timestamp.abs_value), 482 GNUNET_CRYPTO_hash (&timestamp.abs_value, sizeof (timestamp.abs_value),
483 &timestamp_hash); 483 &timestamp_hash);
@@ -699,7 +699,7 @@ setup_flood_message (unsigned int slot, struct GNUNET_TIME_Absolute ts)
699 * @return GNUNET_OK (continue to iterate) 699 * @return GNUNET_OK (continue to iterate)
700 */ 700 */
701static int 701static int
702schedule_current_round (void *cls, const GNUNET_HashCode * key, void *value) 702schedule_current_round (void *cls, const struct GNUNET_HashCode * key, void *value)
703{ 703{
704 struct NSEPeerEntry *peer_entry = value; 704 struct NSEPeerEntry *peer_entry = value;
705 struct GNUNET_TIME_Relative delay; 705 struct GNUNET_TIME_Relative delay;
@@ -791,7 +791,7 @@ update_flood_message (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
791 * @return the number of leading zero bits. 791 * @return the number of leading zero bits.
792 */ 792 */
793static unsigned int 793static unsigned int
794count_leading_zeroes (const GNUNET_HashCode * hash) 794count_leading_zeroes (const struct GNUNET_HashCode * hash)
795{ 795{
796 unsigned int hash_count; 796 unsigned int hash_count;
797 797
@@ -817,7 +817,7 @@ check_proof_of_work (const struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded *pkey,
817{ 817{
818 char buf[sizeof (struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded) + 818 char buf[sizeof (struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded) +
819 sizeof (val)] GNUNET_ALIGN; 819 sizeof (val)] GNUNET_ALIGN;
820 GNUNET_HashCode result; 820 struct GNUNET_HashCode result;
821 821
822 memcpy (buf, &val, sizeof (val)); 822 memcpy (buf, &val, sizeof (val));
823 memcpy (&buf[sizeof (val)], pkey, 823 memcpy (&buf[sizeof (val)], pkey,
@@ -862,7 +862,7 @@ find_proof (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
862 uint64_t counter; 862 uint64_t counter;
863 char buf[sizeof (struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded) + 863 char buf[sizeof (struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded) +
864 sizeof (uint64_t)] GNUNET_ALIGN; 864 sizeof (uint64_t)] GNUNET_ALIGN;
865 GNUNET_HashCode result; 865 struct GNUNET_HashCode result;
866 unsigned int i; 866 unsigned int i;
867 867
868 proof_task = GNUNET_SCHEDULER_NO_TASK; 868 proof_task = GNUNET_SCHEDULER_NO_TASK;
@@ -952,7 +952,7 @@ verify_message_crypto (const struct GNUNET_NSE_FloodMessage *incoming_flood)
952 * @return GNUNET_OK (continue to iterate) 952 * @return GNUNET_OK (continue to iterate)
953 */ 953 */
954static int 954static int
955update_flood_times (void *cls, const GNUNET_HashCode * key, void *value) 955update_flood_times (void *cls, const struct GNUNET_HashCode * key, void *value)
956{ 956{
957 struct NSEPeerEntry *exclude = cls; 957 struct NSEPeerEntry *exclude = cls;
958 struct NSEPeerEntry *peer_entry = value; 958 struct NSEPeerEntry *peer_entry = value;
@@ -1382,7 +1382,7 @@ run (void *cls, struct GNUNET_SERVER_Handle *server,
1382 GNUNET_SCHEDULER_shutdown (); 1382 GNUNET_SCHEDULER_shutdown ();
1383 return; 1383 return;
1384 } 1384 }
1385 if (nse_work_required >= sizeof (GNUNET_HashCode) * 8) 1385 if (nse_work_required >= sizeof (struct GNUNET_HashCode) * 8)
1386 { 1386 {
1387 GNUNET_log (GNUNET_ERROR_TYPE_ERROR, 1387 GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
1388 _("Invalid work requirement for NSE service. Exiting.\n")); 1388 _("Invalid work requirement for NSE service. Exiting.\n"));