gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[GNUnet-SVN] r20159 - gnunet/src/namestore


From: gnunet
Subject: [GNUnet-SVN] r20159 - gnunet/src/namestore
Date: Thu, 1 Mar 2012 11:30:42 +0100

Author: wachs
Date: 2012-03-01 11:30:42 +0100 (Thu, 01 Mar 2012)
New Revision: 20159

Modified:
   gnunet/src/namestore/gnunet-service-namestore.c
   gnunet/src/namestore/namestore.h
   gnunet/src/namestore/namestore_api.c
Log:
- message renaming


Modified: gnunet/src/namestore/gnunet-service-namestore.c
===================================================================
--- gnunet/src/namestore/gnunet-service-namestore.c     2012-03-01 10:08:51 UTC 
(rev 20158)
+++ gnunet/src/namestore/gnunet-service-namestore.c     2012-03-01 10:30:42 UTC 
(rev 20159)
@@ -45,7 +45,7 @@
 
   GNUNET_HashCode zone;
 
-  uint64_t op_id;
+  uint64_t request_id;
   uint32_t offset;
 
 };
@@ -188,7 +188,7 @@
 struct LookupNameContext
 {
   struct GNUNET_NAMESTORE_Client *nc;
-  uint32_t id;
+  uint32_t request_id;
   uint32_t record_type;
 };
 
@@ -280,9 +280,9 @@
 
   lnr_msg = GNUNET_malloc (r_size);
 
-  lnr_msg->header.type = ntohs 
(GNUNET_MESSAGE_TYPE_NAMESTORE_LOOKUP_NAME_RESPONSE);
-  lnr_msg->header.size = ntohs (r_size);
-  lnr_msg->op_id = htonl (lnc->id);
+  lnr_msg->gns_header.header.type = ntohs 
(GNUNET_MESSAGE_TYPE_NAMESTORE_LOOKUP_NAME_RESPONSE);
+  lnr_msg->gns_header.header.size = ntohs (r_size);
+  lnr_msg->gns_header.r_id = htonl (lnc->request_id);
   lnr_msg->rd_len = htons (rd_ser_len);
   lnr_msg->name_len = htons (name_len);
   lnr_msg->expire = GNUNET_TIME_absolute_hton(expire);
@@ -321,7 +321,7 @@
   struct GNUNET_NAMESTORE_Client *nc;
   size_t name_len;
   char * name;
-  uint32_t id = 0;
+  uint32_t rid = 0;
   uint32_t type = 0;
   int res;
 
@@ -341,7 +341,7 @@
   }
 
   struct LookupNameMessage * ln_msg = (struct LookupNameMessage *) message;
-  id = ntohl (ln_msg->op_id);
+  rid = ntohl (ln_msg->gns_header.r_id);
   name_len = ntohl (ln_msg->name_len);
   type = ntohl (ln_msg->record_type);
 
@@ -363,7 +363,7 @@
   GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Looking up record for name `%s'\n", 
name);
 
   /* do the actual lookup */
-  lnc.id = id;
+  lnc.request_id = rid;
   lnc.nc = nc;
   lnc.record_type = type;
   res = GSN_database->iterate_records(GSN_database->cls, &ln_msg->zone, name, 
0, &handle_lookup_name_it, &lnc);
@@ -388,7 +388,7 @@
   size_t key_len;
   char * name;
   char * rd_ser;
-  uint32_t id = 0;
+  uint32_t rid = 0;
   uint32_t rd_ser_len;
   uint32_t rd_count;
   int res = GNUNET_SYSERR;
@@ -410,7 +410,7 @@
 
   struct RecordPutMessage * rp_msg = (struct RecordPutMessage *) message;
 
-  id = ntohl (rp_msg->op_id);
+  rid = ntohl (rp_msg->gns_header.r_id);
   key_len = sizeof (struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded);
   name_len = ntohs (rp_msg->name_len);
   rd_ser_len = ntohs(rp_msg->rd_len);
@@ -470,7 +470,7 @@
 
   GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Sending `%s' message\n", 
"RECORD_PUT_RESPONSE");
   rpr_msg.header.type = htons 
