diff options
author | Christian Grothoff <christian@grothoff.org> | 2010-10-06 12:55:38 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2010-10-06 12:55:38 +0000 |
commit | 2ffb6f329c85b24367199f910f6603950e1fba68 (patch) | |
tree | 537e401b59e3f7c435d5d8369ba3088e1679743b /src/include | |
parent | b8da6057b2c0c66931ccde9b4bba418fc5222724 (diff) | |
download | gnunet-2ffb6f329c85b24367199f910f6603950e1fba68.tar.gz gnunet-2ffb6f329c85b24367199f910f6603950e1fba68.zip |
DHT PUT integration into FS
Diffstat (limited to 'src/include')
-rw-r--r-- | src/include/gnunet_block_lib.h | 13 | ||||
-rw-r--r-- | src/include/gnunet_datastore_service.h | 27 | ||||
-rw-r--r-- | src/include/gnunet_dht_service.h | 5 | ||||
-rw-r--r-- | src/include/gnunet_protocols.h | 13 |
4 files changed, 48 insertions, 10 deletions
diff --git a/src/include/gnunet_block_lib.h b/src/include/gnunet_block_lib.h index 15119f445..d05cab2b6 100644 --- a/src/include/gnunet_block_lib.h +++ b/src/include/gnunet_block_lib.h | |||
@@ -58,7 +58,8 @@ enum GNUNET_BLOCK_Type | |||
58 | GNUNET_BLOCK_TYPE_FS_IBLOCK = 2, | 58 | GNUNET_BLOCK_TYPE_FS_IBLOCK = 2, |
59 | 59 | ||
60 | /** | 60 | /** |
61 | * Type of a block representing a keyword search result. | 61 | * Type of a block representing a keyword search result. Note that |
62 | * the values for KBLOCK, SBLOCK and NBLOCK must be consecutive. | ||
62 | */ | 63 | */ |
63 | GNUNET_BLOCK_TYPE_FS_KBLOCK = 3, | 64 | GNUNET_BLOCK_TYPE_FS_KBLOCK = 3, |
64 | 65 | ||
@@ -68,15 +69,15 @@ enum GNUNET_BLOCK_Type | |||
68 | GNUNET_BLOCK_TYPE_FS_SBLOCK = 4, | 69 | GNUNET_BLOCK_TYPE_FS_SBLOCK = 4, |
69 | 70 | ||
70 | /** | 71 | /** |
71 | * Type of a block representing a block to be encoded on demand from disk. | 72 | * Type of a block that is used to advertise a namespace. |
72 | * Should never appear on the network directly. | ||
73 | */ | 73 | */ |
74 | GNUNET_BLOCK_TYPE_FS_ONDEMAND = 5, | 74 | GNUNET_BLOCK_TYPE_FS_NBLOCK = 5, |
75 | 75 | ||
76 | /** | 76 | /** |
77 | * Type of a block that is used to advertise a namespace. | 77 | * Type of a block representing a block to be encoded on demand from disk. |
78 | * Should never appear on the network directly. | ||
78 | */ | 79 | */ |
79 | GNUNET_BLOCK_TYPE_FS_NBLOCK = 6, | 80 | GNUNET_BLOCK_TYPE_FS_ONDEMAND = 6, |
80 | 81 | ||
81 | /** | 82 | /** |
82 | * Type of a block that contains a HELLO for a peer (for | 83 | * Type of a block that contains a HELLO for a peer (for |
diff --git a/src/include/gnunet_datastore_service.h b/src/include/gnunet_datastore_service.h index c41d21058..8d35f7900 100644 --- a/src/include/gnunet_datastore_service.h +++ b/src/include/gnunet_datastore_service.h | |||
@@ -355,6 +355,33 @@ GNUNET_DATASTORE_get_random (struct GNUNET_DATASTORE_Handle *h, | |||
355 | 355 | ||
356 | 356 | ||
357 | /** | 357 | /** |
358 | * Get a zero-anonymity value from the datastore. | ||
359 | * | ||
360 | * @param h handle to the datastore | ||
361 | * @param queue_priority ranking of this request in the priority queue | ||
362 | * @param max_queue_size at what queue size should this request be dropped | ||
363 | * (if other requests of higher priority are in the queue) | ||
364 | * @param timeout how long to wait at most for a response | ||
365 | * @param type allowed type for the operation | ||
366 | * @param iter function to call on a random value; it | ||
367 | * will be called once with a value (if available) | ||
368 | * and always once with a value of NULL. | ||
369 | * @param iter_cls closure for iter | ||
370 | * @return NULL if the entry was not queued, otherwise a handle that can be used to | ||
371 | * cancel; note that even if NULL is returned, the callback will be invoked | ||
372 | * (or rather, will already have been invoked) | ||
373 | */ | ||
374 | struct GNUNET_DATASTORE_QueueEntry * | ||
375 | GNUNET_DATASTORE_get_zero_anonymity (struct GNUNET_DATASTORE_Handle *h, | ||
376 | unsigned int queue_priority, | ||
377 | unsigned int max_queue_size, | ||
378 | struct GNUNET_TIME_Relative timeout, | ||
379 | enum GNUNET_BLOCK_Type type, | ||
380 | GNUNET_DATASTORE_Iterator iter, | ||
381 | void *iter_cls); | ||
382 | |||
383 | |||
384 | /** | ||
358 | * Cancel a datastore operation. The final callback from the | 385 | * Cancel a datastore operation. The final callback from the |
359 | * operation must not have been done yet. | 386 | * operation must not have been done yet. |
360 | * | 387 | * |
diff --git a/src/include/gnunet_dht_service.h b/src/include/gnunet_dht_service.h index 9ad4cc809..b3bf2b84b 100644 --- a/src/include/gnunet_dht_service.h +++ b/src/include/gnunet_dht_service.h | |||
@@ -41,6 +41,11 @@ extern "C" | |||
41 | 41 | ||
42 | 42 | ||
43 | /** | 43 | /** |
44 | * FIXME: document. | ||
45 | */ | ||
46 | #define GNUNET_DHT_DEFAULT_REPUBLISH_FREQUENCY GNUNET_TIME_relative_multiply(GNUNET_TIME_UNIT_MINUTES, 60) | ||
47 | |||
48 | /** | ||
44 | * K-value that must be used for the bloom filter 'GET' | 49 | * K-value that must be used for the bloom filter 'GET' |
45 | * queries. | 50 | * queries. |
46 | */ | 51 | */ |
diff --git a/src/include/gnunet_protocols.h b/src/include/gnunet_protocols.h index 3de18f8d1..bf696c743 100644 --- a/src/include/gnunet_protocols.h +++ b/src/include/gnunet_protocols.h | |||
@@ -434,27 +434,32 @@ extern "C" | |||
434 | #define GNUNET_MESSAGE_TYPE_DATASTORE_GET_RANDOM 98 | 434 | #define GNUNET_MESSAGE_TYPE_DATASTORE_GET_RANDOM 98 |
435 | 435 | ||
436 | /** | 436 | /** |
437 | * Message sent by datastore client to get random data. | ||
438 | */ | ||
439 | #define GNUNET_MESSAGE_TYPE_DATASTORE_GET_ZERO_ANONYMITY 99 | ||
440 | |||
441 | /** | ||
437 | * Message sent by datastore to client providing requested data | 442 | * Message sent by datastore to client providing requested data |
438 | * (in response to GET or GET_RANDOM request). | 443 | * (in response to GET or GET_RANDOM request). |
439 | */ | 444 | */ |
440 | #define GNUNET_MESSAGE_TYPE_DATASTORE_DATA 99 | 445 | #define GNUNET_MESSAGE_TYPE_DATASTORE_DATA 100 |
441 | 446 | ||
442 | /** | 447 | /** |
443 | * Message sent by datastore to client signaling end of matching data. | 448 | * Message sent by datastore to client signaling end of matching data. |
444 | * This message will also be sent for "GET_RANDOM", even though | 449 | * This message will also be sent for "GET_RANDOM", even though |
445 | * "GET_RANDOM" returns at most one data item. | 450 | * "GET_RANDOM" returns at most one data item. |
446 | */ | 451 | */ |
447 | #define GNUNET_MESSAGE_TYPE_DATASTORE_DATA_END 100 | 452 | #define GNUNET_MESSAGE_TYPE_DATASTORE_DATA_END 101 |
448 | 453 | ||
449 | /** | 454 | /** |
450 | * Message sent by datastore client to remove data. | 455 | * Message sent by datastore client to remove data. |
451 | */ | 456 | */ |
452 | #define GNUNET_MESSAGE_TYPE_DATASTORE_REMOVE 101 | 457 | #define GNUNET_MESSAGE_TYPE_DATASTORE_REMOVE 102 |
453 | 458 | ||
454 | /** | 459 | /** |
455 | * Message sent by datastore client to drop the database. | 460 | * Message sent by datastore client to drop the database. |
456 | */ | 461 | */ |
457 | #define GNUNET_MESSAGE_TYPE_DATASTORE_DROP 102 | 462 | #define GNUNET_MESSAGE_TYPE_DATASTORE_DROP 103 |
458 | 463 | ||
459 | 464 | ||
460 | /** | 465 | /** |