From 5b6bb2ce4d60635b2af950d72b45f12686fd5218 Mon Sep 17 00:00:00 2001 From: "Schanzenbach, Martin" Date: Mon, 3 Feb 2020 21:51:57 +0100 Subject: move to 256-bit identifier; some cleanups --- src/reclaim-attribute/reclaim_attribute.c | 26 +++++++++++++------------- src/reclaim-attribute/reclaim_attribute.h | 16 ++++++++-------- 2 files changed, 21 insertions(+), 21 deletions(-) (limited to 'src/reclaim-attribute') diff --git a/src/reclaim-attribute/reclaim_attribute.c b/src/reclaim-attribute/reclaim_attribute.c index 43199c108..07d8200c6 100644 --- a/src/reclaim-attribute/reclaim_attribute.c +++ b/src/reclaim-attribute/reclaim_attribute.c @@ -389,7 +389,7 @@ GNUNET_RECLAIM_ATTESTATION_claim_new (const char *attr_name, + strlen (attr_name_tmp) + 1 + data_size); attr->type = type; attr->data_size = data_size; - attr->version = 0; + attr->flag = 0; write_ptr = (char *) &attr[1]; GNUNET_memcpy (write_ptr, attr_name_tmp, strlen (attr_name_tmp) + 1); attr->name = write_ptr; @@ -797,8 +797,8 @@ GNUNET_RECLAIM_ATTRIBUTE_serialize ( attr_ser = (struct Attribute *) result; attr_ser->attribute_type = htons (attr->type); - attr_ser->attribute_version = htonl (attr->flag); - attr_ser->attribute_id = GNUNET_htonll (attr->id); + attr_ser->attribute_flag = htonl (attr->flag); + attr_ser->attribute_id = attr->id; name_len = strlen (attr->name); attr_ser->name_len = htons (name_len); write_ptr = (char *) &attr_ser[1]; @@ -847,8 +847,8 @@ GNUNET_RECLAIM_ATTRIBUTE_deserialize (const char *data, size_t data_size) attr = GNUNET_malloc (sizeof(struct GNUNET_RECLAIM_ATTRIBUTE_Claim) + data_len + name_len + 1); attr->type = ntohs (attr_ser->attribute_type); - attr->flag = ntohl (attr_ser->attribute_version); - attr->id = GNUNET_ntohll (attr_ser->attribute_id); + attr->flag = ntohl (attr_ser->attribute_flag); + attr->id = attr_ser->attribute_id; attr->data_size = data_len; write_ptr = (char *) &attr[1]; @@ -895,8 +895,8 @@ GNUNET_RECLAIM_ATTESTATION_serialize ( attr_ser = (struct Attestation *) result; attr_ser->attestation_type = htons (attr->type); - attr_ser->attestation_version = htonl (attr->version); - attr_ser->attestation_id = GNUNET_htonll (attr->id); + attr_ser->attestation_flag = htonl (attr->flag); + attr_ser->attestation_id = attr->id; name_len = strlen (attr->name); attr_ser->name_len = htons (name_len); write_ptr = (char *) &attr_ser[1]; @@ -944,8 +944,8 @@ GNUNET_RECLAIM_ATTESTATION_deserialize (const char *data, size_t data_size) attr = GNUNET_malloc (sizeof(struct GNUNET_RECLAIM_ATTESTATION_Claim) + data_len + name_len + 1); attr->type = ntohs (attr_ser->attestation_type); - attr->version = ntohl (attr_ser->attestation_version); - attr->id = GNUNET_ntohll (attr_ser->attestation_id); + attr->flag = ntohl (attr_ser->attestation_flag); + attr->id = attr_ser->attestation_id; attr->data_size = data_len; write_ptr = (char *) &attr[1]; @@ -991,8 +991,8 @@ GNUNET_RECLAIM_ATTESTATION_REF_serialize ( struct Attestation_Reference *attr_ser; char *write_ptr; attr_ser = (struct Attestation_Reference *) result; - attr_ser->reference_id = GNUNET_htonll (attr->id); - attr_ser->attestation_id = GNUNET_htonll (attr->id_attest); + attr_ser->reference_id = attr->id; + attr_ser->attestation_id = attr->id_attest; name_len = strlen (attr->name); refval_len = strlen (attr->reference_value); attr_ser->name_len = htons (name_len); @@ -1038,8 +1038,8 @@ GNUNET_RECLAIM_ATTESTATION_REF_deserialize (const char *data, size_t data_size) attr = GNUNET_malloc (sizeof(struct GNUNET_RECLAIM_ATTESTATION_REFERENCE) + refval_len + name_len + 2); - attr->id = GNUNET_ntohll (attr_ser->reference_id); - attr->id_attest = GNUNET_ntohll (attr_ser->attestation_id); + attr->id = attr_ser->reference_id; + attr->id_attest = attr_ser->attestation_id; write_ptr = (char *) &attr[1]; GNUNET_memcpy (write_ptr, &attr_ser[1], name_len); diff --git a/src/reclaim-attribute/reclaim_attribute.h b/src/reclaim-attribute/reclaim_attribute.h index 80f1e5aac..0746df48e 100644 --- a/src/reclaim-attribute/reclaim_attribute.h +++ b/src/reclaim-attribute/reclaim_attribute.h @@ -39,14 +39,14 @@ struct Attribute uint32_t attribute_type; /** - * Attribute version + * Attribute flag */ - uint32_t attribute_version; + uint32_t attribute_flag; /** * Attribute ID */ - uint64_t attribute_id; + struct GNUNET_RECLAIM_Identifier attribute_id; /** * Name length @@ -72,14 +72,14 @@ struct Attestation uint32_t attestation_type; /** - * Attestation version + * Attestation flag */ - uint32_t attestation_version; + uint32_t attestation_flag; /** * Attestation ID */ - uint64_t attestation_id; + struct GNUNET_RECLAIM_Identifier attestation_id; /** * Name length @@ -102,12 +102,12 @@ struct Attestation_Reference /** * Reference ID */ - uint64_t reference_id; + struct GNUNET_RECLAIM_Identifier reference_id; /** * The ID of the referenced attestation */ - uint64_t attestation_id; + struct GNUNET_RECLAIM_Identifier attestation_id; /** * Claim Name length -- cgit v1.2.3