memcmp() -> GNUNET_memcmp(), first take
authorJulius Bünger <buenger@mytum.de>
Fri, 26 Apr 2019 03:56:54 +0000 (05:56 +0200)
committerJulius Bünger <buenger@mytum.de>
Fri, 26 Apr 2019 03:56:54 +0000 (05:56 +0200)
66 files changed:
src/ats-tests/ats-testing.c
src/ats-tests/perf_ats.c
src/ats/ats_api_performance.c
src/ats/ats_api_scheduling.c
src/ats/gnunet-ats-solver-eval.c
src/ats/gnunet-service-ats-new.c
src/ats/gnunet-service-ats_addresses.c
src/ats/gnunet-service-ats_normalization.c
src/ats/plugin_ats2_simple.c
src/ats/plugin_ats_mlp.c
src/ats/plugin_ats_ril.c
src/ats/test_ats_lib.c
src/cadet/gnunet-service-cadet_channel.c
src/cadet/gnunet-service-cadet_connection.c
src/cadet/gnunet-service-cadet_core.c
src/cadet/gnunet-service-cadet_hello.c
src/cadet/gnunet-service-cadet_paths.c
src/cadet/gnunet-service-cadet_tunnels.c
src/consensus/gnunet-service-consensus.c
src/credential/gnunet-service-credential.c
src/datastore/plugin_datastore_mysql.c
src/dht/gnunet-service-dht_neighbours.c
src/dht/gnunet-service-dht_routing.c
src/exit/gnunet-daemon-exit.c
src/gns/plugin_block_gns.c
src/hello/hello.c
src/hello/test_hello.c
src/hostlist/gnunet-daemon-hostlist.c
src/identity/gnunet-service-identity.c
src/namestore/gnunet-service-namestore.c
src/namestore/gnunet-zoneimport.c
src/namestore/namestore_api.c
src/namestore/namestore_api_monitor.c
src/namestore/perf_namestore_api_zone_iteration.c
src/namestore/plugin_namestore_heap.c
src/namestore/test_namestore_api_lookup_nick.c
src/namestore/test_namestore_api_lookup_private.c
src/namestore/test_namestore_api_monitoring.c
src/namestore/test_namestore_api_monitoring_existing.c
src/namestore/test_namestore_api_zone_iteration.c
src/namestore/test_namestore_api_zone_iteration_nick.c
src/namestore/test_namestore_api_zone_iteration_specific_zone.c
src/namestore/test_namestore_api_zone_iteration_stop.c
src/namestore/test_namestore_api_zone_to_name.c
src/namestore/test_plugin_namestore.c
src/nat-auto/gnunet-service-nat-auto_legacy.c
src/nat/gnunet-service-nat.c
src/nse/gnunet-service-nse.c
src/peerinfo/gnunet-service-peerinfo.c
src/peerinfo/peerinfo_api.c
src/peerinfo/test_peerinfo_api_notify_friend_only.c
src/pq/test_pq.c
src/pt/gnunet-daemon-pt.c
src/reclaim/oidc_helper.c
src/reclaim/plugin_rest_openid_connect.c
src/regex/regex_block_lib.c
src/revocation/gnunet-revocation.c
src/revocation/gnunet-service-revocation.c
src/scalarproduct/gnunet-service-scalarproduct-ecc_alice.c
src/scalarproduct/gnunet-service-scalarproduct_alice.c
src/secretsharing/gnunet-secretsharing-profiler.c
src/secretsharing/gnunet-service-secretsharing.c
src/set/gnunet-service-set_intersection.c
src/sq/test_sq.c
src/topology/gnunet-daemon-topology.c
src/vpn/gnunet-service-vpn.c