(GNUNET_MESSAGE_TYPE_NAMESTORE_RECORD_PUT_RESPONSE);
-  rpr_msg.op_id = rp_msg->op_id;
+  rpr_msg.op_id = rp_msg->gns_header.r_id;
   rpr_msg.header.size = htons (sizeof (struct RecordPutResponseMessage));
   if (GNUNET_OK == res)
     rpr_msg.op_result = htons (GNUNET_OK);
@@ -549,9 +549,9 @@
   /* Send response */
 
   GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Sending `%s' message\n", 
"RECORD_CREATE_RESPONSE");
-  rcr_msg.header.type = htons 
(GNUNET_MESSAGE_TYPE_NAMESTORE_RECORD_CREATE_RESPONSE);
-  rcr_msg.op_id = htonl (crc->op_id);
-  rcr_msg.header.size = htons (sizeof (struct RecordCreateResponseMessage));
+  rcr_msg.gns_header.header.type = htons 
(GNUNET_MESSAGE_TYPE_NAMESTORE_RECORD_CREATE_RESPONSE);
+  rcr_msg.gns_header.r_id = htonl (crc->op_id);
+  rcr_msg.gns_header.header.size = htons (sizeof (struct 
RecordCreateResponseMessage));
   if (GNUNET_OK == res)
     rcr_msg.op_result = htons (GNUNET_OK);
   else
@@ -575,7 +575,7 @@
   size_t msg_size_exp;
   size_t rd_ser_len;
   size_t key_len;
-  uint32_t id = 0;
+  uint32_t rid = 0;
   char *pkey_tmp;
   char *name_tmp;
   char *rd_ser;
@@ -600,7 +600,7 @@
   }
 
   struct RecordCreateMessage * rp_msg = (struct RecordCreateMessage *) message;
-  id = ntohl (rp_msg->op_id);
+  rid = ntohl (rp_msg->gns_header.r_id);
   name_len = ntohs (rp_msg->name_len);
   msg_size = ntohs (message->size);
   rd_ser_len = ntohs (rp_msg->rd_len);
@@ -645,7 +645,7 @@
   crc.pkey = pkey;
   crc.rd = rd;
   crc.nc = nc;
-  crc.op_id = id;
+  crc.op_id = rid;
 
   /* Get existing records for name */
   res = GSN_database->iterate_records(GSN_database->cls, &pubkey_hash, 
name_tmp, 0, &handle_create_record_it, &crc);
@@ -668,7 +668,7 @@
   size_t name_len;
   size_t msg_size;
   size_t msg_size_exp;
-  uint32_t id = 0;
+  uint32_t rid = 0;
 
   int res = GNUNET_SYSERR;
 
@@ -688,7 +688,7 @@
   }
 
   struct RecordRemoveMessage * rp_msg = (struct RecordRemoveMessage *) message;
-  id = ntohl (rp_msg->op_id);
+  rid = ntohl (rp_msg->gns_header.r_id);
   name_len = ntohs (rp_msg->name_len);
   msg_size = ntohs (message->size);
   msg_size_exp = sizeof (struct RecordRemoveMessage) + name_len + sizeof 
(struct GNUNET_NAMESTORE_RecordData);
@@ -721,9 +721,9 @@
   /* Send response */
 
   GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Sending `%s' message\n", 
"RECORD_REMOVE_RESPONSE");
-  rrr_msg.header.type = htons 
(GNUNET_MESSAGE_TYPE_NAMESTORE_RECORD_REMOVE_RESPONSE);
-  rrr_msg.op_id = rp_msg->op_id;
-  rrr_msg.header.size = htons (sizeof (struct RecordRemoveResponseMessage));
+  rrr_msg.gns_header.header.type = htons 
(GNUNET_MESSAGE_TYPE_NAMESTORE_RECORD_REMOVE_RESPONSE);
+  rrr_msg.gns_header.r_id = rp_msg->gns_header.r_id;
+  rrr_msg.gns_header.header.size = htons (sizeof (struct 
RecordRemoveResponseMessage));
   if (GNUNET_OK == res)
     rrr_msg.op_result = htons (GNUNET_OK);
   else
@@ -815,7 +815,7 @@
   }
 
   zi = GNUNET_malloc (sizeof (struct GNUNET_NAMESTORE_ZoneIteration));
