diff options
author | Schanzenbach, Martin <mschanzenbach@posteo.de> | 2020-02-03 21:51:57 +0100 |
---|---|---|
committer | Schanzenbach, Martin <mschanzenbach@posteo.de> | 2020-02-09 20:38:10 +0100 |
commit | 5b6bb2ce4d60635b2af950d72b45f12686fd5218 (patch) | |
tree | ef3b5786591f6a8473a4a2174dd95a439f22af68 /src/reclaim-attribute | |
parent | 99d70615e37294d4f964992c6be0495e95777a27 (diff) | |
download | gnunet-5b6bb2ce4d60635b2af950d72b45f12686fd5218.tar.gz gnunet-5b6bb2ce4d60635b2af950d72b45f12686fd5218.zip |
move to 256-bit identifier; some cleanups
Diffstat (limited to 'src/reclaim-attribute')
-rw-r--r-- | src/reclaim-attribute/reclaim_attribute.c | 26 | ||||
-rw-r--r-- | src/reclaim-attribute/reclaim_attribute.h | 16 |
2 files changed, 21 insertions, 21 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); |
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 | |||
39 | uint32_t attribute_type; | 39 | uint32_t attribute_type; |
40 | 40 | ||
41 | /** | 41 | /** |
42 | * Attribute version | 42 | * Attribute flag |
43 | */ | 43 | */ |
44 | uint32_t attribute_version; | 44 | uint32_t attribute_flag; |
45 | 45 | ||
46 | /** | 46 | /** |
47 | * Attribute ID | 47 | * Attribute ID |
48 | */ | 48 | */ |
49 | uint64_t attribute_id; | 49 | struct GNUNET_RECLAIM_Identifier attribute_id; |
50 | 50 | ||
51 | /** | 51 | /** |
52 | * Name length | 52 | * Name length |
@@ -72,14 +72,14 @@ struct Attestation | |||
72 | uint32_t attestation_type; | 72 | uint32_t attestation_type; |
73 | 73 | ||
74 | /** | 74 | /** |
75 | * Attestation version | 75 | * Attestation flag |
76 | */ | 76 | */ |
77 | uint32_t attestation_version; | 77 | uint32_t attestation_flag; |
78 | 78 | ||
79 | /** | 79 | /** |
80 | * Attestation ID | 80 | * Attestation ID |
81 | */ | 81 | */ |
82 | uint64_t attestation_id; | 82 | struct GNUNET_RECLAIM_Identifier attestation_id; |
83 | 83 | ||
84 | /** | 84 | /** |
85 | * Name length | 85 | * Name length |
@@ -102,12 +102,12 @@ struct Attestation_Reference | |||
102 | /** | 102 | /** |
103 | * Reference ID | 103 | * Reference ID |
104 | */ | 104 | */ |
105 | uint64_t reference_id; | 105 | struct GNUNET_RECLAIM_Identifier reference_id; |
106 | 106 | ||
107 | /** | 107 | /** |
108 | * The ID of the referenced attestation | 108 | * The ID of the referenced attestation |
109 | */ | 109 | */ |
110 | uint64_t attestation_id; | 110 | struct GNUNET_RECLAIM_Identifier attestation_id; |
111 | 111 | ||
112 | /** | 112 | /** |
113 | * Claim Name length | 113 | * Claim Name length |