aboutsummaryrefslogtreecommitdiff
path: root/src/reclaim-attribute/reclaim_attribute.c
diff options
context:
space:
mode:
authorSchanzenbach, Martin <mschanzenbach@posteo.de>2020-02-03 21:51:57 +0100
committerSchanzenbach, Martin <mschanzenbach@posteo.de>2020-02-09 20:38:10 +0100
commit5b6bb2ce4d60635b2af950d72b45f12686fd5218 (patch)
treeef3b5786591f6a8473a4a2174dd95a439f22af68 /src/reclaim-attribute/reclaim_attribute.c
parent99d70615e37294d4f964992c6be0495e95777a27 (diff)
downloadgnunet-5b6bb2ce4d60635b2af950d72b45f12686fd5218.tar.gz
gnunet-5b6bb2ce4d60635b2af950d72b45f12686fd5218.zip
move to 256-bit identifier; some cleanups
Diffstat (limited to 'src/reclaim-attribute/reclaim_attribute.c')
-rw-r--r--src/reclaim-attribute/reclaim_attribute.c26
1 files changed, 13 insertions, 13 deletions
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,
389 + strlen (attr_name_tmp) + 1 + data_size); 389 + strlen (attr_name_tmp) + 1 + data_size);
390 attr->type = type; 390 attr->type = type;
391 attr->data_size = data_size; 391 attr->data_size = data_size;
392 attr->version = 0; 392 attr->flag = 0;
393 write_ptr = (char *) &attr[1]; 393 write_ptr = (char *) &attr[1];
394 GNUNET_memcpy (write_ptr, attr_name_tmp, strlen (attr_name_tmp) + 1); 394 GNUNET_memcpy (write_ptr, attr_name_tmp, strlen (attr_name_tmp) + 1);
395 attr->name = write_ptr; 395 attr->name = write_ptr;
@@ -797,8 +797,8 @@ GNUNET_RECLAIM_ATTRIBUTE_serialize (
797 797
798 attr_ser = (struct Attribute *) result; 798 attr_ser = (struct Attribute *) result;
799 attr_ser->attribute_type = htons (attr->type); 799 attr_ser->attribute_type = htons (attr->type);
800 attr_ser->attribute_version = htonl (attr->flag); 800 attr_ser->attribute_flag = htonl (attr->flag);
801 attr_ser->attribute_id = GNUNET_htonll (attr->id); 801 attr_ser->attribute_id = attr->id;
802 name_len = strlen (attr->name); 802 name_len = strlen (attr->name);
803 attr_ser->name_len = htons (name_len); 803 attr_ser->name_len = htons (name_len);
804 write_ptr = (char *) &attr_ser[1]; 804 write_ptr = (char *) &attr_ser[1];
@@ -847,8 +847,8 @@ GNUNET_RECLAIM_ATTRIBUTE_deserialize (const char *data, size_t data_size)
847 attr = GNUNET_malloc (sizeof(struct GNUNET_RECLAIM_ATTRIBUTE_Claim) 847 attr = GNUNET_malloc (sizeof(struct GNUNET_RECLAIM_ATTRIBUTE_Claim)
848 + data_len + name_len + 1); 848 + data_len + name_len + 1);
849 attr->type = ntohs (attr_ser->attribute_type); 849 attr->type = ntohs (attr_ser->attribute_type);
850 attr->flag = ntohl (attr_ser->attribute_version); 850 attr->flag = ntohl (attr_ser->attribute_flag);
851 attr->id = GNUNET_ntohll (attr_ser->attribute_id); 851 attr->id = attr_ser->attribute_id;
852 attr->data_size = data_len; 852 attr->data_size = data_len;
853 853
854 write_ptr = (char *) &attr[1]; 854 write_ptr = (char *) &attr[1];
@@ -895,8 +895,8 @@ GNUNET_RECLAIM_ATTESTATION_serialize (
895 895
896 attr_ser = (struct Attestation *) result; 896 attr_ser = (struct Attestation *) result;
897 attr_ser->attestation_type = htons (attr->type); 897 attr_ser->attestation_type = htons (attr->type);
898 attr_ser->attestation_version = htonl (attr->version); 898 attr_ser->attestation_flag = htonl (attr->flag);
899 attr_ser->attestation_id = GNUNET_htonll (attr->id); 899 attr_ser->attestation_id = attr->id;
900 name_len = strlen (attr->name); 900 name_len = strlen (attr->name);
901 attr_ser->name_len = htons (name_len); 901 attr_ser->name_len = htons (name_len);
902 write_ptr = (char *) &attr_ser[1]; 902 write_ptr = (char *) &attr_ser[1];
@@ -944,8 +944,8 @@ GNUNET_RECLAIM_ATTESTATION_deserialize (const char *data, size_t data_size)
944 attr = GNUNET_malloc (sizeof(struct GNUNET_RECLAIM_ATTESTATION_Claim) 944 attr = GNUNET_malloc (sizeof(struct GNUNET_RECLAIM_ATTESTATION_Claim)
945 + data_len + name_len + 1); 945 + data_len + name_len + 1);
946 attr->type = ntohs (attr_ser->attestation_type); 946 attr->type = ntohs (attr_ser->attestation_type);
947 attr->version = ntohl (attr_ser->attestation_version); 947 attr->flag = ntohl (attr_ser->attestation_flag);
948 attr->id = GNUNET_ntohll (attr_ser->attestation_id); 948 attr->id = attr_ser->attestation_id;
949 attr->data_size = data_len; 949 attr->data_size = data_len;
950 950
951 write_ptr = (char *) &attr[1]; 951 write_ptr = (char *) &attr[1];
@@ -991,8 +991,8 @@ GNUNET_RECLAIM_ATTESTATION_REF_serialize (
991 struct Attestation_Reference *attr_ser; 991 struct Attestation_Reference *attr_ser;
992 char *write_ptr; 992 char *write_ptr;
993 attr_ser = (struct Attestation_Reference *) result; 993 attr_ser = (struct Attestation_Reference *) result;
994 attr_ser->reference_id = GNUNET_htonll (attr->id); 994 attr_ser->reference_id = attr->id;
995 attr_ser->attestation_id = GNUNET_htonll (attr->id_attest); 995 attr_ser->attestation_id = attr->id_attest;
996 name_len = strlen (attr->name); 996 name_len = strlen (attr->name);
997 refval_len = strlen (attr->reference_value); 997 refval_len = strlen (attr->reference_value);
998 attr_ser->name_len = htons (name_len); 998 attr_ser->name_len = htons (name_len);
@@ -1038,8 +1038,8 @@ GNUNET_RECLAIM_ATTESTATION_REF_deserialize (const char *data, size_t data_size)
1038 attr = GNUNET_malloc (sizeof(struct GNUNET_RECLAIM_ATTESTATION_REFERENCE) 1038 attr = GNUNET_malloc (sizeof(struct GNUNET_RECLAIM_ATTESTATION_REFERENCE)
1039 + refval_len + name_len + 2); 1039 + refval_len + name_len + 2);
1040 1040
1041 attr->id = GNUNET_ntohll (attr_ser->reference_id); 1041 attr->id = attr_ser->reference_id;
1042 attr->id_attest = GNUNET_ntohll (attr_ser->attestation_id); 1042 attr->id_attest = attr_ser->attestation_id;
1043 1043
1044 write_ptr = (char *) &attr[1]; 1044 write_ptr = (char *) &attr[1];
1045 GNUNET_memcpy (write_ptr, &attr_ser[1], name_len); 1045 GNUNET_memcpy (write_ptr, &attr_ser[1], name_len);