-  zi->op_id = ntohl (zis_msg->op_id);
+  zi->request_id = ntohl (zis_msg->gns_header.r_id);
   zi->offset = 0;
   zi->client = nc;
   zi->zone = zis_msg->zone;
@@ -841,9 +841,9 @@
 
 
   GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Sending `%s' message\n", 
"ZONE_ITERATION_RESPONSE");
-  zir_msg.header.type = htons 
(GNUNET_MESSAGE_TYPE_NAMESTORE_ZONE_ITERATION_RESPONSE);
-  zir_msg.op_id = htonl(zi->op_id);
-  zir_msg.header.size = htons (sizeof (struct ZoneIterationResponseMessage));
+  zir_msg.gns_header.header.type = htons 
(GNUNET_MESSAGE_TYPE_NAMESTORE_ZONE_ITERATION_RESPONSE);
+  zir_msg.gns_header.r_id = htonl(zi->request_id);
+  zir_msg.gns_header.header.size = htons (sizeof (struct 
ZoneIterationResponseMessage));
 
 
   GNUNET_SERVER_notification_context_unicast (snc, zi->client->client, (const 
struct GNUNET_MessageHeader *) &zir_msg, GNUNET_NO);
@@ -861,7 +861,7 @@
   struct GNUNET_NAMESTORE_Client *nc;
   struct GNUNET_NAMESTORE_ZoneIteration *zi;
   struct ZoneIterationStopMessage * zis_msg = (struct ZoneIterationStopMessage 
*) message;
-  uint32_t id;
+  uint32_t rid;
 
   nc = client_lookup(client);
   if (nc == NULL)
@@ -871,10 +871,10 @@
     return;
   }
 
-  id = ntohl (zis_msg->op_id);
+  rid = ntohl (zis_msg->gns_header.r_id);
   for (zi = nc->op_head; zi != NULL; zi = zi->next)
   {
-    if (zi->op_id == id)
+    if (zi->request_id == rid)
       break;
   }
   if (zi == NULL)
@@ -900,7 +900,7 @@
   struct GNUNET_NAMESTORE_Client *nc;
   struct GNUNET_NAMESTORE_ZoneIteration *zi;
   struct ZoneIterationStopMessage * zis_msg = (struct ZoneIterationStopMessage 
*) message;
-  uint32_t id;
+  uint32_t rid;
   int res;
 
   nc = client_lookup(client);
@@ -911,10 +911,10 @@
     return;
   }
 
-  id = ntohl (zis_msg->op_id);
+  rid = ntohl (zis_msg->gns_header.r_id);
   for (zi = nc->op_head; zi != NULL; zi = zi->next)
   {
-    if (zi->op_id == id)
+    if (zi->request_id == rid)
       break;
   }
   if (zi == NULL)

Modified: gnunet/src/namestore/namestore.h
===================================================================
--- gnunet/src/namestore/namestore.h    2012-03-01 10:08:51 UTC (rev 20158)
+++ gnunet/src/namestore/namestore.h    2012-03-01 10:30:42 UTC (rev 20159)
@@ -101,17 +101,18 @@
 /**
  * Generic namestore message with op id
  */
-struct GenericMessage
+struct GNUNET_NAMESTORE_Header
 {
   /**
-   * Type will be GNUNET_MESSAGE_TYPE_NAMESTORE_*
+   * header.type will be GNUNET_MESSAGE_TYPE_NAMESTORE_*
+   * header.size will be message size
    */
   struct GNUNET_MessageHeader header;
 
   /**
-   * Operation ID in NBO // BETTER: request ID
+   * Request ID in NBO
    */
-  uint32_t op_id;
+  uint32_t r_id;
 };
 
 
@@ -120,17 +121,8 @@
  */
 struct LookupNameMessage
 {
-  /**
-   * Type will be GNUNET_MESSAGE_TYPE_NAMESTORE_LOOKUP_NAME
-   */
-  struct GNUNET_MessageHeader header;
+  struct GNUNET_NAMESTORE_Header gns_header;
 
-  // FIXME: use 'struct GenericMessage'
-  /**
-   * Operation ID in NBO
-   */
-  uint32_t op_id;
-
   /* The zone */
   GNUNET_HashCode zone;
 
@@ -152,13 +144,8 @@
   /**
    * Type will be GNUNET_MESSAGE_TYPE_NAMESTORE_LOOKUP_NAME_RESPONSE
    */
-  struct GNUNET_MessageHeader header;
+  struct GNUNET_NAMESTORE_Header gns_header;
 
-  /**
-   * Operation ID in NBO
-   */
-  uint32_t op_id;
-
   struct GNUNET_TIME_AbsoluteNBO expire;
 
   uint16_t name_len;
@@ -181,13 +168,8 @@
   /**
    * Type will be GNUNET_MESSAGE_TYPE_NAMESTORE_LOOKUP_RECORD_PUT
    */
-  struct GNUNET_MessageHeader header;
+  struct GNUNET_NAMESTORE_Header gns_header;
 
-  /**
-   * Operation ID in NBO
-   */
-  uint32_t op_id;
-
   /* Contenct starts here */
 
   /* name length */
@@ -239,13 +221,8 @@
   /**
    * Type will be GNUNET_MESSAGE_TYPE_NAMESTORE_RECORD_CREATE
    */
-  struct GNUNET_MessageHeader header;
+  struct GNUNET_NAMESTORE_Header gns_header;
 
-  /**
-   * Operation ID in NBO
-   */
-  uint32_t op_id;
-
   /* Contenct starts here */
 
   /* name length */
@@ -268,13 +245,8 @@
   /**
    * Type will be GNUNET_MESSAGE_TYPE_NAMESTORE_RECORD_CREATE_RESPONSE
    */
-  struct GNUNET_MessageHeader header;
+  struct GNUNET_NAMESTORE_Header gns_header;
 
-  /**
-   * Operation ID in NBO
-   */
-  uint32_t op_id;
-
   /* Contenct starts here */
 
   /**
@@ -295,13 +267,8 @@
   /**
    * Type will be GNUNET_MESSAGE_TYPE_NAMESTORE_RECORD_REMOVE
    */
-  struct GNUNET_MessageHeader header;
+  struct GNUNET_NAMESTORE_Header gns_header;
 
-  /**
-   * Operation ID in NBO
-   */
-  uint32_t op_id;
-
   /* Contenct starts here */
 
   /* name length */
@@ -321,13 +288,8 @@
   /**
    * Type will be GNUNET_MESSAGE_TYPE_NAMESTORE_RECORD_REMOVE_RESPONSE
    */
-  struct GNUNET_MessageHeader header;
+  struct GNUNET_NAMESTORE_Header gns_header;
 
-  /**
-   * Operation ID in NBO
-   */
-  uint32_t op_id;
-
   /* Contenct starts here */
 
   /**
@@ -347,13 +309,8 @@
   /**
    * Type will be GNUNET_MESSAGE_TYPE_NAMESTORE_ZONE_ITERATION_START
    */
-  struct GNUNET_MessageHeader header;
+  struct GNUNET_NAMESTORE_Header gns_header;
 
-  /**
-   * Operation ID in NBO
-   */
-  uint32_t op_id;
-
   /* Contenct starts here */
 
   uint16_t must_have_flags;
@@ -372,12 +329,7 @@
   /**
    * Type will be GNUNET_MESSAGE_TYPE_NAMESTORE_ZONE_ITERATION_NEXT
    */
-  struct GNUNET_MessageHeader header;
-
-  /**
-   * Operation ID in NBO
-   */
-  uint32_t op_id;
+  struct GNUNET_NAMESTORE_Header gns_header;
 };
 GNUNET_NETWORK_STRUCT_END
 
@@ -391,12 +343,7 @@
   /**
    * Type will be GNUNET_MESSAGE_TYPE_NAMESTORE_ZONE_ITERATION_STOP
    */
-  struct GNUNET_MessageHeader header;
-
-  /**
-   * Operation ID in NBO
-   */
-  uint32_t op_id;
+  struct GNUNET_NAMESTORE_Header gns_header;
 };
 GNUNET_NETWORK_STRUCT_END
 
@@ -409,13 +356,8 @@
   /**
    * Type will be GNUNET_MESSAGE_TYPE_NAMESTORE_ZONE_ITERATION_RESPONSE
    */
-  struct GNUNET_MessageHeader header;
+  struct GNUNET_NAMESTORE_Header gns_header;
 
-  /**
-   * Operation ID in NBO
-   */
-  uint32_t op_id;
-
   struct GNUNET_TIME_AbsoluteNBO expire;
 
   uint16_t name_len;

Modified: gnunet/src/namestore/namestore_api.c
===================================================================
--- gnunet/src/namestore/namestore_api.c        2012-03-01 10:08:51 UTC (rev 
20158)
+++ gnunet/src/namestore/namestore_api.c        2012-03-01 10:30:42 UTC (rev 
20159)
@@ -221,7 +221,7 @@
   int rd_count = 0;
 
   rd_len = ntohs (msg->rd_len);
-  msg_len = ntohs (msg->header.size);
+  msg_len = ntohs (msg->gns_header.header.size);
   name_len = ntohs (msg->name_len);
   contains_sig = ntohs (msg->contains_sig);
   expire = GNUNET_TIME_absolute_ntoh(msg->expire);
@@ -442,12 +442,12 @@
 process_namestore_message (void *cls, const struct GNUNET_MessageHeader *msg)
 {
   struct GNUNET_NAMESTORE_Handle *h = cls;
-  struct GenericMessage * gm;
+  struct GNUNET_NAMESTORE_Header * gm;
   struct GNUNET_NAMESTORE_QueueEntry *qe;
   struct GNUNET_NAMESTORE_ZoneIterator *ze;
   uint16_t size;
   uint16_t type;
-  uint32_t op_id = UINT32_MAX;
+  uint32_t r_id = UINT32_MAX;
 
   if (NULL == msg)
   {
@@ -458,7 +458,7 @@
   size = ntohs (msg->size);
   type = ntohs (msg->type);
 
-  if (size < sizeof (struct GenericMessage))
+  if (size < sizeof (struct GNUNET_NAMESTORE_Header))
   {
     GNUNET_break_op (0);
     GNUNET_CLIENT_receive (h->client, &process_namestore_message, h,
@@ -466,13 +466,13 @@
     return;
   }
 
-  gm = (struct GenericMessage *) msg;
-  op_id = ntohl (gm->op_id);
+  gm = (struct GNUNET_NAMESTORE_Header *) msg;
+  r_id = ntohl (gm->r_id);
 
-  GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Received message type %i size %i op 
%u\n", type, size, op_id);
+  GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Received message type %i size %i op 
%u\n", type, size, r_id);
 
   /* Find matching operation */
-  if (op_id > h->op_id)
+  if (r_id > h->op_id)
   {
     /* No matching pending operation found */
     GNUNET_break_op (0);
@@ -484,7 +484,7 @@
   /* Is it a record related operation ? */
   for (qe = h->op_head; qe != NULL; qe = qe->next)
   {
-    if (qe->op_id == op_id)
+    if (qe->op_id == r_id)
       break;
   }
   if (qe != NULL)
@@ -495,7 +495,7 @@
   /* Is it a zone iteration operation ? */
   for (ze = h->z_head; ze != NULL; ze = ze->next)
   {
-    if (ze->op_id == op_id)
+    if (ze->op_id == r_id)
       break;
   }
   if (ze != NULL)
@@ -766,7 +766,7 @@
   size_t name_len = 0;
   size_t rd_ser_len = 0;
   size_t pubkey_len = 0;
-  uint32_t id = 0;
+  uint32_t rid = 0;
 
   GNUNET_assert (NULL != h);
   GNUNET_assert (NULL != zone_key);
@@ -781,12 +781,12 @@
     return NULL;
   }
 
-  id = get_op_id(h);
+  rid = get_op_id(h);
   qe = GNUNET_malloc(sizeof (struct GNUNET_NAMESTORE_QueueEntry));
   qe->nsh = h;
   qe->cont = cont;
   qe->cont_cls = cont_cls;
-  qe->op_id = id;
+  qe->op_id = rid;
   GNUNET_CONTAINER_DLL_insert_tail(h->op_head, h->op_tail, qe);
 
   /* set msg_size*/
@@ -804,9 +804,9 @@
   name_tmp = (char *) &zone_key_tmp[pubkey_len];
   rd_tmp = &name_tmp[name_len];
 
-  msg->header.type = htons (GNUNET_MESSAGE_TYPE_NAMESTORE_RECORD_PUT);
-  msg->header.size = htons (msg_size);
-  msg->op_id = htonl (id);
+  msg->gns_header.header.type = htons 
(GNUNET_MESSAGE_TYPE_NAMESTORE_RECORD_PUT);
+  msg->gns_header.header.size = htons (msg_size);
+  msg->gns_header.r_id = htonl (rid);
   msg->key_len = htons (pubkey_len);
   memcpy (zone_key_tmp, zone_key, pubkey_len);
   msg->signature = *signature;
@@ -880,7 +880,7 @@
   size_t msg_size = 0;
   size_t name_len = 0;
   size_t key_len = 0;
-  uint32_t id = 0;
+  uint32_t rid = 0;
 
   GNUNET_assert (NULL != h);
   GNUNET_assert (NULL != pkey);
@@ -894,12 +894,12 @@
     return NULL;
   }
 
-  id = get_op_id(h);
+  rid = get_op_id(h);
   qe = GNUNET_malloc(sizeof (struct GNUNET_NAMESTORE_QueueEntry));
   qe->nsh = h;
   qe->cont = cont;
   qe->cont_cls = cont_cls;
-  qe->op_id = id;
+  qe->op_id = rid;
   GNUNET_CONTAINER_DLL_insert_tail(h->op_head, h->op_tail, qe);
 
   /* set msg_size*/
@@ -920,9 +920,9 @@
   name_tmp = &pkey_tmp[key_len];
   rd_tmp = &name_tmp[name_len];
 
-  msg->header.type = htons (GNUNET_MESSAGE_TYPE_NAMESTORE_RECORD_CREATE);
-  msg->header.size = htons (msg_size);
-  msg->op_id = htonl (id);
+  msg->gns_header.header.type = htons 
(GNUNET_MESSAGE_TYPE_NAMESTORE_RECORD_CREATE);
+  msg->gns_header.header.size = htons (msg_size);
+  msg->gns_header.r_id = htonl (rid);
   msg->name_len = htons (name_len);
   msg->rd_len = htons (rd_ser_len);
   msg->pkey_len = htons (key_len);
@@ -971,16 +971,16 @@
   size_t rd_ser_len = 0;
   size_t msg_size = 0;
   size_t name_len = 0;
-  uint32_t id = 0;
+  uint32_t rid = 0;
 
   GNUNET_assert (NULL != h);
 
-  id = get_op_id(h);
+  rid = get_op_id(h);
   qe = GNUNET_malloc(sizeof (struct GNUNET_NAMESTORE_QueueEntry));
   qe->nsh = h;
   qe->cont = cont;
   qe->cont_cls = cont_cls;
-  qe->op_id = id;
+  qe->op_id = rid;
 
   /* set msg_size*/
   rd_ser_len = GNUNET_NAMESTORE_records_serialize(&rd_ser, 1, rd);
@@ -996,9 +996,9 @@
   name_tmp = (char *) &msg[1];
   rd_tmp = &name_tmp[name_len];
 
-  msg->header.type = htons (GNUNET_MESSAGE_TYPE_NAMESTORE_RECORD_REMOVE);
-  msg->header.size = htons (msg_size);
-  msg->op_id = htonl (id);
+  msg->gns_header.header.type = htons 
(GNUNET_MESSAGE_TYPE_NAMESTORE_RECORD_REMOVE);
+  msg->gns_header.header.size = htons (msg_size);
+  msg->gns_header.r_id = htonl (rid);
   //msg->signature = *signature;
   msg->name_len = htons (name_len);
   memcpy (name_tmp, name, name_len);
@@ -1038,7 +1038,7 @@
   struct PendingMessage *pe;
   size_t msg_size = 0;
   size_t name_len = 0;
-  uint32_t id = 0;
+  uint32_t rid = 0;
 
   GNUNET_assert (NULL != h);
   GNUNET_assert (NULL != zone);
@@ -1051,12 +1051,12 @@
     return NULL;
   }
 
-  id = get_op_id(h);
+  rid = get_op_id(h);
   qe = GNUNET_malloc(sizeof (struct GNUNET_NAMESTORE_QueueEntry));
   qe->nsh = h;
   qe->proc = proc;
   qe->proc_cls = proc_cls;
-  qe->op_id = id;
+  qe->op_id = rid;
   GNUNET_CONTAINER_DLL_insert_tail(h->op_head, h->op_tail, qe);
 
   /* set msg_size*/
@@ -1068,9 +1068,9 @@
   pe->size = msg_size;
   pe->is_init = GNUNET_NO;
   msg = (struct LookupNameMessage *) &pe[1];
-  msg->header.type = htons (GNUNET_MESSAGE_TYPE_NAMESTORE_LOOKUP_NAME);
-  msg->header.size = htons (msg_size);
-  msg->op_id = htonl (id);
+  msg->gns_header.header.type = htons 
(GNUNET_MESSAGE_TYPE_NAMESTORE_LOOKUP_NAME);
+  msg->gns_header.header.size = htons (msg_size);
+  msg->gns_header.r_id = htonl (rid);
   msg->record_type = htonl (record_type);
   msg->zone = *zone;
   msg->name_len = htonl (name_len);
@@ -1116,17 +1116,17 @@
   struct GNUNET_NAMESTORE_ZoneIterator *it;
   struct PendingMessage *pe;
   size_t msg_size = 0;
-  uint32_t id = 0;
+  uint32_t rid = 0;
 
   GNUNET_assert (NULL != h);
   GNUNET_assert (NULL != zone);
 
-  id = get_op_id(h);
+  rid = get_op_id(h);
   it = GNUNET_malloc (sizeof (struct GNUNET_NAMESTORE_ZoneIterator));
   it->h = h;
   it->proc = proc;
   it->proc_cls = proc;
-  it->op_id = id;
+  it->op_id = rid;
   it->zone = *zone;
   GNUNET_CONTAINER_DLL_insert_tail(h->z_head, h->z_tail, it);
 
@@ -1139,9 +1139,9 @@
   pe->size = msg_size;
   pe->is_init = GNUNET_NO;
   msg = (struct ZoneIterationStartMessage *) &pe[1];
-  msg->header.type = htons 
(GNUNET_MESSAGE_TYPE_NAMESTORE_ZONE_ITERATION_START);
-  msg->header.size = htons (msg_size);
-  msg->op_id = htonl (id);
+  msg->gns_header.header.type = htons 
(GNUNET_MESSAGE_TYPE_NAMESTORE_ZONE_ITERATION_START);
+  msg->gns_header.header.size = htons (msg_size);
+  msg->gns_header.r_id = htonl (rid);
   msg->zone = *zone;
   msg->must_have_flags = ntohs (must_have_flags);
   msg->must_not_have_flags = ntohs (must_not_have_flags);
@@ -1181,9 +1181,9 @@
   pe->size = msg_size;
   pe->is_init = GNUNET_NO;
   msg = (struct ZoneIterationNextMessage *) &pe[1];
-  msg->header.type = htons (GNUNET_MESSAGE_TYPE_NAMESTORE_ZONE_ITERATION_NEXT);
-  msg->header.size = htons (msg_size);
-  msg->op_id = htonl (it->op_id);
+  msg->gns_header.header.type = htons 
(GNUNET_MESSAGE_TYPE_NAMESTORE_ZONE_ITERATION_NEXT);
+  msg->gns_header.header.size = htons (msg_size);
+  msg->gns_header.r_id = htonl (it->op_id);
 
   GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Sending `%s' message for name `%s'\n", 
"ZONE_ITERATION_NEXT", GNUNET_h2s(&it->zone));
 
@@ -1215,9 +1215,9 @@
   pe->size = msg_size;
   pe->is_init = GNUNET_NO;
   msg = (struct ZoneIterationStopMessage *) &pe[1];
-  msg->header.type = htons (GNUNET_MESSAGE_TYPE_NAMESTORE_ZONE_ITERATION_STOP);
-  msg->header.size = htons (msg_size);
-  msg->op_id = htonl (it->op_id);
+  msg->gns_header.header.type = htons 
(GNUNET_MESSAGE_TYPE_NAMESTORE_ZONE_ITERATION_STOP);
+  msg->gns_header.header.size = htons (msg_size);
+  msg->gns_header.r_id = htonl (it->op_id);
 
   GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Sending `%s' message for name `%s'\n", 
"ZONE_ITERATION_STOP", GNUNET_h2s(&it->zone));
 




reply via email to

[Prev in Thread] Current Thread [Next in Thread]