diff options
author | Christian Grothoff <christian@grothoff.org> | 2013-10-16 20:21:27 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2013-10-16 20:21:27 +0000 |
commit | accfd6bd85274da2f19e7230c8da6b273cfb2ece (patch) | |
tree | 60966194963795ff07b4da94f4efb6c46d6a23cf /src/gnsrecord | |
parent | 3d670727232e79b7e49a1df7ba9260db4e5798a0 (diff) | |
download | gnunet-accfd6bd85274da2f19e7230c8da6b273cfb2ece.tar.gz gnunet-accfd6bd85274da2f19e7230c8da6b273cfb2ece.zip |
-another renaming fest for GNUNET_NAMESTORE_ to GNUNET_GNSRECORD_ symbols that were moved
Diffstat (limited to 'src/gnsrecord')
-rw-r--r-- | src/gnsrecord/gnsrecord_crypto.c | 32 | ||||
-rw-r--r-- | src/gnsrecord/gnsrecord_misc.c | 32 | ||||
-rw-r--r-- | src/gnsrecord/gnsrecord_serialization.c | 16 | ||||
-rw-r--r-- | src/gnsrecord/test_gnsrecord_crypto.c | 18 | ||||
-rw-r--r-- | src/gnsrecord/test_gnsrecord_serialization.c | 12 |
5 files changed, 55 insertions, 55 deletions
diff --git a/src/gnsrecord/gnsrecord_crypto.c b/src/gnsrecord/gnsrecord_crypto.c index 823ffcae3..99a97dcdd 100644 --- a/src/gnsrecord/gnsrecord_crypto.c +++ b/src/gnsrecord/gnsrecord_crypto.c | |||
@@ -78,30 +78,30 @@ derive_block_aes_key (struct GNUNET_CRYPTO_SymmetricInitializationVector *iv, | |||
78 | * @param rd_count number of records | 78 | * @param rd_count number of records |
79 | * @return NULL on error (block too large) | 79 | * @return NULL on error (block too large) |
80 | */ | 80 | */ |
81 | struct GNUNET_NAMESTORE_Block * | 81 | struct GNUNET_GNSRECORD_Block * |
82 | GNUNET_NAMESTORE_block_create (const struct GNUNET_CRYPTO_EcdsaPrivateKey *key, | 82 | GNUNET_GNSRECORD_block_create (const struct GNUNET_CRYPTO_EcdsaPrivateKey *key, |
83 | struct GNUNET_TIME_Absolute expire, | 83 | struct GNUNET_TIME_Absolute expire, |
84 | const char *label, | 84 | const char *label, |
85 | const struct GNUNET_NAMESTORE_RecordData *rd, | 85 | const struct GNUNET_GNSRECORD_Data *rd, |
86 | unsigned int rd_count) | 86 | unsigned int rd_count) |
87 | { | 87 | { |
88 | size_t payload_len = GNUNET_NAMESTORE_records_get_size (rd_count, rd); | 88 | size_t payload_len = GNUNET_GNSRECORD_records_get_size (rd_count, rd); |
89 | char payload[sizeof (uint32_t) + payload_len]; | 89 | char payload[sizeof (uint32_t) + payload_len]; |
90 | struct GNUNET_NAMESTORE_Block *block; | 90 | struct GNUNET_GNSRECORD_Block *block; |
91 | struct GNUNET_CRYPTO_EcdsaPublicKey pkey; | 91 | struct GNUNET_CRYPTO_EcdsaPublicKey pkey; |
92 | struct GNUNET_CRYPTO_EcdsaPrivateKey *dkey; | 92 | struct GNUNET_CRYPTO_EcdsaPrivateKey *dkey; |
93 | struct GNUNET_CRYPTO_SymmetricInitializationVector iv; | 93 | struct GNUNET_CRYPTO_SymmetricInitializationVector iv; |
94 | struct GNUNET_CRYPTO_SymmetricSessionKey skey; | 94 | struct GNUNET_CRYPTO_SymmetricSessionKey skey; |
95 | uint32_t rd_count_nbo; | 95 | uint32_t rd_count_nbo; |
96 | 96 | ||
97 | if (payload_len > GNUNET_NAMESTORE_MAX_VALUE_SIZE) | 97 | if (payload_len > GNUNET_GNSRECORD_MAX_BLOCK_SIZE) |
98 | return NULL; | 98 | return NULL; |
99 | rd_count_nbo = htonl (rd_count); | 99 | rd_count_nbo = htonl (rd_count); |
100 | memcpy (payload, &rd_count_nbo, sizeof (uint32_t)); | 100 | memcpy (payload, &rd_count_nbo, sizeof (uint32_t)); |
101 | GNUNET_assert (payload_len == | 101 | GNUNET_assert (payload_len == |
102 | GNUNET_NAMESTORE_records_serialize (rd_count, rd, | 102 | GNUNET_GNSRECORD_records_serialize (rd_count, rd, |
103 | payload_len, &payload[sizeof (uint32_t)])); | 103 | payload_len, &payload[sizeof (uint32_t)])); |
104 | block = GNUNET_malloc (sizeof (struct GNUNET_NAMESTORE_Block) + | 104 | block = GNUNET_malloc (sizeof (struct GNUNET_GNSRECORD_Block) + |
105 | sizeof (uint32_t) + payload_len); | 105 | sizeof (uint32_t) + payload_len); |
106 | block->purpose.size = htonl (sizeof (uint32_t) + payload_len + | 106 | block->purpose.size = htonl (sizeof (uint32_t) + payload_len + |
107 | sizeof (struct GNUNET_CRYPTO_EccSignaturePurpose) + | 107 | sizeof (struct GNUNET_CRYPTO_EccSignaturePurpose) + |
@@ -143,7 +143,7 @@ GNUNET_NAMESTORE_block_create (const struct GNUNET_CRYPTO_EcdsaPrivateKey *key, | |||
143 | * @return #GNUNET_OK if the signature is valid | 143 | * @return #GNUNET_OK if the signature is valid |
144 | */ | 144 | */ |
145 | int | 145 | int |
146 | GNUNET_NAMESTORE_block_verify (const struct GNUNET_NAMESTORE_Block *block) | 146 | GNUNET_GNSRECORD_block_verify (const struct GNUNET_GNSRECORD_Block *block) |
147 | { | 147 | { |
148 | return GNUNET_CRYPTO_ecdsa_verify (GNUNET_SIGNATURE_PURPOSE_GNS_RECORD_SIGN, | 148 | return GNUNET_CRYPTO_ecdsa_verify (GNUNET_SIGNATURE_PURPOSE_GNS_RECORD_SIGN, |
149 | &block->purpose, | 149 | &block->purpose, |
@@ -164,10 +164,10 @@ GNUNET_NAMESTORE_block_verify (const struct GNUNET_NAMESTORE_Block *block) | |||
164 | * not well-formed | 164 | * not well-formed |
165 | */ | 165 | */ |
166 | int | 166 | int |
167 | GNUNET_NAMESTORE_block_decrypt (const struct GNUNET_NAMESTORE_Block *block, | 167 | GNUNET_GNSRECORD_block_decrypt (const struct GNUNET_GNSRECORD_Block *block, |
168 | const struct GNUNET_CRYPTO_EcdsaPublicKey *zone_key, | 168 | const struct GNUNET_CRYPTO_EcdsaPublicKey *zone_key, |
169 | const char *label, | 169 | const char *label, |
170 | GNUNET_NAMESTORE_RecordCallback proc, | 170 | GNUNET_GNSRECORD_RecordCallback proc, |
171 | void *proc_cls) | 171 | void *proc_cls) |
172 | { | 172 | { |
173 | size_t payload_len = ntohl (block->purpose.size) - | 173 | size_t payload_len = ntohl (block->purpose.size) - |
@@ -203,10 +203,10 @@ GNUNET_NAMESTORE_block_decrypt (const struct GNUNET_NAMESTORE_Block *block, | |||
203 | return GNUNET_SYSERR; | 203 | return GNUNET_SYSERR; |
204 | } | 204 | } |
205 | { | 205 | { |
206 | struct GNUNET_NAMESTORE_RecordData rd[rd_count]; | 206 | struct GNUNET_GNSRECORD_Data rd[rd_count]; |
207 | 207 | ||
208 | if (GNUNET_OK != | 208 | if (GNUNET_OK != |
209 | GNUNET_NAMESTORE_records_deserialize (payload_len - sizeof (uint32_t), | 209 | GNUNET_GNSRECORD_records_deserialize (payload_len - sizeof (uint32_t), |
210 | &payload[sizeof (uint32_t)], | 210 | &payload[sizeof (uint32_t)], |
211 | rd_count, | 211 | rd_count, |
212 | rd)) | 212 | rd)) |
@@ -230,14 +230,14 @@ GNUNET_NAMESTORE_block_decrypt (const struct GNUNET_NAMESTORE_Block *block, | |||
230 | * @param query hash to use for the query | 230 | * @param query hash to use for the query |
231 | */ | 231 | */ |
232 | void | 232 | void |
233 | GNUNET_NAMESTORE_query_from_private_key (const struct GNUNET_CRYPTO_EcdsaPrivateKey *zone, | 233 | GNUNET_GNSRECORD_query_from_private_key (const struct GNUNET_CRYPTO_EcdsaPrivateKey *zone, |
234 | const char *label, | 234 | const char *label, |
235 | struct GNUNET_HashCode *query) | 235 | struct GNUNET_HashCode *query) |
236 | { | 236 | { |
237 | struct GNUNET_CRYPTO_EcdsaPublicKey pub; | 237 | struct GNUNET_CRYPTO_EcdsaPublicKey pub; |
238 | 238 | ||
239 | GNUNET_CRYPTO_ecdsa_key_get_public (zone, &pub); | 239 | GNUNET_CRYPTO_ecdsa_key_get_public (zone, &pub); |
240 | GNUNET_NAMESTORE_query_from_public_key (&pub, label, query); | 240 | GNUNET_GNSRECORD_query_from_public_key (&pub, label, query); |
241 | } | 241 | } |
242 | 242 | ||
243 | 243 | ||
@@ -249,7 +249,7 @@ GNUNET_NAMESTORE_query_from_private_key (const struct GNUNET_CRYPTO_EcdsaPrivate | |||
249 | * @param query hash to use for the query | 249 | * @param query hash to use for the query |
250 | */ | 250 | */ |
251 | void | 251 | void |
252 | GNUNET_NAMESTORE_query_from_public_key (const struct GNUNET_CRYPTO_EcdsaPublicKey *pub, | 252 | GNUNET_GNSRECORD_query_from_public_key (const struct GNUNET_CRYPTO_EcdsaPublicKey *pub, |
253 | const char *label, | 253 | const char *label, |
254 | struct GNUNET_HashCode *query) | 254 | struct GNUNET_HashCode *query) |
255 | { | 255 | { |
diff --git a/src/gnsrecord/gnsrecord_misc.c b/src/gnsrecord/gnsrecord_misc.c index 7d73af376..aee1f9fd2 100644 --- a/src/gnsrecord/gnsrecord_misc.c +++ b/src/gnsrecord/gnsrecord_misc.c | |||
@@ -43,7 +43,7 @@ | |||
43 | * @return converted result | 43 | * @return converted result |
44 | */ | 44 | */ |
45 | char * | 45 | char * |
46 | GNUNET_NAMESTORE_normalize_string (const char *src) | 46 | GNUNET_GNSRECORD_string_to_lowercase (const char *src) |
47 | { | 47 | { |
48 | GNUNET_assert (NULL != src); | 48 | GNUNET_assert (NULL != src); |
49 | char *res = strdup (src); | 49 | char *res = strdup (src); |
@@ -59,10 +59,10 @@ GNUNET_NAMESTORE_normalize_string (const char *src) | |||
59 | * NOT reentrant! | 59 | * NOT reentrant! |
60 | * | 60 | * |
61 | * @param z the zone key | 61 | * @param z the zone key |
62 | * @return string form; will be overwritten by next call to #GNUNET_NAMESTORE_z2s | 62 | * @return string form; will be overwritten by next call to #GNUNET_GNSRECORD_z2s |
63 | */ | 63 | */ |
64 | const char * | 64 | const char * |
65 | GNUNET_NAMESTORE_z2s (const struct GNUNET_CRYPTO_EcdsaPublicKey *z) | 65 | GNUNET_GNSRECORD_z2s (const struct GNUNET_CRYPTO_EcdsaPublicKey *z) |
66 | { | 66 | { |
67 | static char buf[sizeof (struct GNUNET_CRYPTO_EcdsaPublicKey) * 8]; | 67 | static char buf[sizeof (struct GNUNET_CRYPTO_EcdsaPublicKey) * 8]; |
68 | char *end; | 68 | char *end; |
@@ -90,8 +90,8 @@ GNUNET_NAMESTORE_z2s (const struct GNUNET_CRYPTO_EcdsaPublicKey *z) | |||
90 | * @return #GNUNET_YES if the records are equal or #GNUNET_NO if they are not | 90 | * @return #GNUNET_YES if the records are equal or #GNUNET_NO if they are not |
91 | */ | 91 | */ |
92 | int | 92 | int |
93 | GNUNET_NAMESTORE_records_cmp (const struct GNUNET_NAMESTORE_RecordData *a, | 93 | GNUNET_GNSRECORD_records_cmp (const struct GNUNET_GNSRECORD_Data *a, |
94 | const struct GNUNET_NAMESTORE_RecordData *b) | 94 | const struct GNUNET_GNSRECORD_Data *b) |
95 | { | 95 | { |
96 | LOG (GNUNET_ERROR_TYPE_DEBUG, | 96 | LOG (GNUNET_ERROR_TYPE_DEBUG, |
97 | "Comparing records\n"); | 97 | "Comparing records\n"); |
@@ -110,13 +110,13 @@ GNUNET_NAMESTORE_records_cmp (const struct GNUNET_NAMESTORE_RecordData *a, | |||
110 | b->expiration_time); | 110 | b->expiration_time); |
111 | return GNUNET_NO; | 111 | return GNUNET_NO; |
112 | } | 112 | } |
113 | if ((a->flags & GNUNET_NAMESTORE_RF_RCMP_FLAGS) | 113 | if ((a->flags & GNUNET_GNSRECORD_RF_RCMP_FLAGS) |
114 | != (b->flags & GNUNET_NAMESTORE_RF_RCMP_FLAGS)) | 114 | != (b->flags & GNUNET_GNSRECORD_RF_RCMP_FLAGS)) |
115 | { | 115 | { |
116 | LOG (GNUNET_ERROR_TYPE_DEBUG, | 116 | LOG (GNUNET_ERROR_TYPE_DEBUG, |
117 | "Flags %lu (%lu) != %lu (%lu)\n", a->flags, | 117 | "Flags %lu (%lu) != %lu (%lu)\n", a->flags, |
118 | a->flags & GNUNET_NAMESTORE_RF_RCMP_FLAGS, b->flags, | 118 | a->flags & GNUNET_GNSRECORD_RF_RCMP_FLAGS, b->flags, |
119 | b->flags & GNUNET_NAMESTORE_RF_RCMP_FLAGS); | 119 | b->flags & GNUNET_GNSRECORD_RF_RCMP_FLAGS); |
120 | return GNUNET_NO; | 120 | return GNUNET_NO; |
121 | } | 121 | } |
122 | if (a->data_size != b->data_size) | 122 | if (a->data_size != b->data_size) |
@@ -149,8 +149,8 @@ GNUNET_NAMESTORE_records_cmp (const struct GNUNET_NAMESTORE_RecordData *a, | |||
149 | * @return absolute expiration time | 149 | * @return absolute expiration time |
150 | */ | 150 | */ |
151 | struct GNUNET_TIME_Absolute | 151 | struct GNUNET_TIME_Absolute |
152 | GNUNET_NAMESTORE_record_get_expiration_time (unsigned int rd_count, | 152 | GNUNET_GNSRECORD_record_get_expiration_time (unsigned int rd_count, |
153 | const struct GNUNET_NAMESTORE_RecordData *rd) | 153 | const struct GNUNET_GNSRECORD_Data *rd) |
154 | { | 154 | { |
155 | unsigned int c; | 155 | unsigned int c; |
156 | struct GNUNET_TIME_Absolute expire; | 156 | struct GNUNET_TIME_Absolute expire; |
@@ -162,7 +162,7 @@ GNUNET_NAMESTORE_record_get_expiration_time (unsigned int rd_count, | |||
162 | expire = GNUNET_TIME_UNIT_FOREVER_ABS; | 162 | expire = GNUNET_TIME_UNIT_FOREVER_ABS; |
163 | for (c = 0; c < rd_count; c++) | 163 | for (c = 0; c < rd_count; c++) |
164 | { | 164 | { |
165 | if (0 != (rd[c].flags & GNUNET_NAMESTORE_RF_RELATIVE_EXPIRATION)) | 165 | if (0 != (rd[c].flags & GNUNET_GNSRECORD_RF_RELATIVE_EXPIRATION)) |
166 | { | 166 | { |
167 | rt.rel_value_us = rd[c].expiration_time; | 167 | rt.rel_value_us = rd[c].expiration_time; |
168 | at = GNUNET_TIME_relative_to_absolute (rt); | 168 | at = GNUNET_TIME_relative_to_absolute (rt); |
@@ -188,11 +188,11 @@ GNUNET_NAMESTORE_record_get_expiration_time (unsigned int rd_count, | |||
188 | * #GNUNET_NO if not | 188 | * #GNUNET_NO if not |
189 | */ | 189 | */ |
190 | int | 190 | int |
191 | GNUNET_NAMESTORE_is_expired (const struct GNUNET_NAMESTORE_RecordData *rd) | 191 | GNUNET_GNSRECORD_is_expired (const struct GNUNET_GNSRECORD_Data *rd) |
192 | { | 192 | { |
193 | struct GNUNET_TIME_Absolute at; | 193 | struct GNUNET_TIME_Absolute at; |
194 | 194 | ||
195 | if (0 != (rd->flags & GNUNET_NAMESTORE_RF_RELATIVE_EXPIRATION)) | 195 | if (0 != (rd->flags & GNUNET_GNSRECORD_RF_RELATIVE_EXPIRATION)) |
196 | return GNUNET_NO; | 196 | return GNUNET_NO; |
197 | at.abs_value_us = rd->expiration_time; | 197 | at.abs_value_us = rd->expiration_time; |
198 | return (0 == GNUNET_TIME_absolute_get_remaining (at).rel_value_us) ? GNUNET_YES : GNUNET_NO; | 198 | return (0 == GNUNET_TIME_absolute_get_remaining (at).rel_value_us) ? GNUNET_YES : GNUNET_NO; |
@@ -210,7 +210,7 @@ GNUNET_NAMESTORE_is_expired (const struct GNUNET_NAMESTORE_RecordData *rd) | |||
210 | * key in an encoding suitable for DNS labels. | 210 | * key in an encoding suitable for DNS labels. |
211 | */ | 211 | */ |
212 | const char * | 212 | const char * |
213 | GNUNET_NAMESTORE_pkey_to_zkey (const struct GNUNET_CRYPTO_EcdsaPublicKey *pkey) | 213 | GNUNET_GNSRECORD_pkey_to_zkey (const struct GNUNET_CRYPTO_EcdsaPublicKey *pkey) |
214 | { | 214 | { |
215 | static char ret[128]; | 215 | static char ret[128]; |
216 | char *pkeys; | 216 | char *pkeys; |
@@ -235,7 +235,7 @@ GNUNET_NAMESTORE_pkey_to_zkey (const struct GNUNET_CRYPTO_EcdsaPublicKey *pkey) | |||
235 | * @return #GNUNET_SYSERR if @a zkey has the wrong syntax | 235 | * @return #GNUNET_SYSERR if @a zkey has the wrong syntax |
236 | */ | 236 | */ |
237 | int | 237 | int |
238 | GNUNET_NAMESTORE_zkey_to_pkey (const char *zkey, | 238 | GNUNET_GNSRECORD_zkey_to_pkey (const char *zkey, |
239 | struct GNUNET_CRYPTO_EcdsaPublicKey *pkey) | 239 | struct GNUNET_CRYPTO_EcdsaPublicKey *pkey) |
240 | { | 240 | { |
241 | char *cpy; | 241 | char *cpy; |
diff --git a/src/gnsrecord/gnsrecord_serialization.c b/src/gnsrecord/gnsrecord_serialization.c index 0fd10b3e0..4b54bd366 100644 --- a/src/gnsrecord/gnsrecord_serialization.c +++ b/src/gnsrecord/gnsrecord_serialization.c | |||
@@ -77,12 +77,12 @@ GNUNET_NETWORK_STRUCT_END | |||
77 | * records. | 77 | * records. |
78 | * | 78 | * |
79 | * @param rd_count number of records in the rd array | 79 | * @param rd_count number of records in the rd array |
80 | * @param rd array of #GNUNET_NAMESTORE_RecordData with @a rd_count elements | 80 | * @param rd array of #GNUNET_GNSRECORD_Data with @a rd_count elements |
81 | * @return the required size to serialize | 81 | * @return the required size to serialize |
82 | */ | 82 | */ |
83 | size_t | 83 | size_t |
84 | GNUNET_NAMESTORE_records_get_size (unsigned int rd_count, | 84 | GNUNET_GNSRECORD_records_get_size (unsigned int rd_count, |
85 | const struct GNUNET_NAMESTORE_RecordData *rd) | 85 | const struct GNUNET_GNSRECORD_Data *rd) |
86 | { | 86 | { |
87 | unsigned int i; | 87 | unsigned int i; |
88 | size_t ret; | 88 | size_t ret; |
@@ -101,14 +101,14 @@ GNUNET_NAMESTORE_records_get_size (unsigned int rd_count, | |||
101 | * Serialize the given records to the given destination buffer. | 101 | * Serialize the given records to the given destination buffer. |
102 | * | 102 | * |
103 | * @param rd_count number of records in the rd array | 103 | * @param rd_count number of records in the rd array |
104 | * @param rd array of #GNUNET_NAMESTORE_RecordData with @a rd_count elements | 104 | * @param rd array of #GNUNET_GNSRECORD_Data with @a rd_count elements |
105 | * @param dest_size size of the destination array | 105 | * @param dest_size size of the destination array |
106 | * @param dest where to write the result | 106 | * @param dest where to write the result |
107 | * @return the size of serialized records, -1 if records do not fit | 107 | * @return the size of serialized records, -1 if records do not fit |
108 | */ | 108 | */ |
109 | ssize_t | 109 | ssize_t |
110 | GNUNET_NAMESTORE_records_serialize (unsigned int rd_count, | 110 | GNUNET_GNSRECORD_records_serialize (unsigned int rd_count, |
111 | const struct GNUNET_NAMESTORE_RecordData *rd, | 111 | const struct GNUNET_GNSRECORD_Data *rd, |
112 | size_t dest_size, | 112 | size_t dest_size, |
113 | char *dest) | 113 | char *dest) |
114 | { | 114 | { |
@@ -151,10 +151,10 @@ GNUNET_NAMESTORE_records_serialize (unsigned int rd_count, | |||
151 | * @return #GNUNET_OK on success, #GNUNET_SYSERR on error | 151 | * @return #GNUNET_OK on success, #GNUNET_SYSERR on error |
152 | */ | 152 | */ |
153 | int | 153 | int |
154 | GNUNET_NAMESTORE_records_deserialize (size_t len, | 154 | GNUNET_GNSRECORD_records_deserialize (size_t len, |
155 | const char *src, | 155 | const char *src, |
156 | unsigned int rd_count, | 156 | unsigned int rd_count, |
157 | struct GNUNET_NAMESTORE_RecordData *dest) | 157 | struct GNUNET_GNSRECORD_Data *dest) |
158 | { | 158 | { |
159 | struct NetworkRecord rec; | 159 | struct NetworkRecord rec; |
160 | unsigned int i; | 160 | unsigned int i; |
diff --git a/src/gnsrecord/test_gnsrecord_crypto.c b/src/gnsrecord/test_gnsrecord_crypto.c index 345bf353b..91bafdf21 100644 --- a/src/gnsrecord/test_gnsrecord_crypto.c +++ b/src/gnsrecord/test_gnsrecord_crypto.c | |||
@@ -42,20 +42,20 @@ | |||
42 | 42 | ||
43 | static struct GNUNET_CRYPTO_EcdsaPrivateKey * privkey; | 43 | static struct GNUNET_CRYPTO_EcdsaPrivateKey * privkey; |
44 | 44 | ||
45 | static struct GNUNET_NAMESTORE_RecordData *s_rd; | 45 | static struct GNUNET_GNSRECORD_Data *s_rd; |
46 | 46 | ||
47 | static char *s_name; | 47 | static char *s_name; |
48 | 48 | ||
49 | static int res; | 49 | static int res; |
50 | 50 | ||
51 | 51 | ||
52 | static struct GNUNET_NAMESTORE_RecordData * | 52 | static struct GNUNET_GNSRECORD_Data * |
53 | create_record (int count) | 53 | create_record (int count) |
54 | { | 54 | { |
55 | unsigned int c; | 55 | unsigned int c; |
56 | struct GNUNET_NAMESTORE_RecordData * rd; | 56 | struct GNUNET_GNSRECORD_Data * rd; |
57 | 57 | ||
58 | rd = GNUNET_malloc (count * sizeof (struct GNUNET_NAMESTORE_RecordData)); | 58 | rd = GNUNET_malloc (count * sizeof (struct GNUNET_GNSRECORD_Data)); |
59 | for (c = 0; c < count; c++) | 59 | for (c = 0; c < count; c++) |
60 | { | 60 | { |
61 | rd[c].expiration_time = GNUNET_TIME_absolute_get().abs_value_us; | 61 | rd[c].expiration_time = GNUNET_TIME_absolute_get().abs_value_us; |
@@ -71,7 +71,7 @@ create_record (int count) | |||
71 | static void | 71 | static void |
72 | rd_decrypt_cb (void *cls, | 72 | rd_decrypt_cb (void *cls, |
73 | unsigned int rd_count, | 73 | unsigned int rd_count, |
74 | const struct GNUNET_NAMESTORE_RecordData *rd) | 74 | const struct GNUNET_GNSRECORD_Data *rd) |
75 | { | 75 | { |
76 | char rd_cmp_data[TEST_RECORD_DATALEN]; | 76 | char rd_cmp_data[TEST_RECORD_DATALEN]; |
77 | 77 | ||
@@ -98,7 +98,7 @@ static void | |||
98 | run (void *cls, char *const *args, const char *cfgfile, | 98 | run (void *cls, char *const *args, const char *cfgfile, |
99 | const struct GNUNET_CONFIGURATION_Handle *cfg) | 99 | const struct GNUNET_CONFIGURATION_Handle *cfg) |
100 | { | 100 | { |
101 | struct GNUNET_NAMESTORE_Block *block; | 101 | struct GNUNET_GNSRECORD_Block *block; |
102 | struct GNUNET_CRYPTO_EcdsaPublicKey pubkey; | 102 | struct GNUNET_CRYPTO_EcdsaPublicKey pubkey; |
103 | 103 | ||
104 | /* load privat key */ | 104 | /* load privat key */ |
@@ -118,9 +118,9 @@ run (void *cls, char *const *args, const char *cfgfile, | |||
118 | s_rd = create_record (RECORDS); | 118 | s_rd = create_record (RECORDS); |
119 | 119 | ||
120 | /* Create block */ | 120 | /* Create block */ |
121 | GNUNET_assert (NULL != (block = GNUNET_NAMESTORE_block_create (privkey, expire,s_name, s_rd, RECORDS))); | 121 | GNUNET_assert (NULL != (block = GNUNET_GNSRECORD_block_create (privkey, expire,s_name, s_rd, RECORDS))); |
122 | GNUNET_assert (GNUNET_OK == GNUNET_NAMESTORE_block_verify (block)); | 122 | GNUNET_assert (GNUNET_OK == GNUNET_GNSRECORD_block_verify (block)); |
123 | GNUNET_assert (GNUNET_OK == GNUNET_NAMESTORE_block_decrypt (block, &pubkey, s_name, &rd_decrypt_cb, s_name)); | 123 | GNUNET_assert (GNUNET_OK == GNUNET_GNSRECORD_block_decrypt (block, &pubkey, s_name, &rd_decrypt_cb, s_name)); |
124 | 124 | ||
125 | GNUNET_free (block); | 125 | GNUNET_free (block); |
126 | } | 126 | } |
diff --git a/src/gnsrecord/test_gnsrecord_serialization.c b/src/gnsrecord/test_gnsrecord_serialization.c index de6a7ba1d..7ef2f1559 100644 --- a/src/gnsrecord/test_gnsrecord_serialization.c +++ b/src/gnsrecord/test_gnsrecord_serialization.c | |||
@@ -39,9 +39,9 @@ run (void *cls, char *const *args, const char *cfgfile, | |||
39 | 39 | ||
40 | int rd_count = 3; | 40 | int rd_count = 3; |
41 | size_t data_len; | 41 | size_t data_len; |
42 | struct GNUNET_NAMESTORE_RecordData src[rd_count]; | 42 | struct GNUNET_GNSRECORD_Data src[rd_count]; |
43 | 43 | ||
44 | memset(src, '\0', rd_count * sizeof (struct GNUNET_NAMESTORE_RecordData)); | 44 | memset(src, '\0', rd_count * sizeof (struct GNUNET_GNSRECORD_Data)); |
45 | 45 | ||
46 | data_len = 0; | 46 | data_len = 0; |
47 | for (c = 0; c < rd_count; c++) | 47 | for (c = 0; c < rd_count; c++) |
@@ -56,16 +56,16 @@ run (void *cls, char *const *args, const char *cfgfile, | |||
56 | } | 56 | } |
57 | res = 0; | 57 | res = 0; |
58 | 58 | ||
59 | len = GNUNET_NAMESTORE_records_get_size(rd_count, src); | 59 | len = GNUNET_GNSRECORD_records_get_size(rd_count, src); |
60 | char rd_ser[len]; | 60 | char rd_ser[len]; |
61 | GNUNET_assert (len == GNUNET_NAMESTORE_records_serialize(rd_count, src, len, rd_ser)); | 61 | GNUNET_assert (len == GNUNET_GNSRECORD_records_serialize(rd_count, src, len, rd_ser)); |
62 | 62 | ||
63 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Serialized data len: %u\n",len); | 63 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Serialized data len: %u\n",len); |
64 | 64 | ||
65 | GNUNET_assert (rd_ser != NULL); | 65 | GNUNET_assert (rd_ser != NULL); |
66 | 66 | ||
67 | struct GNUNET_NAMESTORE_RecordData dst[rd_count]; | 67 | struct GNUNET_GNSRECORD_Data dst[rd_count]; |
68 | GNUNET_assert (GNUNET_OK == GNUNET_NAMESTORE_records_deserialize (len, rd_ser, rd_count, dst)); | 68 | GNUNET_assert (GNUNET_OK == GNUNET_GNSRECORD_records_deserialize (len, rd_ser, rd_count, dst)); |
69 | 69 | ||
70 | GNUNET_assert (dst != NULL); | 70 | GNUNET_assert (dst != NULL); |
71 | 71 | ||