From 8e0a942237b701e2d03db2def2204417acdc6f4c Mon Sep 17 00:00:00 2001 From: Matthias Wachs Date: Thu, 1 Mar 2012 10:30:42 +0000 Subject: [PATCH] - message renaming --- src/namestore/gnunet-service-namestore.c | 64 ++++++++--------- src/namestore/namestore.h | 90 +++++------------------ src/namestore/namestore_api.c | 92 ++++++++++++------------ 3 files changed, 94 insertions(+), 152 deletions(-) diff --git a/src/namestore/gnunet-service-namestore.c b/src/namestore/gnunet-service-namestore.c index 0b85733ce..254c27fef 100644 --- a/src/namestore/gnunet-service-namestore.c +++ b/src/namestore/gnunet-service-namestore.c @@ -45,7 +45,7 @@ struct GNUNET_NAMESTORE_ZoneIteration GNUNET_HashCode zone; - uint64_t op_id; + uint64_t request_id; uint32_t offset; }; @@ -188,7 +188,7 @@ static void handle_start (void *cls, struct LookupNameContext { struct GNUNET_NAMESTORE_Client *nc; - uint32_t id; + uint32_t request_id; uint32_t record_type; }; @@ -280,9 +280,9 @@ handle_lookup_name_it (void *cls, 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 @@ static void handle_lookup_name (void *cls, 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 @@ static void handle_lookup_name (void *cls, } 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 @@ static void handle_lookup_name (void *cls, 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 @@ static void handle_record_put (void *cls, 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 @@ static void handle_record_put (void *cls, 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 @@ static void handle_record_put (void *cls, 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 @@ handle_create_record_it (void *cls, /* 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 @@ static void handle_record_create (void *cls, 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 @@ static void handle_record_create (void *cls, } 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 @@ static void handle_record_create (void *cls, 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 @@ static void handle_record_remove (void *cls, 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 @@ static void handle_record_remove (void *cls, } 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 @@ static void handle_record_remove (void *cls, /* 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 @@ static void handle_iteration_start (void *cls, } 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 @@ static void handle_iteration_start (void *cls, 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 @@ static void handle_iteration_stop (void *cls, 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 @@ static void handle_iteration_stop (void *cls, 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 @@ static void handle_iteration_next (void *cls, 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 @@ static void handle_iteration_next (void *cls, 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) diff --git a/src/namestore/namestore.h b/src/namestore/namestore.h index fa31c7234..67d86cea6 100644 --- a/src/namestore/namestore.h +++ b/src/namestore/namestore.h @@ -101,17 +101,18 @@ struct StartMessage /** * 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,16 +121,7 @@ struct GenericMessage */ struct LookupNameMessage { - /** - * Type will be GNUNET_MESSAGE_TYPE_NAMESTORE_LOOKUP_NAME - */ - struct GNUNET_MessageHeader header; - - // FIXME: use 'struct GenericMessage' - /** - * Operation ID in NBO - */ - uint32_t op_id; + struct GNUNET_NAMESTORE_Header gns_header; /* The zone */ GNUNET_HashCode zone; @@ -152,12 +144,7 @@ struct LookupNameResponseMessage /** * Type will be GNUNET_MESSAGE_TYPE_NAMESTORE_LOOKUP_NAME_RESPONSE */ - struct GNUNET_MessageHeader header; - - /** - * Operation ID in NBO - */ - uint32_t op_id; + struct GNUNET_NAMESTORE_Header gns_header; struct GNUNET_TIME_AbsoluteNBO expire; @@ -181,12 +168,7 @@ struct RecordPutMessage /** * Type will be GNUNET_MESSAGE_TYPE_NAMESTORE_LOOKUP_RECORD_PUT */ - struct GNUNET_MessageHeader header; - - /** - * Operation ID in NBO - */ - uint32_t op_id; + struct GNUNET_NAMESTORE_Header gns_header; /* Contenct starts here */ @@ -239,12 +221,7 @@ struct RecordCreateMessage /** * Type will be GNUNET_MESSAGE_TYPE_NAMESTORE_RECORD_CREATE */ - struct GNUNET_MessageHeader header; - - /** - * Operation ID in NBO - */ - uint32_t op_id; + struct GNUNET_NAMESTORE_Header gns_header; /* Contenct starts here */ @@ -268,12 +245,7 @@ struct RecordCreateResponseMessage /** * Type will be GNUNET_MESSAGE_TYPE_NAMESTORE_RECORD_CREATE_RESPONSE */ - struct GNUNET_MessageHeader header; - - /** - * Operation ID in NBO - */ - uint32_t op_id; + struct GNUNET_NAMESTORE_Header gns_header; /* Contenct starts here */ @@ -295,12 +267,7 @@ struct RecordRemoveMessage /** * Type will be GNUNET_MESSAGE_TYPE_NAMESTORE_RECORD_REMOVE */ - struct GNUNET_MessageHeader header; - - /** - * Operation ID in NBO - */ - uint32_t op_id; + struct GNUNET_NAMESTORE_Header gns_header; /* Contenct starts here */ @@ -321,12 +288,7 @@ struct RecordRemoveResponseMessage /** * Type will be GNUNET_MESSAGE_TYPE_NAMESTORE_RECORD_REMOVE_RESPONSE */ - struct GNUNET_MessageHeader header; - - /** - * Operation ID in NBO - */ - uint32_t op_id; + struct GNUNET_NAMESTORE_Header gns_header; /* Contenct starts here */ @@ -347,12 +309,7 @@ struct ZoneIterationStartMessage /** * Type will be GNUNET_MESSAGE_TYPE_NAMESTORE_ZONE_ITERATION_START */ - struct GNUNET_MessageHeader header; - - /** - * Operation ID in NBO - */ - uint32_t op_id; + struct GNUNET_NAMESTORE_Header gns_header; /* Contenct starts here */ @@ -372,12 +329,7 @@ struct ZoneIterationNextMessage /** * 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 @@ struct ZoneIterationStopMessage /** * 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,12 +356,7 @@ struct ZoneIterationResponseMessage /** * Type will be GNUNET_MESSAGE_TYPE_NAMESTORE_ZONE_ITERATION_RESPONSE */ - struct GNUNET_MessageHeader header; - - /** - * Operation ID in NBO - */ - uint32_t op_id; + struct GNUNET_NAMESTORE_Header gns_header; struct GNUNET_TIME_AbsoluteNBO expire; diff --git a/src/namestore/namestore_api.c b/src/namestore/namestore_api.c index 61bd29dc1..829005539 100644 --- a/src/namestore/namestore_api.c +++ b/src/namestore/namestore_api.c @@ -221,7 +221,7 @@ handle_lookup_name_response (struct GNUNET_NAMESTORE_QueueEntry *qe, 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 @@ static void 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 @@ process_namestore_message (void *cls, const struct GNUNET_MessageHeader *msg) 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 @@ process_namestore_message (void *cls, const struct GNUNET_MessageHeader *msg) 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 @@ process_namestore_message (void *cls, const struct GNUNET_MessageHeader *msg) /* 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 @@ process_namestore_message (void *cls, const struct GNUNET_MessageHeader *msg) /* 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 @@ GNUNET_NAMESTORE_record_put (struct GNUNET_NAMESTORE_Handle *h, 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 @@ GNUNET_NAMESTORE_record_put (struct GNUNET_NAMESTORE_Handle *h, 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 @@ GNUNET_NAMESTORE_record_put (struct GNUNET_NAMESTORE_Handle *h, 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 @@ GNUNET_NAMESTORE_record_create (struct GNUNET_NAMESTORE_Handle *h, 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 @@ GNUNET_NAMESTORE_record_create (struct GNUNET_NAMESTORE_Handle *h, 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 @@ GNUNET_NAMESTORE_record_create (struct GNUNET_NAMESTORE_Handle *h, 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 @@ GNUNET_NAMESTORE_record_remove (struct GNUNET_NAMESTORE_Handle *h, 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 @@ GNUNET_NAMESTORE_record_remove (struct GNUNET_NAMESTORE_Handle *h, 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 @@ GNUNET_NAMESTORE_lookup_record (struct GNUNET_NAMESTORE_Handle *h, 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 @@ GNUNET_NAMESTORE_lookup_record (struct GNUNET_NAMESTORE_Handle *h, 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 @@ GNUNET_NAMESTORE_lookup_record (struct GNUNET_NAMESTORE_Handle *h, 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 @@ GNUNET_NAMESTORE_zone_iteration_start (struct GNUNET_NAMESTORE_Handle *h, 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 @@ GNUNET_NAMESTORE_zone_iteration_start (struct GNUNET_NAMESTORE_Handle *h, 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 @@ GNUNET_NAMESTORE_zone_iterator_next (struct GNUNET_NAMESTORE_ZoneIterator *it) 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 @@ GNUNET_NAMESTORE_zone_iteration_stop (struct GNUNET_NAMESTORE_ZoneIterator *it) 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)); -- 2.25.1