aboutsummaryrefslogtreecommitdiff
path: root/src/namestore/namestore.h
diff options
context:
space:
mode:
authorMatthias Wachs <wachs@net.in.tum.de>2012-03-06 12:32:16 +0000
committerMatthias Wachs <wachs@net.in.tum.de>2012-03-06 12:32:16 +0000
commit10b2ef580e79924e9117e1654dd9d58b23d618e2 (patch)
tree3fd102121a0171764118cddae2796bee74da80c3 /src/namestore/namestore.h
parentb45ab93426129c5b4460067a6fac06abf536b461 (diff)
downloadgnunet-10b2ef580e79924e9117e1654dd9d58b23d618e2.tar.gz
gnunet-10b2ef580e79924e9117e1654dd9d58b23d618e2.zip
- step 1) compiles again
Diffstat (limited to 'src/namestore/namestore.h')
-rw-r--r--src/namestore/namestore.h131
1 files changed, 84 insertions, 47 deletions
diff --git a/src/namestore/namestore.h b/src/namestore/namestore.h
index 17229ab24..5b4c02385 100644
--- a/src/namestore/namestore.h
+++ b/src/namestore/namestore.h
@@ -47,7 +47,7 @@
47#define GNUNET_MESSAGE_TYPE_NAMESTORE_DISCONNECT 449 47#define GNUNET_MESSAGE_TYPE_NAMESTORE_DISCONNECT 449
48 48
49/** 49/**
50 * Sign name and records 50 * Create a signature based on name and records
51 * 51 *
52 * @param key the private key 52 * @param key the private key
53 * @param name the name 53 * @param name the name
@@ -57,13 +57,16 @@
57 * @return the signature 57 * @return the signature
58 */ 58 */
59struct GNUNET_CRYPTO_RsaSignature * 59struct GNUNET_CRYPTO_RsaSignature *
60GNUNET_NAMESTORE_create_signature (const struct GNUNET_CRYPTO_RsaPrivateKey *key, const char *name, struct GNUNET_NAMESTORE_RecordData *rd, unsigned int rd_count); 60GNUNET_NAMESTORE_create_signature (const struct GNUNET_CRYPTO_RsaPrivateKey *key,
61 const char *name,
62 const struct GNUNET_NAMESTORE_RecordData *rd,
63 unsigned int rd_count);
61 64
62/** 65/**
63 * Compares if two records are equal 66 * Compares if two records are equal
64 * 67 *
65 * @param a record 68 * @param a Record a
66 * @param b record 69 * @param b Record b
67 * 70 *
68 * @return GNUNET_YES or GNUNET_NO 71 * @return GNUNET_YES or GNUNET_NO
69 */ 72 */
@@ -71,10 +74,12 @@ int
71GNUNET_NAMESTORE_records_cmp (const struct GNUNET_NAMESTORE_RecordData *a, 74GNUNET_NAMESTORE_records_cmp (const struct GNUNET_NAMESTORE_RecordData *a,
72 const struct GNUNET_NAMESTORE_RecordData *b); 75 const struct GNUNET_NAMESTORE_RecordData *b);
73 76
77
74GNUNET_NETWORK_STRUCT_BEGIN 78GNUNET_NETWORK_STRUCT_BEGIN
75/** 79/**
76 * A GNS record serialized for network transmission. 80 * A GNS record serialized for network transmission.
77 * layout is [struct GNUNET_NAMESTORE_NetworkRecord][char[data_size] data] 81 *
82 * Layout is [struct GNUNET_NAMESTORE_NetworkRecord][char[data_size] data]
78 */ 83 */
79struct GNUNET_NAMESTORE_NetworkRecord 84struct GNUNET_NAMESTORE_NetworkRecord
80{ 85{
@@ -114,24 +119,6 @@ struct StartMessage
114 119
115}; 120};
116 121
117/**
118 * Connect to namestore service. FIXME: UNNECESSARY.
119 */
120struct DisconnectMessage
121{
122
123 /**
124 * Type will be GNUNET_MESSAGE_TYPE_NAMESTORE_DISCONNECT
125 */
126 struct GNUNET_MessageHeader header;
127
128 /**
129 * Drop namestore?
130 * GNUNET_YES or _NO in NBO
131 */
132 uint32_t drop;
133};
134
135 122
136/** 123/**
137 * Generic namestore message with op id 124 * Generic namestore message with op id
@@ -152,7 +139,7 @@ struct GNUNET_NAMESTORE_Header
152 139
153 140
154/** 141/**
155 * Connect to namestore service 142 * Lookup a name in the namestore
156 */ 143 */
157struct LookupNameMessage 144struct LookupNameMessage
158{ 145{
@@ -179,8 +166,6 @@ struct LookupNameMessage
179 166
180/** 167/**
181 * Lookup response 168 * Lookup response
182 * Memory layout:
183 * [struct LookupNameResponseMessage][char *name][rc_count * struct GNUNET_NAMESTORE_RecordData]
184 */ 169 */
185struct LookupNameResponseMessage 170struct LookupNameResponseMessage
186{ 171{
@@ -189,14 +174,31 @@ struct LookupNameResponseMessage
189 */ 174 */
190 struct GNUNET_NAMESTORE_Header gns_header; 175 struct GNUNET_NAMESTORE_Header gns_header;
191 176
177 /**
178 * Expiration time
179 */
192 struct GNUNET_TIME_AbsoluteNBO expire; 180 struct GNUNET_TIME_AbsoluteNBO expire;
193 181
182
183 /**
184 * Name length
185 */
194 uint16_t name_len; 186 uint16_t name_len;
195 187
188 /**
189 * Bytes of serialized record data
190 */
196 uint16_t rd_len; 191 uint16_t rd_len;
197 192
193 /**
194 * Number of records contained
195 */
198 uint16_t rd_count; 196 uint16_t rd_count;
199 197
198 /**
199 * Is the signature valid
200 * GNUNET_YES or GNUNET_NO
201 */
200 int16_t contains_sig; 202 int16_t contains_sig;
201 203
202 /** 204 /**
@@ -205,18 +207,17 @@ struct LookupNameResponseMessage
205 struct GNUNET_CRYPTO_RsaSignature signature; 207 struct GNUNET_CRYPTO_RsaSignature signature;
206 208
207 /** 209 /**
208 * 210 * The public key for the name
209 */ 211 */
210 struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded public_key; 212 struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded public_key;
211 213
212 /* 0-terminated name and serialized record data */ 214 /* 0-terminated name and serialized record data */
215 /* rd_len bytes serialized record data */
213}; 216};
214 217
215 218
216/** 219/**
217 * Put a record to the namestore 220 * Put a record to the namestore
218 * Memory layout:
219 * [struct RecordPutMessage][char *name][rc_count * struct GNUNET_NAMESTORE_RecordData]
220 */ 221 */
221struct RecordPutMessage 222struct RecordPutMessage
222{ 223{
@@ -226,17 +227,17 @@ struct RecordPutMessage
226 struct GNUNET_NAMESTORE_Header gns_header; 227 struct GNUNET_NAMESTORE_Header gns_header;
227 228
228 /** 229 /**
229 * 230 * Expiration time
230 */ 231 */
231 struct GNUNET_TIME_AbsoluteNBO expire; 232 struct GNUNET_TIME_AbsoluteNBO expire;
232 233
233 /** 234 /**
234 * name length 235 * Name length
235 */ 236 */
236 uint16_t name_len; 237 uint16_t name_len;
237 238
238 /** 239 /**
239 * Length of serialized rd data 240 * Length of serialized record data
240 */ 241 */
241 uint16_t rd_len; 242 uint16_t rd_len;
242 243
@@ -251,12 +252,12 @@ struct RecordPutMessage
251 uint16_t reserved; 252 uint16_t reserved;
252 253
253 /** 254 /**
254 * 255 * The signature
255 */ 256 */
256 struct GNUNET_CRYPTO_RsaSignature signature; 257 struct GNUNET_CRYPTO_RsaSignature signature;
257 258
258 /** 259 /**
259 * 260 * The public key
260 */ 261 */
261 struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded public_key; 262 struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded public_key;
262 263
@@ -297,12 +298,12 @@ struct RecordCreateMessage
297 struct GNUNET_TIME_AbsoluteNBO expire; 298 struct GNUNET_TIME_AbsoluteNBO expire;
298 299
299 /** 300 /**
300 * name length 301 * Name length
301 */ 302 */
302 uint16_t name_len; 303 uint16_t name_len;
303 304
304 /** 305 /**
305 * Record data length 306 * Length of serialized record data
306 */ 307 */
307 uint16_t rd_len; 308 uint16_t rd_len;
308 309
@@ -316,13 +317,16 @@ struct RecordCreateMessage
316 */ 317 */
317 uint16_t pkey_len; 318 uint16_t pkey_len;
318 319
319 /* followed by: name and serialized record data --- PK??? */ 320 /* followed by:
321 * GNUNET_CRYPTO_RsaPrivateKeyBinaryEncoded private key with length pkey_len
322 * name with length name_len
323 * serialized record data with length rd_len
324 * */
320}; 325};
321 326
322 327
323/** 328/**
324 * Create a record to the namestore response 329 * Create a record to the namestore response
325 * Memory layout:
326 */ 330 */
327struct RecordCreateResponseMessage 331struct RecordCreateResponseMessage
328{ 332{
@@ -335,14 +339,12 @@ struct RecordCreateResponseMessage
335 * name length: GNUNET_NO already exists, GNUNET_YES on success, GNUNET_SYSERR error 339 * name length: GNUNET_NO already exists, GNUNET_YES on success, GNUNET_SYSERR error
336 */ 340 */
337 int32_t op_result; 341 int32_t op_result;
338
339}; 342};
340 343
341 344
342/** 345/**
343 * Remove a record from the namestore 346 * Remove a record from the namestore
344 * Memory layout: 347 * Memory layout:
345 * [struct RecordRemoveMessage][char *name][struct GNUNET_NAMESTORE_RecordData]
346 */ 348 */
347struct RecordRemoveMessage 349struct RecordRemoveMessage
348{ 350{
@@ -367,9 +369,15 @@ struct RecordRemoveMessage
367 uint16_t rd_count; 369 uint16_t rd_count;
368 370
369 /** 371 /**
370 * Length of pubkey 372 * Length of private key
371 */ 373 */
372 uint16_t key_len; 374 uint16_t pkey_len;
375
376 /* followed by:
377 * GNUNET_CRYPTO_RsaPrivateKeyBinaryEncoded private key with length pkey_len
378 * name with length name_len
379 * serialized record data with length rd_len
380 * */
373}; 381};
374 382
375 383
@@ -396,10 +404,13 @@ struct RecordRemoveResponseMessage
396 404
397 405
398/** 406/**
399 * Connect to namestore service 407 * Lookup a name for a zone hash
400 */ 408 */
401struct ZoneToNameMessage 409struct ZoneToNameMessage
402{ 410{
411 /**
412 * Type will be GNUNET_MESSAGE_TYPE_NAMESTORE_ZONE_TO_NAME
413 */
403 struct GNUNET_NAMESTORE_Header gns_header; 414 struct GNUNET_NAMESTORE_Header gns_header;
404 415
405 /** 416 /**
@@ -414,28 +425,46 @@ struct ZoneToNameMessage
414}; 425};
415 426
416/** 427/**
417 * Connect to namestore service 428 * Respone for zone to name lookup
418 */ 429 */
419struct ZoneToNameResponseMessage 430struct ZoneToNameResponseMessage
420{ 431{
432 /**
433 * Type will be GNUNET_MESSAGE_TYPE_NAMESTORE_ZONE_TO_NAME_RESPONSE
434 */
421 struct GNUNET_NAMESTORE_Header gns_header; 435 struct GNUNET_NAMESTORE_Header gns_header;
422 436
437 /**
438 * Record block expiration
439 */
423 struct GNUNET_TIME_AbsoluteNBO expire; 440 struct GNUNET_TIME_AbsoluteNBO expire;
424 441
442 /**
443 * Length of the name
444 */
425 uint16_t name_len; 445 uint16_t name_len;
426 446
447 /**
448 * Length of serialized record data
449 */
427 uint16_t rd_len; 450 uint16_t rd_len;
428 451
452 /**
453 * Number of records contained
454 */
429 uint16_t rd_count; 455 uint16_t rd_count;
430 456
431 /* result in NBO: GNUNET_OK on success, GNUNET_NO if there were no results, GNUNET_SYSERR on error */ 457 /* result in NBO: GNUNET_OK on success, GNUNET_NO if there were no results, GNUNET_SYSERR on error */
432 int16_t res; 458 int16_t res;
433 459
434 /** 460 /**
435 * 461 * Signature
436 */ 462 */
437 struct GNUNET_CRYPTO_RsaSignature signature; 463 struct GNUNET_CRYPTO_RsaSignature signature;
438 464
465 /**
466 * Publik key
467 */
439 struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded zone_key; 468 struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded zone_key;
440 469
441}; 470};
@@ -452,12 +481,20 @@ struct ZoneIterationStartMessage
452 */ 481 */
453 struct GNUNET_NAMESTORE_Header gns_header; 482 struct GNUNET_NAMESTORE_Header gns_header;
454 483
484 /**
485 * Zone hash
486 */
455 GNUNET_HashCode zone; 487 GNUNET_HashCode zone;
456 488
489 /**
490 * Which flags must be included
491 */
457 uint16_t must_have_flags; 492 uint16_t must_have_flags;
458 493
494 /**
495 * Which flags must not be included
496 */
459 uint16_t must_not_have_flags; 497 uint16_t must_not_have_flags;
460
461}; 498};
462 499
463 500
@@ -519,7 +556,7 @@ struct ZoneIterationResponseMessage
519 struct GNUNET_CRYPTO_RsaSignature signature; 556 struct GNUNET_CRYPTO_RsaSignature signature;
520 557
521 /** 558 /**
522 * 559 * The public key
523 */ 560 */
524 struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded public_key; 561 struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded public_key;
525 562