index 2d714d2beef87d01dc058146affe7dfc8333ed9f..d8b9e5ef564a9154853513cfb9f03273bcf9d8ff 100644 (file)
@@ -151,9 +151,8 @@ find_partner (struct BenchmarkPeer *me,
   for (c_m = 0; c_m < me->num_partners; c_m++)
   {
     /* Find a partner with other as destination */
-    if (0 == memcmp (peer,
-                    &me->partners[c_m].dest->id,
-                    sizeof (struct GNUNET_PeerIdentity)))
+    if (0 == GNUNET_memcmp (peer,
+                    &me->partners[c_m].dest->id))
     {
       return &me->partners[c_m];
     }
@@ -170,17 +169,15 @@ find_peer (const struct GNUNET_PeerIdentity * peer)
 
   for (c_p = 0; c_p < top->num_masters; c_p++)
   {
-    if (0 == memcmp (&top->mps[c_p].id,
-                    peer,
-                    sizeof(struct GNUNET_PeerIdentity)))
+    if (0 == GNUNET_memcmp (&top->mps[c_p].id,
+                    peer))
       return &top->mps[c_p];
   }
 
   for (c_p = 0; c_p < top->num_slaves; c_p++)
   {
-    if (0 == memcmp (&top->sps[c_p].id,
-                    peer,
-                    sizeof(struct GNUNET_PeerIdentity)))
+    if (0 == GNUNET_memcmp (&top->sps[c_p].id,
+                    peer))
       return &top->sps[c_p];
   }
   return NULL ;
index 91c58e9a976906b2e2836b14ffc1f70be876766a..b8ab35f99eb372069994d9c2567fa2c0fb9e4a73 100644 (file)
@@ -328,8 +328,7 @@ find_partner (struct BenchmarkPeer *me,
   for (c_m = 0; c_m < me->num_partners; c_m++)
   {
     /* Find a partner with other as destination */
-    if (0 == memcmp (peer, &me->partners[c_m].dest->id,
-            sizeof(struct GNUNET_PeerIdentity)))
+    if (0 == GNUNET_memcmp (peer, &me->partners[c_m].dest->id))
     {
       return &me->partners[c_m];
     }
index 12dec776e07b342a6138f830dc98d50a02e5eb80..0954c02d5ec39d7b1f28b46cad6b850484415a06 100644 (file)
@@ -383,9 +383,8 @@ handle_reservation_result (void *cls,
 
   amount = ntohl (rr->amount);
   rc = ph->reservation_head;
-  if (0 != memcmp (&rr->peer,
-                   &rc->peer,
-                   sizeof(struct GNUNET_PeerIdentity)))
+  if (0 != GNUNET_memcmp (&rr->peer,
+                   &rc->peer))
   {
     GNUNET_break(0);
     reconnect (ph);
@@ -498,7 +497,7 @@ handle_address_list (void *cls,
     return; /* was canceled */
 
   memset (&allzeros, '\0', sizeof (allzeros));
-  if ( (0 == memcmp (&allzeros, &pi->peer, sizeof(allzeros))) &&
+  if ( (0 == GNUNET_is_zero (&pi->peer)) &&
        (0 == plugin_name_length) &&
        (0 == plugin_address_length) )
   {
index 3c8ad9b9a01d51b9cf96ed5d5f2807d4ec0590c4..532426e91371423b668cd1c3777bb125285742d9 100644 (file)
@@ -230,9 +230,8 @@ find_session (struct GNUNET_ATS_SchedulingHandle *sh,
        as we communicate asynchronously with the ATS service. */
     return NULL;
   }
-  if (0 != memcmp (peer,
-                   &ar->address->peer,
-                   sizeof (struct GNUNET_PeerIdentity)))
+  if (0 != GNUNET_memcmp (peer,
+                   &ar->address->peer))
   {
     GNUNET_break (0);
     return NULL;
@@ -298,9 +297,8 @@ find_session_id (struct GNUNET_ATS_SchedulingHandle *sh,
          (GNUNET_NO == sh->session_array[i]->in_destroy) &&
          ( (session == sh->session_array[i]->session) ||
            (NULL == sh->session_array[i]->session) ) &&
-         (0 == memcmp (&address->peer,
-                       &sh->session_array[i]->address->peer,
-                       sizeof (struct GNUNET_PeerIdentity))) &&
+         (0 == GNUNET_memcmp (&address->peer,
+                       &sh->session_array[i]->address->peer)) &&
          (0 == GNUNET_HELLO_address_cmp (address,
                                          sh->session_array[i]->address)) )
       return i;
index 62e09533f185ed4f18b730612d50b935d440c798..833cb9ded0ffaf65349f19b4e691a8272a740f61 100644 (file)
@@ -122,7 +122,7 @@ find_peer_by_pid (const struct GNUNET_PeerIdentity *pid)
 {
   struct TestPeer *cur;
   for (cur = peer_head; NULL != cur; cur = cur->next)
-    if (0 == memcmp (&cur->peer_id, pid, sizeof (struct GNUNET_PeerIdentity)))
+    if (0 == GNUNET_memcmp (&cur->peer_id, pid))
       return cur;
   return NULL;
 }
index f2bc1de7ffaa9e84cb104ceed0a5ddb70364a46f..b451c8c677128cc96a5763de24e23a54d3d1d050 100644 (file)
@@ -362,9 +362,8 @@ handle_suggest_cancel (void *cls,
        cp = cp->next)
     if ( (cp->pref.pk == (enum GNUNET_MQ_PreferenceKind) ntohl (msg->pk)) &&
         (cp->pref.bw.value__ == msg->bw.value__) &&
-        (0 == memcmp (&cp->pref.peer,
-                      &msg->peer,
-                      sizeof (struct GNUNET_PeerIdentity))) )
+        (0 == GNUNET_memcmp (&cp->pref.peer,
+                      &msg->peer)) )
       break;
   if (NULL == cp)
   {
index dd5cee96f172173f548f4b7efc8ddd428ed54d05..efe968024e1c059cb2ed93503054ec3e3af4ac96 100644 (file)
@@ -682,9 +682,7 @@ GAS_handle_request_address_list (struct GNUNET_SERVICE_Client *client,
   memset (&allzeros,
           '\0',
           sizeof (struct GNUNET_PeerIdentity));
-  if (0 == memcmp (&alrm->peer,
-                   &allzeros,
-                   sizeof (struct GNUNET_PeerIdentity)))
+  if (0 == GNUNET_is_zero (&alrm->peer))
   {
     /* Return addresses for all peers */
     GAS_addresses_get_peer_info (NULL,
index f68e6ec11a65afa9794778d47bb04be5964e9d6c..4b58bf9b71aed2351c5a735f7e88c6ed84f70c45 100644 (file)
@@ -250,9 +250,8 @@ GAS_normalization_update_property (struct ATS_Address *address)
   GNUNET_CONTAINER_multipeermap_iterate (GSA_addresses,
                                          &find_min_max_it,
                                          &range);
-  if (0 != memcmp (&range,
-                   &property_range,
-                   sizeof (struct PropertyRange)))
+  if (0 != GNUNET_memcmp (&range,
+                   &property_range))
   {
     /* limits changed, (re)normalize all addresses */
     property_range = range;
index 449b50fb70f7577ba1188bc3935b6b2ba26c10fe..35a256f32bb5e8f1bff002a7cf6c46ae1f11cbd4 100644 (file)
@@ -492,9 +492,8 @@ watch_cb (void *cls,
   struct GNUNET_TIME_Absolute expiration;
   struct Hello *hello;
 
-  if (0 != memcmp (&p->pid,
-                   &record->peer,
-                   sizeof (struct GNUNET_PeerIdentity)))
+  if (0 != GNUNET_memcmp (&p->pid,
+                   &record->peer))
   {
     GNUNET_break (0);
     return;
index 8e78807934c9e9a159652f64ac22584b3306beb9..0f3a727a74a482275d050c774650e0ca1d49a79e 100644 (file)
@@ -1401,7 +1401,7 @@ mlp_propagate_results (void *cls,
       mlpi->b_in = mlp_bw_in;
       address->assigned_bw_out = mlp_bw_out;
       mlpi->b_out = mlp_bw_out;
-      if ((NULL == mlp->exclude_peer) || (0 != memcmp (&address->peer, mlp->exclude_peer, sizeof (address->peer))))
+      if ((NULL == mlp->exclude_peer) || (0 != GNUNET_memcmp (&address->peer, mlp->exclude_peer)))
         mlp->env->bandwidth_changed_cb (mlp->env->cls, address);
       return GNUNET_OK;
     }
@@ -1417,7 +1417,7 @@ mlp_propagate_results (void *cls,
           mlpi->b_in = mlp_bw_in;
           address->assigned_bw_out = mlp_bw_out;
           mlpi->b_out = mlp_bw_out;
-          if ((NULL == mlp->exclude_peer) || (0 != memcmp (&address->peer, mlp->exclude_peer, sizeof (address->peer))))
+          if ((NULL == mlp->exclude_peer) || (0 != GNUNET_memcmp (&address->peer, mlp->exclude_peer)))
             mlp->env->bandwidth_changed_cb (mlp->env->cls, address);
           return GNUNET_OK;
       }
index 6e55f3a1c5805aee89ebc570f8f5be40039af2a7..9f78450c292e9acb6eae8d2ea28f0a84050330cc 100644 (file)
@@ -2016,7 +2016,7 @@ ril_get_agent (struct GAS_RIL_Handle *solver, const struct GNUNET_PeerIdentity *
 
   for (cur = solver->agents_head; NULL != cur; cur = cur->next)
   {
-    if (0 == memcmp (peer, &cur->peer, sizeof(struct GNUNET_PeerIdentity)))
+    if (0 == GNUNET_memcmp (peer, &cur->peer))
     {
       return cur;
     }
index 21eca18e9ad2a8952cbc1b2872c48b8b1f82e73f..33597e6787a9b98f8bd051bc21d3446d37bb9090 100644 (file)
@@ -540,9 +540,8 @@ reservation_cb (void *cls,
   cmd->details.reserve_bandwidth.rc = NULL;
   make_peer (cmd->details.reserve_bandwidth.pid,
              &pid);
-  GNUNET_assert (0 == memcmp (peer,
-                              &pid,
-                              sizeof (struct GNUNET_PeerIdentity)));
+  GNUNET_assert (0 == GNUNET_memcmp (peer,
+                              &pid));
   switch (cmd->details.reserve_bandwidth.expected_result)
   {
   case GNUNET_OK:
index 1e898c1ebd72961d97fdec2d0bd339de3eaab424..bd95428be107b32734f8e378b95634ba8b7504d2 100644 (file)
@@ -679,9 +679,8 @@ GCCH_channel_local_new (struct CadetClient *owner,
   GCCH_hash_port (&ch->h_port,
                  port,
                  GCP_get_id (destination));
-  if (0 == memcmp (&my_full_id,
-                   GCP_get_id (destination),
-                   sizeof (struct GNUNET_PeerIdentity)))
+  if (0 == GNUNET_memcmp (&my_full_id,
+                   GCP_get_id (destination)))
   {
     struct OpenPort *op;
 
@@ -1185,9 +1184,8 @@ GCCH_handle_channel_open_ack (struct CadetChannel *ch,
       GNUNET_break_op (0);
       return;
     }
-    if (0 != memcmp (&ch->port,
-                    port,
-                    sizeof (struct GNUNET_HashCode)))
+    if (0 != GNUNET_memcmp (&ch->port,
+                    port))
     {
       /* Other peer failed to provide the right port,
         refuse connection. */
@@ -1612,9 +1610,8 @@ handle_matching_ack (struct CadetChannel *ch,
        (NULL != cti) )
   {
     GCC_ack_observed (cti);
-    if (0 == memcmp (cti,
-                     &crm->connection_taken,
-                     sizeof (struct GNUNET_CADET_ConnectionTunnelIdentifier)))
+    if (0 == GNUNET_memcmp (cti,
+                     &crm->connection_taken))
     {
       GCC_latency_observed (cti,
                             GNUNET_TIME_absolute_get_duration (crm->first_transmission_time));
index 4f1e5be8e1e12aaeb04da4e593adf5eadf290c77..1f7e86d602348ca0b2f87b624f5ab00083bbf9c1 100644 (file)
@@ -919,9 +919,8 @@ GCC_create_inbound (struct CadetPeer *destination,
   {
     int cmp;
 
-    cmp = memcmp (cid,
-                  &cc->cid,
-                  sizeof (*cid));
+    cmp = GNUNET_memcmp (cid,
+                  &cc->cid);
     if (0 == cmp)
     {
       /* Two peers picked the SAME random connection identifier at the
index 275785b5747d268418f1da18bd1ec41c4e6a7cb0..879230d297b22353c6985b109567af25ecf41e65 100644 (file)
@@ -843,9 +843,8 @@ handle_connection_create (void *cls,
   }
   /* Initiator is at offset 0, find us */
   for (off=1;off<path_length;off++)
-    if (0 == memcmp (&my_full_id,
-                     &pids[off],
-                     sizeof (struct GNUNET_PeerIdentity)))
+    if (0 == GNUNET_memcmp (&my_full_id,
+                     &pids[off]))
       break;
   if (off == path_length)
   {
@@ -1310,9 +1309,8 @@ core_init_cb (void *cls,
     return;
   }
   GNUNET_break (0 ==
-                memcmp (my_identity,
-                        &my_full_id,
-                        sizeof (struct GNUNET_PeerIdentity)));
+                GNUNET_memcmp (my_identity,
+                        &my_full_id));
 }
 
 
index 2c06006f4dc960c9cceb7397b85a2f16b994bd86..fe2477c34713c25579746d17327fc85d197017f3 100644 (file)
@@ -72,9 +72,8 @@ got_hello (void *cls,
   if ( (NULL == id) ||
        (NULL == hello) )
     return;
-  if (0 == memcmp (id,
-                   &my_full_id,
-                   sizeof (struct GNUNET_PeerIdentity)))
+  if (0 == GNUNET_memcmp (id,
+                   &my_full_id))
   {
     GNUNET_free_non_null (mine);
     mine = (struct GNUNET_HELLO_Message *) GNUNET_copy_message (&hello->header);
index a061c5685b840c7afa3ea0b998b26d49e345c56e..bdc92668e5d8453bcda7e100ab87b8fff32b651b 100644 (file)
@@ -496,9 +496,8 @@ GCPP_try_path_from_dht (const struct GNUNET_PeerIdentity *get_path,
       ? &get_path[get_path_length - off - 1]
       : &put_path[get_path_length + put_path_length - off - 1];
     /* Check that I am not in the path */
-    if (0 == memcmp (&my_full_id,
-                     pid,
-                     sizeof (struct GNUNET_PeerIdentity)))
+    if (0 == GNUNET_memcmp (&my_full_id,
+                     pid))
     {
       skip = off + 1;
       continue;
index 57a6d1adfe15112157d2585d57abc14abbaf89ec..a2a493ebde00236f9c586c95f2457712f2a316e3 100644 (file)
@@ -1013,9 +1013,8 @@ try_old_ax_keys (struct CadetTunnelAxolotl *ax,
             0,
             &key->HK,
             hmac);
-    if (0 == memcmp (hmac,
-                     &src->hmac,
-                     sizeof (*hmac)))
+    if (0 == GNUNET_memcmp (hmac,
+                     &src->hmac))
     {
       valid_HK = &key->HK;
       break;
@@ -1047,9 +1046,8 @@ try_old_ax_keys (struct CadetTunnelAxolotl *ax,
           (N != key->Kn) )
     key = key->next;
   if ( (NULL == key) ||
-       (0 != memcmp (&key->HK,
-                     valid_HK,
-                     sizeof (*valid_HK))) )
+       (0 != GNUNET_memcmp (&key->HK,
+                     valid_HK)) )
     return -1;
 
   /* Decrypt payload */
@@ -1181,9 +1179,8 @@ t_ax_decrypt_and_validate (struct CadetTunnelAxolotl *ax,
           sizeof (struct GNUNET_CADET_AxHeader) + esize,
           0, &ax->HKr,
           &msg_hmac);
-  if (0 != memcmp (&msg_hmac,
-                   &src->hmac,
-                   sizeof (msg_hmac)))
+  if (0 != GNUNET_memcmp (&msg_hmac,
+                   &src->hmac))
   {
     static const char ctx[] = "axolotl ratchet";
     struct GNUNET_CRYPTO_SymmetricSessionKey keys[3]; /* RKp, NHKp, CKp */
@@ -1197,9 +1194,8 @@ t_ax_decrypt_and_validate (struct CadetTunnelAxolotl *ax,
             0,
             &ax->NHKr,
             &msg_hmac);
-    if (0 != memcmp (&msg_hmac,
-                     &src->hmac,
-                     sizeof (msg_hmac)))
+    if (0 != GNUNET_memcmp (&msg_hmac,
+                     &src->hmac))
     {
       /* Try the skipped keys, if that fails, we're out of luck. */
       return try_old_ax_keys (ax,
@@ -1528,9 +1524,8 @@ update_ax_by_kx (struct CadetTunnelAxolotl *ax,
     GNUNET_break_op (0);
     return GNUNET_SYSERR;
   }
-  if (0 == memcmp (&ax->DHRr,
-                   ratchet_key,
-                   sizeof (*ratchet_key)))
+  if (0 == GNUNET_memcmp (&ax->DHRr,
+                     ratchet_key))
   {
     GNUNET_STATISTICS_update (stats,
                               "# Ratchet key already known",
@@ -1872,9 +1867,8 @@ check_ee (const struct GNUNET_CRYPTO_EcdhePrivateKey *e1,
                  GNUNET_CRYPTO_ecc_ecdh (e2,
                                          &p1,
                                          &hc2));
-  GNUNET_break (0 == memcmp (&hc1,
-                             &hc2,
-                             sizeof (hc1)));
+  GNUNET_break (0 == GNUNET_memcmp (&hc1,
+                             &hc2));
 }
 
 
@@ -1899,9 +1893,8 @@ check_ed (const struct GNUNET_CRYPTO_EcdhePrivateKey *e1,
                  GNUNET_CRYPTO_eddsa_ecdh (e2,
                                            &p1,
                                            &hc2));
-  GNUNET_break (0 == memcmp (&hc1,
-                             &hc2,
-                             sizeof (hc1)));
+  GNUNET_break (0 == GNUNET_memcmp (&hc1,
+                             &hc2));
 }
 
 
@@ -1974,9 +1967,8 @@ GCT_handle_kx_auth (struct CadetTConnection *ct,
   GNUNET_CRYPTO_hash (&ax_tmp.RK,
                       sizeof (ax_tmp.RK),
                       &kx_auth);
-  if (0 != memcmp (&kx_auth,
-                   &msg->auth,
-                   sizeof (kx_auth)))
+  if (0 != GNUNET_memcmp (&kx_auth,
+                   &msg->auth))
   {
     /* This KX_AUTH is not using the latest KX/KX_AUTH data
        we transmitted to the sender, refuse it, try KX again. */
@@ -1992,9 +1984,8 @@ GCT_handle_kx_auth (struct CadetTConnection *ct,
 
       GNUNET_CRYPTO_ecdhe_key_get_public (&ax_tmp.kx_0,
                                           &ephemeral_key);
-      if (0 != memcmp (&ephemeral_key,
-                       &msg->r_ephemeral_key_XXX,
-                       sizeof (ephemeral_key)))
+      if (0 != GNUNET_memcmp (&ephemeral_key,
+                       &msg->r_ephemeral_key_XXX))
       {
         LOG (GNUNET_ERROR_TYPE_WARNING,
            "My ephemeral is %s!\n",
index 04e71afd98b099de2644df6752e7bff43fc9cc23..912d3de6a86cbdc2ea47fb75817fcdb217f33671 100644 (file)
@@ -2406,7 +2406,7 @@ get_peer_idx (const struct GNUNET_PeerIdentity *peer, const struct ConsensusSess
 {
   int i;
   for (i = 0; i < session->num_peers; i++)
-    if (0 == memcmp (peer, &session->peers[i], sizeof (struct GNUNET_PeerIdentity)))
+    if (0 == GNUNET_memcmp (peer, &session->peers[i]))
       return i;
   return -1;
 }
@@ -2476,9 +2476,8 @@ initialize_session_peer_list (struct ConsensusSession *session,
   local_peer_in_list = GNUNET_NO;
   for (unsigned int i = 0; i < session->num_peers; i++)
   {
-    if (0 == memcmp (&msg_peers[i],
-                     &my_peer,
-                     sizeof (struct GNUNET_PeerIdentity)))
+    if (0 == GNUNET_memcmp (&msg_peers[i],
+                     &my_peer))
     {
       local_peer_in_list = GNUNET_YES;
       break;
index b0475d0f233d7bb3edbf52e439d032216077562d..75711265d76986b88566c4056e7a993d7a165f4f 100644 (file)
@@ -640,9 +640,8 @@ backward_resolution (void *cls,
       for (cred_pointer = vrh->cred_chain_head; cred_pointer != NULL;
            cred_pointer = cred_pointer->next) {
         if (0
-            != memcmp (&set->subject_key,
-                       &cred_pointer->credential->issuer_key,
-                       sizeof (struct GNUNET_CRYPTO_EcdsaPublicKey)))
+            != GNUNET_memcmp (&set->subject_key,
+                       &cred_pointer->credential->issuer_key))
           continue;
         GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
                     "Checking if %s matches %s\n",
@@ -755,9 +754,8 @@ delegation_chain_resolution_start (void *cls)
   for (cr_entry = vrh->cred_chain_head; cr_entry != NULL;
        cr_entry = cr_entry->next) {
     if (0
-        != memcmp (&cr_entry->credential->issuer_key,
-                   &vrh->issuer_key,
-                   sizeof (struct GNUNET_CRYPTO_EcdsaPublicKey)))
+        != GNUNET_memcmp (&cr_entry->credential->issuer_key,
+                   &vrh->issuer_key))
       continue;
     if (0
         != strcmp (cr_entry->credential->issuer_attribute,
index 02900429d7d0e834be26a65350a2c257ca9508cc..68371d38916d9ff0a1fa6b01d60dd1f22a3fba87 100644 (file)
@@ -862,9 +862,8 @@ mysql_plugin_get_keys (void *cls,
   {
     ret = GNUNET_MY_extract_result (plugin->get_all_keys,
                                     results_select);
-    if (0 != memcmp (&last,
-                     &key,
-                     sizeof (key)))
+    if (0 != GNUNET_memcmp (&last,
+                     &key))
     {
       if (0 != cnt)
         proc (proc_cls,
index 3c5b52539ad25f55fdc269b7c8c783e1fae420a1..4f040558afe870b3c96db5d9dd307dfce06ed0ba 100644 (file)
@@ -727,9 +727,8 @@ handle_core_connect (void *cls,
 
  (void) cls;
  /* Check for connect to self message */
-  if (0 == memcmp (&my_identity,
-                  peer,
-                  sizeof (struct GNUNET_PeerIdentity)))
+  if (0 == GNUNET_memcmp (&my_identity,
+                  peer))
     return NULL;
   GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
              "Connected to %s\n",
@@ -959,9 +958,8 @@ GDS_am_closest_peer (const struct GNUNET_HashCode *key,
   int bucket_num;
   struct PeerInfo *pos;
 
-  if (0 == memcmp (&my_identity_hash,
-                  key,
-                  sizeof (struct GNUNET_HashCode)))
+  if (0 == GNUNET_memcmp (&my_identity_hash,
+                  key))
     return GNUNET_YES;
   bucket_num = find_bucket (key);
   GNUNET_assert (bucket_num >= 0);
index ab4e859b5714365f83ab451c679bcf6f5136dac6..1cee45a22f5758038f3aff8c9ada1ded58e43811 100644 (file)
@@ -368,9 +368,8 @@ try_combine_recent (void *cls,
   struct RecentRequest *in = cls;
   struct RecentRequest *rr = value;
 
-  if ( (0 != memcmp (&in->peer,
-                    &rr->peer,
-                    sizeof (struct GNUNET_PeerIdentity))) ||
+  if ( (0 != GNUNET_memcmp (&in->peer,
+                    &rr->peer)) ||
        (in->type != rr->type) ||
        (in->xquery_size != rr->xquery_size) ||
        (0 != memcmp (in->xquery,
index 3dedae830a20db4e852afc21fb8d41337fb2b0d2..5bcf53f5763528617682e2a138179c5594887b16 100644 (file)
@@ -1227,12 +1227,10 @@ setup_fresh_address (int af,
              = (addr.s6_addr[i] | rnd.s6_addr[i]) & mask.s6_addr[i];
          }
        }
-      while ( (0 == memcmp (&local_address->address.ipv6,
-                           &addr,
-                           sizeof (struct in6_addr))) ||
-             (0 == memcmp (&local_address->address.ipv6,
-                           &mask,
-                           sizeof (struct in6_addr))) );
+      while ( (0 == GNUNET_memcmp (&local_address->address.ipv6,
+                           &addr)) ||
+             (0 == GNUNET_memcmp (&local_address->address.ipv6,
+                           &mask)) );
     }
     break;
   default:
index 1f27cb04e2066d4de61d66111f6446589ffa2e24..86d45b9fe92e052ff1e5ca11b6fcd0d5d74fa6e3 100644 (file)
@@ -153,7 +153,7 @@ block_plugin_gns_evaluate (void *cls,
   GNUNET_CRYPTO_hash (&block->derived_key,
                      sizeof (block->derived_key),
                      &h);
-  if (0 != memcmp (&h, query, sizeof (struct GNUNET_HashCode)))
+  if (0 != GNUNET_memcmp (&h, query))
     {
       GNUNET_break_op (0);
       return GNUNET_BLOCK_EVALUATION_RESULT_INVALID;
index 218d7312784a77c3de2a78bdb1cd04bb965f8845..f803f437053172c820c5f385c09ba83cecb1ba8e 100644 (file)
@@ -838,9 +838,8 @@ GNUNET_HELLO_equals (const struct GNUNET_HELLO_Message *h1,
   if (h1->header.type != h2->header.type)
     return GNUNET_TIME_UNIT_ZERO_ABS;
   if (0 !=
-      memcmp (&h1->publicKey,
-              &h2->publicKey,
-              sizeof (struct GNUNET_CRYPTO_EddsaPublicKey)))
+      GNUNET_memcmp (&h1->publicKey,
+              &h2->publicKey))
     return GNUNET_TIME_UNIT_ZERO_ABS;
   ec.expiration_limit = now;
   ec.result = GNUNET_TIME_UNIT_FOREVER_ABS;
index 4d8988c5001189345c3f4195a00bc87d57122909..1f9c398fa97e8c3c88a33b92d1817baeb0b3d634 100644 (file)
@@ -179,9 +179,8 @@ main (int argc,
   GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
           "Testing get_key from HELLO...\n");
   GNUNET_assert (GNUNET_OK == GNUNET_HELLO_get_id (msg2, &pid));
-  GNUNET_assert (0 == memcmp (&publicKey,
-                              &pid.public_key,
-                              sizeof (struct GNUNET_CRYPTO_EddsaPublicKey)));
+  GNUNET_assert (0 == GNUNET_memcmp (&publicKey,
+                              &pid.public_key));
   GNUNET_free (msg1);
 
   GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
index 478776128da3a0d85964c7aeac89ddf9789e771e..760d5f543c60c9532ed6368681aa06f6532f24fe 100644 (file)
@@ -201,9 +201,8 @@ connect_handler (void *cls,
                 const struct GNUNET_PeerIdentity *peer,
                 struct GNUNET_MQ_Handle *mq)
 {
-  if (0 == memcmp (&me,
-                  peer,
-                  sizeof (struct GNUNET_PeerIdentity)))
+  if (0 == GNUNET_memcmp (&me,
+                  peer))
     return NULL;
   GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
               "A new peer connected, notifying client and server\n");
@@ -235,9 +234,8 @@ disconnect_handler (void *cls,
                     const struct GNUNET_PeerIdentity *peer,
                    void *internal_cls)
 {
-  if (0 == memcmp (&me,
-                  peer,
-                  sizeof (struct GNUNET_PeerIdentity)))
+  if (0 == GNUNET_memcmp (&me,
+                  peer))
     return;
   /* call hostlist client disconnect handler */
   if (NULL != client_dh)
index 3e53d1ceb83e138e2822743e1c06c82fa78c1286..0a2fbbcb89b76d9d79896a977af785f9cf391299 100644 (file)
@@ -429,7 +429,7 @@ static int
 key_cmp (const struct GNUNET_CRYPTO_EcdsaPrivateKey *pk1,
          const struct GNUNET_CRYPTO_EcdsaPrivateKey *pk2)
 {
-  return memcmp (pk1, pk2, sizeof (struct GNUNET_CRYPTO_EcdsaPrivateKey));
+  return GNUNET_memcmp (pk1, pk2);
 }
 
 /**
index 45be0fe750b859912344c69cc430339a2ef2bae7..d2a09087e651173af23dec9e916c48e6f37c482a 100644 (file)
@@ -553,9 +553,8 @@ cache_nick (const struct GNUNET_CRYPTO_EcdsaPrivateKey *zone,
         (oldest->last_used.abs_value_us >
          pos->last_used.abs_value_us) )
       oldest = pos;
-    if (0 == memcmp (zone,
-                    &pos->zone,
-                    sizeof (*zone)))
+    if (0 == GNUNET_memcmp (zone,
+                    &pos->zone))
     {
       oldest = pos;
       break;
@@ -592,9 +591,8 @@ get_nick_record (const struct GNUNET_CRYPTO_EcdsaPrivateKey *zone)
   {
     struct NickCache *pos = &nick_cache[i];
     if ( (NULL != pos->rd) &&
-        (0 == memcmp (zone,
-                      &pos->zone,
-                      sizeof (*zone))) )
+        (0 == GNUNET_memcmp (zone,
+                      &pos->zone)) )
     {
       nick = GNUNET_malloc (sizeof (*nick) +
                            pos->rd->data_size);
@@ -1082,12 +1080,10 @@ continue_store_activity (struct StoreActivity *sa)
          NULL != zm;
          zm = sa->zm_pos)
     {
-      if ( (0 != memcmp (&rp_msg->private_key,
-                         &zm->zone,
-                         sizeof (struct GNUNET_CRYPTO_EcdsaPrivateKey))) &&
-           (0 != memcmp (&zm->zone,
-                         &zero,
-                         sizeof (struct GNUNET_CRYPTO_EcdsaPrivateKey))) )
+      if ( (0 != GNUNET_memcmp (&rp_msg->private_key,
+                         &zm->zone)) &&
+           (0 != GNUNET_memcmp (&zm->zone,
+                         &zero)) )
        {
          sa->zm_pos = zm->next; /* not interesting to this monitor */
          continue;
@@ -1921,9 +1917,7 @@ run_zone_iteration_round (struct ZoneIteration *zi,
   start = GNUNET_TIME_absolute_get ();
   GNUNET_break (GNUNET_SYSERR !=
                 GSN_database->iterate_records (GSN_database->cls,
-                                               (0 == memcmp (&zi->zone,
-                                                             &zero,
-                                                             sizeof (zero)))
+                                               (0 == GNUNET_is_zero (&zi->zone))
                                                ? NULL
                                                : &zi->zone,
                                                zi->seq,
@@ -2220,9 +2214,7 @@ monitor_iteration_next (void *cls)
   else
     zm->iteration_cnt = zm->limit; /* use it all */
   ret = GSN_database->iterate_records (GSN_database->cls,
-                                       (0 == memcmp (&zm->zone,
-                                                     &zero,
-                                                     sizeof (zero)))
+                                       (0 == GNUNET_is_zero (&zm->zone))
                                        ? NULL
                                        : &zm->zone,
                                        zm->seq,
index e7d040ec4a0e55f8da4e434bdbddfcdf1908fa78..f36106332bbdc33ba8d0f8d3740504fd71577a7f 100644 (file)
@@ -1583,9 +1583,8 @@ ns_lookup_result_cb (void *cls,
                  GNUNET_CONTAINER_multihashmap_remove (ns_pending,
                                                        &hc,
                                                        req));
-  GNUNET_break (0 == memcmp (key,
-                            &req->zone->key,
-                            sizeof (*key)));
+  GNUNET_break (0 == GNUNET_memcmp (key,
+                            &req->zone->key));
   GNUNET_break (0 == strcasecmp (label,
                                 get_label (req)));
   for (unsigned int i=0;i<rd_count;i++)
index 89eb0afa4d38284422066c85ae1f977893829601..99fd17473d44447ad84ea1bf10603797a17dc018 100644 (file)
@@ -552,9 +552,8 @@ check_record_result (void *cls,
     GNUNET_break (0);
     return GNUNET_SYSERR;
   }
-  if (0 == memcmp (&msg->private_key,
-                   &priv_dummy,
-                   sizeof (priv_dummy)) )
+  if (0 == GNUNET_memcmp (&msg->private_key,
+                   &priv_dummy) )
   {
     GNUNET_break (0);
     return GNUNET_SYSERR;
index 67715f634d43692e446adeba6b1691829df13d69..99e3864c9317a277e351fcd27decbefbabe6dc0b 100644 (file)
@@ -142,12 +142,9 @@ check_result (void *cls,
   const char *rd_ser_tmp;
 
   (void) cls;
-  if ( (0 != memcmp (&lrm->private_key,
-                    &zm->zone,
-                    sizeof (struct GNUNET_CRYPTO_EcdsaPrivateKey))) &&
-       (0 != memcmp (&zero,
-                    &zm->zone,
-                    sizeof (struct GNUNET_CRYPTO_EcdsaPrivateKey))) )
+  if ( (0 != GNUNET_memcmp (&lrm->private_key,
+                    &zm->zone)) &&
+       (0 != GNUNET_is_zero (&zm->zone)) )
   {
     GNUNET_break (0);
     return GNUNET_SYSERR;
index 5da958aad375062508dc2f110bf31b1d376fd5fd..156f9227ca22e7715035ee4aa434d29a8995a348 100644 (file)
@@ -241,9 +241,8 @@ zone_proc (void *cls,
     return;
   }
   GNUNET_free (wrd);
-  if (0 != memcmp (zone,
-                   privkey,
-                   sizeof (struct GNUNET_CRYPTO_EcdsaPrivateKey)))
+  if (0 != GNUNET_memcmp (zone,
+                   privkey))
   {
     res = 5;
     GNUNET_break (0);
index 01cf592ea8cb1a019bada333cb92f1dc763eb3e7..8fe03764d6490a76de0f0ef8194cf06245b569ad 100644 (file)
@@ -592,9 +592,8 @@ iterate_zones (void *cls,
   if (0 == ic->limit)
     return GNUNET_NO;
   if ( (NULL != ic->zone) &&
-       (0 != memcmp (&entry->private_key,
-                     ic->zone,
-                     sizeof (struct GNUNET_CRYPTO_EcdsaPrivateKey))) )
+       (0 != GNUNET_memcmp (&entry->private_key,
+                     ic->zone)) )
     return GNUNET_YES;
   ic->pos++;
   if (ic->offset > 0)
@@ -676,9 +675,8 @@ zone_to_name (void *cls,
   struct FlatFileEntry *entry = value;
 
   (void) key;
-  if (0 != memcmp (&entry->private_key,
-                   ztn->zone,
-                   sizeof (struct GNUNET_CRYPTO_EcdsaPrivateKey)))
+  if (0 != GNUNET_memcmp (&entry->private_key,
+                   ztn->zone))
     return GNUNET_YES;
 
   for (unsigned int i = 0; i < entry->record_count; i++)
index 1257701e91e98a1bfcd6dee52657ff4714bca30a..392a2521db29372e28738b17a6594fae32af44a1 100644 (file)
@@ -111,7 +111,7 @@ lookup_it (void *cls,
   int found_record = GNUNET_NO;
   int found_nick = GNUNET_NO;
 
-  if (0 != memcmp(privkey, zone, sizeof (struct GNUNET_CRYPTO_EcdsaPrivateKey)))
+  if (0 != GNUNET_memcmp(privkey, zone))
   {
     GNUNET_break(0);
     GNUNET_SCHEDULER_cancel (endbadly_task);
index 2615f52c8b20b994550cb49d43bbb4f69c697fe4..cf9bfc20c46d6feb0588af4d4c8c93ec2278354b 100644 (file)
@@ -103,9 +103,8 @@ lookup_it (void *cls,
 {
   nsqe = NULL;
 
-  if (0 != memcmp (privkey,
-                   zone,
-                   sizeof (struct GNUNET_CRYPTO_EcdsaPrivateKey)))
+  if (0 != GNUNET_memcmp (privkey,
+                   zone))
   {
     GNUNET_break(0);
     GNUNET_SCHEDULER_cancel (endbadly_task);
index c85ec8457467aab2a3d473beda25f82a689a969b..8fbeb6479e09b2b1cb57180c9216ca4d30c165e5 100644 (file)
@@ -156,9 +156,8 @@ zone_proc (void *cls,
   GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
              "Comparing results name %s\n",
              name);
-  if (0 != memcmp (zone_key,
-                   privkey,
-                   sizeof (struct GNUNET_CRYPTO_EcdsaPrivateKey)))
+  if (0 != GNUNET_memcmp (zone_key,
+                   privkey))
   {
     GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
              "Monitoring returned wrong zone key\n");
index 64bfb6949cb62674c5c6174fb605899ad999bd6f..e54046c85bed1e033f22905bdacabc9c2a262e78 100644 (file)
@@ -150,9 +150,8 @@ zone_proc (void *cls,
   GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
              "Comparing results name %s\n",
              name);
-  if (0 != memcmp (zone_key,
-                   privkey,
-                   sizeof (struct GNUNET_CRYPTO_EcdsaPrivateKey)))
+  if (0 != GNUNET_memcmp (zone_key,
+                   privkey))
   {
     GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
                "Monitoring returned wrong zone key\n");
index fa641954be0f4ea2855df4c75bf28dca8bf7c7ff..94331f89e5c552933074a3294ea11490a42824cd 100644 (file)
@@ -160,9 +160,8 @@ zone_proc (void *cls,
   int failed = GNUNET_NO;
 
   GNUNET_assert (NULL != zone);
-  if (0 == memcmp (zone,
-                   privkey,
-                   sizeof (struct GNUNET_CRYPTO_EcdsaPrivateKey)))
+  if (0 == GNUNET_memcmp (zone,
+                   privkey))
   {
     if (0 == strcmp (label, s_name_1))
     {
@@ -207,9 +206,8 @@ zone_proc (void *cls,
       GNUNET_break (0);
     }
   }
-  else if (0 == memcmp (zone,
-                        privkey2,
-                        sizeof (struct GNUNET_CRYPTO_EcdsaPrivateKey)))
+  else if (0 == GNUNET_memcmp (zone,
+                        privkey2))
   {
     if (0 == strcmp (label, s_name_3))
     {
index 9df6c98cca899389cf7893982926fd19f05b82b6..069c6d831cf0a552eb5b1a183eb5d65c65054dab 100644 (file)
@@ -171,13 +171,13 @@ zone_proc (void *cls,
   int failed = GNUNET_NO;
 
   GNUNET_assert (NULL != zone);
-  if (0 == memcmp (zone, privkey, sizeof (struct GNUNET_CRYPTO_EcdsaPrivateKey)))
+  if (0 == GNUNET_memcmp (zone, privkey))
   {
     failed = check_zone_1 (label, rd_count, rd);
     if (GNUNET_YES == failed)
       GNUNET_break (0);
   }
-  else if (0 == memcmp (zone, privkey2, sizeof (struct GNUNET_CRYPTO_EcdsaPrivateKey)))
+  else if (0 == GNUNET_memcmp (zone, privkey2))
   {
     failed = check_zone_2 (label, rd_count, rd);
     if (GNUNET_YES == failed)
index cbcd94cd52922de684370143b9ed1a73bfca3212..e3c6d698a951c15b68f32f7b20d3e528c5372f75 100644 (file)
@@ -142,9 +142,8 @@ zone_proc (void *cls,
   int failed = GNUNET_NO;
 
   GNUNET_assert (NULL != zone);
-  if (0 == memcmp (zone,
-                   privkey,
-                   sizeof (struct GNUNET_CRYPTO_EcdsaPrivateKey)))
+  if (0 == GNUNET_memcmp (zone,
+                   privkey))
   {
     if (0 == strcmp (label, s_name_1))
     {
@@ -189,7 +188,7 @@ zone_proc (void *cls,
       GNUNET_break (0);
     }
   }
-  else if (0 == memcmp (zone, privkey2, sizeof (struct GNUNET_CRYPTO_EcdsaPrivateKey)))
+  else if (0 == GNUNET_memcmp (zone, privkey2))
   {
     GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
                 "Received data for not requested zone\n");
index 38da3136cb0bd18e10728dc757d105cda2965acb..28f424b23c67b9834b0b746391e29a80a6f4110c 100644 (file)
@@ -130,7 +130,7 @@ zone_proc (void *cls,
   int failed = GNUNET_NO;
 
   GNUNET_assert (NULL != zone);
-  if (0 == memcmp (zone, privkey, sizeof (struct GNUNET_CRYPTO_EcdsaPrivateKey)))
+  if (0 == GNUNET_memcmp (zone, privkey))
   {
     if (0 == strcmp (label, s_name_1))
     {
@@ -174,7 +174,7 @@ zone_proc (void *cls,
       GNUNET_break (0);
     }
   }
-  else if (0 == memcmp (zone, privkey2, sizeof (struct GNUNET_CRYPTO_EcdsaPrivateKey)))
+  else if (0 == GNUNET_memcmp (zone, privkey2))
   {
     if (0 == strcmp (label, s_name_3))
     {
index 5d6444145ae1657a232be88da4bf6ff49d9cfb13..cb580572e5d8b606ac9cf52716b759b96c55111d 100644 (file)
@@ -132,9 +132,8 @@ zone_to_name_proc (void *cls,
       GNUNET_break (0);
     }
     if ( (NULL == zone_key) ||
-        (0 != memcmp (zone_key,
-                      privkey,
-                      sizeof (struct GNUNET_CRYPTO_EcdsaPrivateKey))))
+        (0 != GNUNET_memcmp (zone_key,
+                      privkey)))
     {
       fail = GNUNET_YES;
       GNUNET_break (0);
index 9c978749fe1174404e1953527244107b3438cc59..b81900931ce501da9da0794a3faf974654fdf5f8 100644 (file)
@@ -120,9 +120,8 @@ test_record (void *cls,
          (id % 241),
          sizeof (tzone_private_key));
   GNUNET_assert (0 == strcmp (label, tname));
-  GNUNET_assert (0 == memcmp (&tzone_private_key,
-                              private_key,
-                              sizeof (struct GNUNET_CRYPTO_EcdsaPrivateKey)));
+  GNUNET_assert (0 == GNUNET_memcmp (&tzone_private_key,
+                              private_key));
 }
 
 
index df2975e52083711ada79bf094420755b117fcd6f..00bdeb693b4a48aa3a7e90f74510ff751cdde55e 100644 (file)
@@ -563,8 +563,7 @@ process_if (void *cls,
 
 
   if ( (sizeof (struct sockaddr_in6) == addrlen) &&
-       (0 != memcmp (&in6addr_loopback, &((const struct sockaddr_in6 *) addr)->sin6_addr,
-                    sizeof (struct in6_addr))) &&
+       (0 != GNUNET_memcmp (&in6addr_loopback, &((const struct sockaddr_in6 *) addr)->sin6_addr)) &&
        (! IN6_IS_ADDR_LINKLOCAL(&((const struct sockaddr_in6 *) addr)->sin6_addr)) )
   {
     ah->have_v6 = GNUNET_YES;
index 8e7ce51e9bf60c79784b07ca746b019e5ce8a60f..8d771f474d8706748363ea522b3ab092c5857cd9 100644 (file)
@@ -485,9 +485,8 @@ match_ipv6 (const char *network,
                                 network,
                                 &net));
   memset (&mask, 0, sizeof (mask));
-  if (0 == memcmp (&mask,
-                  ip,
-                  sizeof (mask)))
+  if (0 == GNUNET_memcmp (&mask,
+                  ip))
     return GNUNET_YES;
   off = 0;
   while (bits > 8)
@@ -731,9 +730,8 @@ check_notify_client (struct LocalAddressList *delta,
            (! is_nat_v4 (&v4.sin_addr)) )
        continue; /* based on external-IP, but this IP is not
                     from private address range. */
-      if ( (0 != memcmp (&v4.sin_addr,
-                         &c4->sin_addr,
-                         sizeof (struct in_addr))) &&
+      if ( (0 != GNUNET_memcmp (&v4.sin_addr,
+                         &c4->sin_addr)) &&
            (0 != c4->sin_addr.s_addr) &&
            (! is_nat_v4 (&c4->sin_addr)) )
        continue; /* this IP is not from private address range,
@@ -762,37 +760,31 @@ check_notify_client (struct LocalAddressList *delta,
        continue; /* IPv4 not relevant */
       c6 = (const struct sockaddr_in6 *) &ch->caddrs[i].ss;
       if ( match_ipv6 ("::1", &c6->sin6_addr, 128) &&
-          (0 != memcmp (&c6->sin6_addr,
-                        &in6addr_any,
-                        sizeof (struct in6_addr))) &&
+          (0 != GNUNET_memcmp (&c6->sin6_addr,
+                        &in6addr_any)) &&
           (! match_ipv6 ("::1", &v6.sin6_addr, 128)) )
        continue; /* bound to loopback, but this is not loopback */
       if ( (! match_ipv6 ("::1", &c6->sin6_addr, 128) ) &&
           match_ipv6 ("::1", &v6.sin6_addr, 128) )
        continue; /* bound to non-loopback, but this is loopback */
       if ( (0 != (delta->ac & GNUNET_NAT_AC_EXTERN)) &&
-           (0 != memcmp (&c6->sin6_addr,
-                        &in6addr_any,
-                        sizeof (struct in6_addr))) &&
+           (0 != GNUNET_memcmp (&c6->sin6_addr,
+                        &in6addr_any)) &&
           (! is_nat_v6 (&v6.sin6_addr)) )
        continue; /* based on external-IP, but this IP is not
                     from private address range. */
-      if ( (0 != memcmp (&v6.sin6_addr,
-                        &c6->sin6_addr,
-                        sizeof (struct in6_addr))) &&
-          (0 != memcmp (&c6->sin6_addr,
-                        &in6addr_any,
-                        sizeof (struct in6_addr))) &&
+      if ( (0 != GNUNET_memcmp (&v6.sin6_addr,
+                        &c6->sin6_addr)) &&
+          (0 != GNUNET_memcmp (&c6->sin6_addr,
+                        &in6addr_any)) &&
           (! is_nat_v6 (&c6->sin6_addr)) )
        continue; /* this IP is not from private address range,
                     and IP does not match. */
       if ( (match_ipv6 ("fe80::", &c6->sin6_addr, 10)) &&
-          (0 != memcmp (&c6->sin6_addr,
-                        &in6addr_any,
-                        sizeof (struct in6_addr))) &&
-          (0 != memcmp (&v6.sin6_addr,
-                        &c6->sin6_addr,
-                        sizeof (struct in6_addr))) &&
+          (0 != GNUNET_memcmp (&c6->sin6_addr,
+                        &in6addr_any)) &&
+          (0 != GNUNET_memcmp (&v6.sin6_addr,
+                        &c6->sin6_addr)) &&
           (0 == (delta->ac & GNUNET_NAT_AC_EXTERN)) )
        continue; /* client bound to link-local, and the other address
                     does not match and is not an external IP */
@@ -1726,9 +1718,8 @@ handle_stun (void *cls,
                         &se->stun_server_addr,
                         sa_len)) )
        continue; /* different STUN server */
-      if (0 != memcmp (&external_addr,
-                      &se->external_addr,
-                      sizeof (struct sockaddr_in)))
+      if (0 != GNUNET_memcmp (&external_addr,
+                      &se->external_addr))
       {
        /* external IP changed, update! */
        notify_clients_stun_change (&se->external_addr,
index b1f70214c1b574d2e9e2b6fe5af286e57329864d..5b12c4b98a97f7b1ab2fc27629e1a6fb16f61bd2 100644 (file)
@@ -1124,14 +1124,13 @@ handle_p2p_estimate (void *cls,
                               1, GNUNET_NO);
     return;
   }
-  if (0 == (memcmp (peer_entry->id,
-                   &my_identity,
-                   sizeof (struct GNUNET_PeerIdentity))))
+  if (0 == (GNUNET_memcmp (peer_entry->id,
+                   &my_identity)))
   {
     /* send to self, update our own estimate IF this also comes from us! */
     if (0 ==
-        memcmp (&incoming_flood->origin,
-               &my_identity, sizeof (my_identity)))
+        GNUNET_memcmp (&incoming_flood->origin,
+               &my_identity))
       update_network_size_estimate ();
     return;
   }
@@ -1405,9 +1404,8 @@ core_init (void *cls,
     return;
   }
   GNUNET_assert (0 ==
-                 memcmp (&my_identity,
-                        identity,
-                         sizeof (struct GNUNET_PeerIdentity)));
+                 GNUNET_memcmp (&my_identity,
+                        identity));
   now = GNUNET_TIME_absolute_get ();
   current_timestamp.abs_value_us =
       (now.abs_value_us / gnunet_nse_interval.rel_value_us) *
index 75e99d1f8712096915587dbbeac23da65a74d57d..61fdd0f2403e0bdb5c23757260e7b56a14dfa0f0 100644 (file)
@@ -584,9 +584,8 @@ hosts_directory_scan_callback (void *cls,
 
   if (  (NULL != r.hello) &&
         (NULL != r.friend_only_hello) &&
-        (0 != memcmp (&id_friend,
-                      &id_public,
-                      sizeof (id_friend))) )
+        (0 != GNUNET_memcmp (&id_friend,
+                      &id_public)) )
   {
     /* HELLOs are not for the same peer */
     GNUNET_break (0);
@@ -599,7 +598,7 @@ hosts_directory_scan_callback (void *cls,
                                                   strlen (filename),
                                                   &identity.public_key))
   {
-    if (0 != memcmp (&id, &identity, sizeof (id_friend)))
+    if (0 != GNUNET_memcmp (&id, &identity))
     {
       /* HELLOs are not for the same peer */
       GNUNET_break (0);
index 4b56b34c79d4777f3c3814e377277a54f47650aa..485b5e18354a1ea90d50d156138c406862cdc02c 100644 (file)
@@ -271,9 +271,8 @@ check_info (void *cls,
     return GNUNET_SYSERR;
   }
   if ( (GNUNET_YES == ic->have_peer) &&
-       (0 != memcmp (&ic->peer,
-                     &im->peer,
-                     sizeof (struct GNUNET_PeerIdentity))) )
+       (0 != GNUNET_memcmp (&ic->peer,
+                     &im->peer)) )
   {
     /* bogus message (from a different iteration call?); out of sequence! */
     LOG (GNUNET_ERROR_TYPE_ERROR,
@@ -303,9 +302,8 @@ check_info (void *cls,
       GNUNET_break (0);
       return GNUNET_SYSERR;
     }
-    if (0 != memcmp (&im->peer,
-                     &id,
-                     sizeof (struct GNUNET_PeerIdentity)))
+    if (0 != GNUNET_memcmp (&im->peer,
+                     &id))
     {
       /* malformed message */
       GNUNET_break (0);
index 50118f8bbc5bd80ef3aa982fbb59c87a2257651a..0a9bfc0837b74c32ddea0a4efed6bfbf84c464e6 100644 (file)
@@ -160,7 +160,7 @@ process_w_fo (void *cls,
     GNUNET_log(GNUNET_ERROR_TYPE_INFO, "Received %s HELLO for peer `%s'\n",
         (GNUNET_YES == GNUNET_HELLO_is_friend_only (hello)) ? "friend only" : "public",
         GNUNET_i2s (peer));
-    if (0 == memcmp (&pid, peer, sizeof(pid)))
+    if (0 == GNUNET_memcmp (&pid, peer))
     {
       res_cb_w_fo = GNUNET_YES;
       GNUNET_SCHEDULER_add_now (&done, NULL);
@@ -199,7 +199,7 @@ process_wo_fo (void *cls, const struct GNUNET_PeerIdentity *peer,
     GNUNET_log(GNUNET_ERROR_TYPE_INFO, "Received %s HELLO for peer `%s'\n",
         (GNUNET_YES == GNUNET_HELLO_is_friend_only (hello)) ? "friend only" : "public",
         GNUNET_i2s (peer));
-    if (0 == memcmp (&pid, peer, sizeof(pid)))
+    if (0 == GNUNET_memcmp (&pid, peer))
     {
       GNUNET_break(0);
       res_cb_wo_fo = GNUNET_YES;
index cfcf7dcd7570bc2c31dac0edfd02a3115e575d12..67cf32733429a0bf9dbc496a3486b2facf41e4e8 100644 (file)
@@ -191,9 +191,8 @@ run_queries (PGconn *conn)
     GNUNET_break (abs_time.abs_value_us == abs_time2.abs_value_us);
     GNUNET_break (forever.abs_value_us == forever2.abs_value_us);
     GNUNET_break (0 ==
-                 memcmp (&hc,
-                         &hc2,
-                         sizeof (struct GNUNET_HashCode)));
+                 GNUNET_memcmp (&hc,
+                         &hc2));
     GNUNET_break (0 ==
                  GNUNET_CRYPTO_rsa_signature_cmp (sig,
                                                   sig2));
index 6a07b6e423763294bd36e671254cc12c713d04b3..cd17c2b7bc34dde2ce468ad6b81747fa4583d25a 100644 (file)
@@ -1151,9 +1151,8 @@ handle_dht_result (void *cls,
   }
   ad = data;
   for (exit = exit_head; NULL != exit; exit = exit->next)
-    if (0 == memcmp (&ad->peer,
-                    &exit->peer,
-                    sizeof (struct GNUNET_PeerIdentity)))
+    if (0 == GNUNET_memcmp (&ad->peer,
+                    &exit->peer))
       break;
   if (NULL == exit)
   {
index 750b276a4c33058c24dd4ba045496f8bf344a6c4..331bd27116235eb108bec8473d466c8b240d833f 100644 (file)
@@ -314,8 +314,7 @@ OIDC_parse_authz_code (const struct GNUNET_CRYPTO_EcdsaPublicKey *audience,
   }
   *ticket = GNUNET_new (struct GNUNET_RECLAIM_Ticket);
   memcpy (*ticket, &purpose[1], sizeof (struct GNUNET_RECLAIM_Ticket));
-  if (0 != memcmp (audience, &(*ticket)->audience,
-                   sizeof (struct GNUNET_CRYPTO_EcdsaPublicKey))) {
+  if (0 != GNUNET_memcmp (audience, &(*ticket)->audience)) {
     GNUNET_free (purpose);
     GNUNET_free (*ticket);
     json_decref (code_json);
index 761c9e83d3f5e811b6c0c601eeac865493ca40f8..6cf1ffdee5acab4b6d510df1725b3b04f02bbf28 100644 (file)
@@ -1007,8 +1007,7 @@ code_redirect (void *cls)
       for (handle->ego_entry = handle->ego_head; NULL != handle->ego_entry;
            handle->ego_entry = handle->ego_entry->next) {
         GNUNET_IDENTITY_ego_get_public_key (handle->ego_entry->ego, &ego_pkey);
-        if (0 == memcmp (&ego_pkey, &pubkey,
-                         sizeof (struct GNUNET_CRYPTO_EcdsaPublicKey))) {
+        if (0 == GNUNET_memcmp (&ego_pkey, &pubkey)) {
           handle->priv_key =
               *GNUNET_IDENTITY_ego_get_private_key (handle->ego_entry->ego);
           handle->idp = GNUNET_RECLAIM_connect (cfg);
@@ -1261,8 +1260,7 @@ tld_iter (void *cls, const char *section, const char *option, const char *value)
     GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Skipping non key %s\n", value);
     return;
   }
-  if (0 == memcmp (&pkey, &handle->oidc->client_pkey,
-                   sizeof (struct GNUNET_CRYPTO_EcdsaPublicKey)))
+  if (0 == GNUNET_memcmp (&pkey, &handle->oidc->client_pkey))
     handle->tld = GNUNET_strdup (option + 1);
 }
 
@@ -1337,8 +1335,7 @@ authorize_endpoint (struct GNUNET_REST_RequestHandle *con_handle,
   for (tmp_ego = handle->ego_head; NULL != tmp_ego; tmp_ego = tmp_ego->next) {
     priv_key = GNUNET_IDENTITY_ego_get_private_key (tmp_ego->ego);
     GNUNET_CRYPTO_ecdsa_key_get_public (priv_key, &pkey);
-    if (0 == memcmp (&pkey, &handle->oidc->client_pkey,
-                     sizeof (struct GNUNET_CRYPTO_EcdsaPublicKey))) {
+    if (0 == GNUNET_memcmp (&pkey, &handle->oidc->client_pkey)) {
       handle->tld = GNUNET_strdup (tmp_ego->identifier);
       handle->ego_entry = handle->ego_tail;
     }
@@ -1522,8 +1519,7 @@ ego_exists (struct RequestHandle *handle,
   for (ego_entry = handle->ego_head; NULL != ego_entry;
        ego_entry = ego_entry->next) {
     GNUNET_IDENTITY_ego_get_public_key (ego_entry->ego, &pub_key);
-    if (0 == memcmp (&pub_key, test_key,
-                     sizeof (struct GNUNET_CRYPTO_EcdsaPublicKey))) {
+    if (0 == GNUNET_memcmp (&pub_key, test_key)) {
       break;
     }
   }
index b535394ca6af86d3c0d737a61835a65037ae041d..77efa6180d83d09d125f5df9dc4e194312507da1 100644 (file)
@@ -222,9 +222,8 @@ REGEX_BLOCK_check (const struct RegexBlock *block,
     return GNUNET_SYSERR;
   }
   if (NULL != query &&
-      0 != memcmp (&key,
-                   query,
-                   sizeof (struct GNUNET_HashCode)))
+      0 != GNUNET_memcmp (&key,
+                   query))
   {
     GNUNET_break_op (0);
     return GNUNET_SYSERR;
index 7596cab2d4a41570b3efa19068769ee9488a33dd..4b8fa15bb73c3d1186dd3eff8e4bafc3eaadeffd 100644 (file)
@@ -365,9 +365,8 @@ ego_callback (void *cls,
                              rd,
                              sizeof (struct RevocationData))) )
   {
-    if (0 != memcmp (&rd->key,
-                     &key,
-                     sizeof (struct GNUNET_CRYPTO_EcdsaPublicKey)))
+    if (0 != GNUNET_memcmp (&rd->key,
+                     &key))
     {
       fprintf (stderr,
                _("Error: revocation certificate in `%s' is not for `%s'\n"),
index fd646b4b7b112d01741d984198b5bed9318559ac..e4ea1f2ffa2a662fc7d801e7d006a1bd1ccc9c41 100644 (file)
@@ -545,9 +545,8 @@ handle_core_connect (void *cls,
   struct GNUNET_HashCode my_hash;
   struct GNUNET_HashCode peer_hash;
 
-  if (0 == memcmp (peer,
-                   &my_identity,
-                   sizeof (my_identity)))
+  if (0 == GNUNET_memcmp (peer,
+                   &my_identity))
   {
     return NULL;
   }
@@ -608,9 +607,8 @@ handle_core_disconnect (void *cls,
 {
   struct PeerEntry *peer_entry = internal_cls;
 
-  if (0 == memcmp (peer,
-                   &my_identity,
-                   sizeof (my_identity)))
+  if (0 == GNUNET_memcmp (peer,
+                   &my_identity))
     return;
   GNUNET_assert (NULL != peer_entry);
   GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
index 368bbe605bddb2d07d8acee0ab546c513eec83a7..4b1a09e5078286c94e7c64d2ce58dcba43919855 100644 (file)
@@ -776,9 +776,8 @@ cb_intersection_request_alice (void *cls,
   GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
               "Received intersection request from %s!\n",
               GNUNET_i2s (other_peer));
-  if (0 != memcmp (other_peer,
-                   &s->peer,
-                   sizeof (struct GNUNET_PeerIdentity)))
+  if (0 != GNUNET_memcmp (other_peer,
+                   &s->peer))
   {
     GNUNET_break_op (0);
     return;
index 38aef64091263d8cb77782443ad1dc9013f42965..393a1951bb27bb1185950d03985d0769644052ec 100644 (file)
@@ -1012,9 +1012,8 @@ cb_intersection_request_alice (void *cls,
 {
   struct AliceServiceSession *s = cls;
 
-  if (0 != memcmp (other_peer,
-                   &s->peer,
-                   sizeof (struct GNUNET_PeerIdentity)))
+  if (0 != GNUNET_memcmp (other_peer,
+                   &s->peer))
   {
     GNUNET_break_op (0);
     return;
index f4cc0f24846266db81eb929d961f465e86d82311..85abe154b2426fc395621f10ff23c6d9b69088c5 100644 (file)
@@ -228,7 +228,7 @@ static void decrypt_cb (void *cls,
     GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "decrypt failed for peer %u\n", n);
     return;
   }
-  else if (0 == memcmp (&reference_plaintext, plaintext, sizeof (struct GNUNET_SECRETSHARING_Plaintext)))
+  else if (0 == GNUNET_memcmp (&reference_plaintext, plaintext))
     GNUNET_log (GNUNET_ERROR_TYPE_INFO, "decrypt got correct result for peer %u\n", n);
   else
     GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "decrypt got wrong result for peer %u\n", n);
@@ -331,7 +331,7 @@ secret_ready_cb (void *cls,
     {
       common_pubkey = *public_key;
     }
-    else if (0 != memcmp (public_key, &common_pubkey, sizeof (struct GNUNET_SECRETSHARING_PublicKey)))
+    else if (0 != GNUNET_memcmp (public_key, &common_pubkey))
     {
       GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "generated public keys do not match\n");
       GNUNET_SCHEDULER_shutdown ();
index 1ffde04362ec9fc3162184b3bfdcf78eb41d8a74..d136c5a6804026f9d72ef38012727bd3e118260a 100644 (file)
@@ -330,7 +330,7 @@ get_keygen_peer_info (const struct KeygenSession *ks,
 {
   unsigned int i;
   for (i = 0; i < ks->num_peers; i++)
-    if (0 == memcmp (peer, &ks->info[i].peer, sizeof (struct GNUNET_PeerIdentity)))
+    if (0 == GNUNET_memcmp (peer, &ks->info[i].peer))
       return &ks->info[i];
   return NULL;
 }
@@ -349,7 +349,7 @@ get_decrypt_peer_info (const struct DecryptSession *ds,
 {
   unsigned int i;
   for (i = 0; i < ds->share->num_peers; i++)
-    if (0 == memcmp (peer, &ds->info[i].peer, sizeof (struct GNUNET_PeerIdentity)))
+    if (0 == GNUNET_memcmp (peer, &ds->info[i].peer))
       return &ds->info[i];
   return NULL;
 }
@@ -411,9 +411,8 @@ peer_find (const struct GNUNET_PeerIdentity *haystack, unsigned int n,
   unsigned int i;
 
   for (i = 0; i < n; i++)
-    if (0 == memcmp (&haystack[i],
-                     needle,
-                     sizeof (struct GNUNET_PeerIdentity)))
+    if (0 == GNUNET_memcmp (&haystack[i],
+                     needle))
       return i;
   return -1;
 }
@@ -827,7 +826,7 @@ keygen_round2_conclude (void *cls)
                                         GNUNET_SECRETSHARING_ELGAMAL_BITS / 8,
                                         ks->info[i].sigma);
       share->original_indices[i] = j;
-      if (0 == memcmp (&share->peers[i], &my_peer, sizeof (struct GNUNET_PeerIdentity)))
+      if (0 == GNUNET_memcmp (&share->peers[i], &my_peer))
         share->my_peer = j;
       j += 1;
     }
@@ -1897,7 +1896,7 @@ decrypt_new_element (void *cls,
     return;
   }
 
-  if (0 != memcmp (&d->ciphertext, &session->ciphertext, sizeof (struct GNUNET_SECRETSHARING_Ciphertext)))
+  if (0 != GNUNET_memcmp (&d->ciphertext, &session->ciphertext))
   {
     GNUNET_log (GNUNET_ERROR_TYPE_WARNING, "P%u: got decrypt element with non-matching ciphertext from P%u\n",
                 (unsigned int) session->share->my_peer, (unsigned int) (info - session->info));
index d681666fe2aa53275ba0d3a65b6a49209b474b35..e1bbcc152356a7ce1a1e37d72feba378f8447015 100644 (file)
@@ -843,9 +843,8 @@ process_bf (struct Operation *op)
 
   if ( (0 == op->state->my_element_count) || /* fully disjoint */
        ( (op->state->my_element_count == op->remote_element_count) &&
-         (0 == memcmp (&op->state->my_xor,
-                       &op->state->other_xor,
-                       sizeof (struct GNUNET_HashCode))) ) )
+         (0 == GNUNET_memcmp (&op->state->my_xor,
+                       &op->state->other_xor)) ) )
   {
     /* we are done */
     op->state->phase = PHASE_MUST_SEND_DONE;
@@ -1059,9 +1058,8 @@ handle_intersection_p2p_done (void *cls,
                                            op);
   }
   if ( (op->state->my_element_count != ntohl (idm->final_element_count)) ||
-       (0 != memcmp (&op->state->my_xor,
-                     &idm->element_xor_hash,
-                     sizeof (struct GNUNET_HashCode))) )
+       (0 != GNUNET_memcmp (&op->state->my_xor,
+                     &idm->element_xor_hash)) )
   {
     /* Other peer thinks we are done, but we disagree on the result! */
     GNUNET_break_op (0);
index c6711bf0d47a2dee23ea69d2f254e3de154bc2b6..69216443f00fddf045238cd5917df749b5d1aac2 100644 (file)
@@ -192,9 +192,8 @@ run_queries (sqlite3 *dbh)
     GNUNET_break (abs_time.abs_value_us == abs_time2.abs_value_us);
     GNUNET_break (forever.abs_value_us == forever2.abs_value_us);
     GNUNET_break (0 ==
-                 memcmp (&hc,
-                         &hc2,
-                         sizeof (struct GNUNET_HashCode)));
+                 GNUNET_memcmp (&hc,
+                         &hc2));
     GNUNET_break (0 ==
                  GNUNET_CRYPTO_rsa_signature_cmp (sig,
                                                   sig2));
index 6c93e984517822170dbf1f3a3a84daa614ef0cf3..e5734abb45c304439cb77ea49b05660700a0c6eb 100644 (file)
@@ -306,9 +306,8 @@ attempt_connect (struct Peer *pos)
   uint32_t strength;
 
   if (0 ==
-      memcmp (&my_identity,
-              &pos->pid,
-              sizeof (struct GNUNET_PeerIdentity)))
+      GNUNET_memcmp (&my_identity,
+              &pos->pid))
     return; /* This is myself, nothing to do. */
   if (connection_count < target_connection_count)
     strength = 1;
@@ -602,9 +601,8 @@ connect_notify (void *cls,
   GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
               "Core told us that we are connecting to `%s'\n",
               GNUNET_i2s (peer));
-  if (0 == memcmp (&my_identity,
-                   peer,
-                   sizeof (struct GNUNET_PeerIdentity)))
+  if (0 == GNUNET_memcmp (&my_identity,
+                   peer))
     return NULL;
   extra = GNUNET_CORE_get_mq_options (GNUNET_YES,
                                      GNUNET_CORE_PRIO_BEST_EFFORT,
@@ -781,9 +779,8 @@ consider_for_advertising (const struct GNUNET_HELLO_Message *hello)
     GNUNET_break (0);
     return;
   }
-  if (0 == memcmp (&pid,
-                   &my_identity,
-                   sizeof (struct GNUNET_PeerIdentity)))
+  if (0 == GNUNET_memcmp (&pid,
+                   &my_identity))
     return;                     /* that's me! */
   have_address = GNUNET_NO;
   GNUNET_HELLO_iterate_addresses (hello,
@@ -869,9 +866,8 @@ process_peer (void *cls,
     return;
   }
   GNUNET_assert (NULL != peer);
-  if (0 == memcmp (&my_identity,
-                   peer,
-                   sizeof (struct GNUNET_PeerIdentity)))
+  if (0 == GNUNET_memcmp (&my_identity,
+                   peer))
     return;                     /* that's me! */
   if (NULL == hello)
   {
@@ -948,9 +944,8 @@ handle_friend (void *cls,
   unsigned int *entries_found = cls;
   struct Peer *fl;
 
-  if (0 == memcmp (pid,
-                   &my_identity,
-                   sizeof (struct GNUNET_PeerIdentity)))
+  if (0 == GNUNET_memcmp (pid,
+                   &my_identity))
   {
     GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
                 _("Found myself `%s' in friend list (useless, ignored)\n"),
index 40a890070633f71d8cc9d4077d1cc604b7e08096..91bc13fd82165c0813d51accd2c9096a7ab06a6b 100644 (file)
@@ -2437,12 +2437,10 @@ allocate_v6_address (struct in6_addr *v6)
   while ( (GNUNET_YES ==
           GNUNET_CONTAINER_multihashmap_contains (destination_map,
                                                   &key)) ||
-         (0 == memcmp (v6,
-                       &addr,
-                       sizeof (struct in6_addr))) ||
-         (0 == memcmp (v6,
-                       &mask,
-                       sizeof (struct in6_addr))) );
+         (0 == GNUNET_memcmp (v6,
+                       &addr)) ||
+         (0 == GNUNET_memcmp (v6,
+                       &mask)) );
   return GNUNET_OK;
 }