aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--contrib/defaults.conf2
-rw-r--r--doc/man/gnunet-pseudonym.16
-rw-r--r--doc/man/gnunet-publish.14
-rw-r--r--src/datastore/datastore_api.c20
-rw-r--r--src/datastore/perf_datastore_api.c12
-rw-r--r--src/datastore/test_datastore_api.c5
-rw-r--r--src/datastore/test_datastore_api_management.c3
-rw-r--r--src/fs/fs.c30
-rw-r--r--src/fs/fs.h14
-rw-r--r--src/fs/fs_file_information.c131
-rw-r--r--src/fs/fs_namespace.c48
-rw-r--r--src/fs/fs_publish.c82
-rw-r--r--src/fs/fs_test_lib.c17
-rw-r--r--src/fs/gnunet-pseudonym.c25
-rw-r--r--src/fs/gnunet-publish.c39
-rw-r--r--src/fs/gnunet-service-fs.c10
-rw-r--r--src/fs/gnunet-service-fs_new.c2
-rw-r--r--src/fs/gnunet-service-fs_pr.c2
-rw-r--r--src/fs/gnunet-service-fs_push.c8
-rw-r--r--src/fs/test_fs_download.c9
-rw-r--r--src/fs/test_fs_download_indexed.c9
-rw-r--r--src/fs/test_fs_download_persistence.c9
-rw-r--r--src/fs/test_fs_file_information.c23
-rw-r--r--src/fs/test_fs_list_indexed.c19
-rw-r--r--src/fs/test_fs_namespace.c30
-rw-r--r--src/fs/test_fs_namespace_list_updateable.c16
-rw-r--r--src/fs/test_fs_publish.c21
-rw-r--r--src/fs/test_fs_publish_persistence.c19
-rw-r--r--src/fs/test_fs_search.c9
-rw-r--r--src/fs/test_fs_search_persistence.c9
-rw-r--r--src/fs/test_fs_unindex.c9
-rw-r--r--src/fs/test_fs_unindex_persistence.c9
-rw-r--r--src/include/gnunet_datastore_service.h26
-rw-r--r--src/include/gnunet_fs_service.h146
34 files changed, 368 insertions, 455 deletions
diff --git a/contrib/defaults.conf b/contrib/defaults.conf
index f0ee4e3e0..fe98f1d18 100644
--- a/contrib/defaults.conf
+++ b/contrib/defaults.conf
@@ -295,7 +295,7 @@ PORT = 2094
295HOSTNAME = localhost 295HOSTNAME = localhost
296HOME = $SERVICEHOME 296HOME = $SERVICEHOME
297CONFIG = $DEFAULTCONFIG 297CONFIG = $DEFAULTCONFIG
298BINARY = gnunet-service-fs 298BINARY = gnunet-service-fs-new
299ACCEPT_FROM = 127.0.0.1; 299ACCEPT_FROM = 127.0.0.1;
300ACCEPT_FROM6 = ::1; 300ACCEPT_FROM6 = ::1;
301 301
diff --git a/doc/man/gnunet-pseudonym.1 b/doc/man/gnunet-pseudonym.1
index 30e7c4145..5d3c41b62 100644
--- a/doc/man/gnunet-pseudonym.1
+++ b/doc/man/gnunet-pseudonym.1
@@ -55,7 +55,11 @@ Set the priority of the namespace advertisement (default: 365). If the local da
55Do not print the list of pseudonyms (only perform create or delete operation). 55Do not print the list of pseudonyms (only perform create or delete operation).
56 56
57.TP 57.TP
58\fB\-r IDENTIFIER\fR, \fB\-\-root=IDENTIFIER\fR 58\fB\-r \fILEVEL\fR, \fB\-\-replication=\fILEVEL\fR
59Set the desired replication level. If CONTENT_PUSHING is set to YES, GNUnet will push each block (for the file) LEVEL times to other peers before doing nomral "random" replication of all content. This option can be used to push some content out into the network harder. Note that pushing content LEVEL times into the network does not guarantee that there will actually be LEVEL replicas.
60
61.TP
62\fB\-R IDENTIFIER\fR, \fB\-\-root=IDENTIFIER\fR
59Specify the identifier for the root of the namespace. Used in the namespace advertisement to tell users that find the namespace advertisement about an entry\-point into the namespace (use with \-C). Advertisements are only created if "\-C" and "\-r" are specified. 63Specify the identifier for the root of the namespace. Used in the namespace advertisement to tell users that find the namespace advertisement about an entry\-point into the namespace (use with \-C). Advertisements are only created if "\-C" and "\-r" are specified.
60 64
61.TP 65.TP
diff --git a/doc/man/gnunet-publish.1 b/doc/man/gnunet-publish.1
index df2059629..22bd4ae74 100644
--- a/doc/man/gnunet-publish.1
+++ b/doc/man/gnunet-publish.1
@@ -78,6 +78,10 @@ Set the priority of the published content (default: 365). If the local database
78For the top\-level directory or file, create an SBlock that places the file into the namespace specified by the pseudonym NAME. 78For the top\-level directory or file, create an SBlock that places the file into the namespace specified by the pseudonym NAME.
79 79
80.TP 80.TP
81\fB\-r \fILEVEL\fR, \fB\-\-replication=\fILEVEL\fR
82Set the desired replication level. If CONTENT_PUSHING is set to YES, GNUnet will push each block (for the file) LEVEL times to other peers before doing nomral "random" replication of all content. This option can be used to push some content out into the network harder. Note that pushing content LEVEL times into the network does not guarantee that there will actually be LEVEL replicas.
83
84.TP
81\fB\-s\fR, \fB\-\-simulate-only\fR 85\fB\-s\fR, \fB\-\-simulate-only\fR
82When this option is used, gnunet\-publish will not actually publish the file but just simulate what would be done. This can be used to compute the GNUnet URI for a file without actually sharing it. 86When this option is used, gnunet\-publish will not actually publish the file but just simulate what would be done. This can be used to compute the GNUnet URI for a file without actually sharing it.
83 87
diff --git a/src/datastore/datastore_api.c b/src/datastore/datastore_api.c
index cf6a2cc8e..344a70842 100644
--- a/src/datastore/datastore_api.c
+++ b/src/datastore/datastore_api.c
@@ -792,6 +792,7 @@ process_status_message (void *cls,
792 * @param type type of the content 792 * @param type type of the content
793 * @param priority priority of the content 793 * @param priority priority of the content
794 * @param anonymity anonymity-level for the content 794 * @param anonymity anonymity-level for the content
795 * @param replication how often should the content be replicated to other peers?
795 * @param expiration expiration time for the content 796 * @param expiration expiration time for the content
796 * @param queue_priority ranking of this request in the priority queue 797 * @param queue_priority ranking of this request in the priority queue
797 * @param max_queue_size at what queue size should this request be dropped 798 * @param max_queue_size at what queue size should this request be dropped
@@ -812,6 +813,7 @@ GNUNET_DATASTORE_put (struct GNUNET_DATASTORE_Handle *h,
812 enum GNUNET_BLOCK_Type type, 813 enum GNUNET_BLOCK_Type type,
813 uint32_t priority, 814 uint32_t priority,
814 uint32_t anonymity, 815 uint32_t anonymity,
816 uint32_t replication,
815 struct GNUNET_TIME_Absolute expiration, 817 struct GNUNET_TIME_Absolute expiration,
816 unsigned int queue_priority, 818 unsigned int queue_priority,
817 unsigned int max_queue_size, 819 unsigned int max_queue_size,
@@ -1274,7 +1276,11 @@ process_result_message (void *cls,
1274 1276
1275 1277
1276/** 1278/**
1277 * Get a random value from the datastore. 1279 * Get a random value from the datastore for content replication.
1280 * Returns a single, random value among those with the highest
1281 * replication score, lowering positive replication scores by one for
1282 * the chosen value (if only content with a replication score exists,
1283 * a random value is returned and replication scores are not changed).
1278 * 1284 *
1279 * @param h handle to the datastore 1285 * @param h handle to the datastore
1280 * @param queue_priority ranking of this request in the priority queue 1286 * @param queue_priority ranking of this request in the priority queue
@@ -1290,12 +1296,12 @@ process_result_message (void *cls,
1290 * (or rather, will already have been invoked) 1296 * (or rather, will already have been invoked)
1291 */ 1297 */
1292struct GNUNET_DATASTORE_QueueEntry * 1298struct GNUNET_DATASTORE_QueueEntry *
1293GNUNET_DATASTORE_get_random (struct GNUNET_DATASTORE_Handle *h, 1299GNUNET_DATASTORE_get_for_replication (struct GNUNET_DATASTORE_Handle *h,
1294 unsigned int queue_priority, 1300 unsigned int queue_priority,
1295 unsigned int max_queue_size, 1301 unsigned int max_queue_size,
1296 struct GNUNET_TIME_Relative timeout, 1302 struct GNUNET_TIME_Relative timeout,
1297 GNUNET_DATASTORE_Iterator iter, 1303 GNUNET_DATASTORE_Iterator iter,
1298 void *iter_cls) 1304 void *iter_cls)
1299{ 1305{
1300 struct GNUNET_DATASTORE_QueueEntry *qe; 1306 struct GNUNET_DATASTORE_QueueEntry *qe;
1301 struct GNUNET_MessageHeader *m; 1307 struct GNUNET_MessageHeader *m;
diff --git a/src/datastore/perf_datastore_api.c b/src/datastore/perf_datastore_api.c
index de9a8b236..00d91b4c7 100644
--- a/src/datastore/perf_datastore_api.c
+++ b/src/datastore/perf_datastore_api.c
@@ -269,7 +269,7 @@ run_continuation (void *cls,
269 data, 269 data,
270 i+1, 270 i+1,
271 GNUNET_CRYPTO_random_u32 (GNUNET_CRYPTO_QUALITY_WEAK, 100), 271 GNUNET_CRYPTO_random_u32 (GNUNET_CRYPTO_QUALITY_WEAK, 100),
272 i, 272 i, 0,
273 GNUNET_TIME_relative_to_absolute 273 GNUNET_TIME_relative_to_absolute
274 (GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS, 274 (GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS,
275 GNUNET_CRYPTO_random_u32 (GNUNET_CRYPTO_QUALITY_WEAK, 1000))), 275 GNUNET_CRYPTO_random_u32 (GNUNET_CRYPTO_QUALITY_WEAK, 1000))),
@@ -279,10 +279,10 @@ run_continuation (void *cls,
279 break; 279 break;
280 case RP_CUT: 280 case RP_CUT:
281 /* trim down below MAX_SIZE again */ 281 /* trim down below MAX_SIZE again */
282 GNUNET_DATASTORE_get_random (datastore, 282 GNUNET_DATASTORE_get_for_replication (datastore,
283 1, 1, TIMEOUT, 283 1, 1, TIMEOUT,
284 &delete_value, 284 &delete_value,
285 crc); 285 crc);
286 break; 286 break;
287 case RP_REPORT: 287 case RP_REPORT:
288 printf ( 288 printf (
@@ -355,7 +355,7 @@ run (void *cls,
355 GNUNET_DATASTORE_put (datastore, 0, 355 GNUNET_DATASTORE_put (datastore, 0,
356 &zkey, 4, "TEST", 356 &zkey, 4, "TEST",
357 GNUNET_BLOCK_TYPE_TEST, 357 GNUNET_BLOCK_TYPE_TEST,
358 0, 0, GNUNET_TIME_relative_to_absolute (GNUNET_TIME_UNIT_SECONDS), 358 0, 0, 0, GNUNET_TIME_relative_to_absolute (GNUNET_TIME_UNIT_SECONDS),
359 0, 1, GNUNET_TIME_UNIT_MINUTES, 359 0, 1, GNUNET_TIME_UNIT_MINUTES,
360 &run_tests, crc)) 360 &run_tests, crc))
361 { 361 {
diff --git a/src/datastore/test_datastore_api.c b/src/datastore/test_datastore_api.c
index d8e4b7b34..965f05687 100644
--- a/src/datastore/test_datastore_api.c
+++ b/src/datastore/test_datastore_api.c
@@ -402,6 +402,7 @@ run_continuation (void *cls,
402 get_type (crc->i), 402 get_type (crc->i),
403 get_priority (crc->i), 403 get_priority (crc->i),
404 get_anonymity (crc->i), 404 get_anonymity (crc->i),
405 0,
405 get_expiration (crc->i), 406 get_expiration (crc->i),
406 1, 1, TIMEOUT, 407 1, 1, TIMEOUT,
407 &check_success, 408 &check_success,
@@ -502,6 +503,7 @@ run_continuation (void *cls,
502 get_type (42), 503 get_type (42),
503 get_priority (42), 504 get_priority (42),
504 get_anonymity (42), 505 get_anonymity (42),
506 0,
505 get_expiration (42), 507 get_expiration (42),
506 1, 1, TIMEOUT, 508 1, 1, TIMEOUT,
507 &check_success, 509 &check_success,
@@ -517,6 +519,7 @@ run_continuation (void *cls,
517 get_type (42), 519 get_type (42),
518 get_priority (43), 520 get_priority (43),
519 get_anonymity (43), 521 get_anonymity (43),
522 0,
520 get_expiration (43), 523 get_expiration (43),
521 1, 1, TIMEOUT, 524 1, 1, TIMEOUT,
522 &check_success, 525 &check_success,
@@ -613,7 +616,7 @@ run (void *cls,
613 GNUNET_DATASTORE_put (datastore, 0, 616 GNUNET_DATASTORE_put (datastore, 0,
614 &zkey, 4, "TEST", 617 &zkey, 4, "TEST",
615 GNUNET_BLOCK_TYPE_TEST, 618 GNUNET_BLOCK_TYPE_TEST,
616 0, 0, GNUNET_TIME_relative_to_absolute (GNUNET_TIME_UNIT_SECONDS), 619 0, 0, 0, GNUNET_TIME_relative_to_absolute (GNUNET_TIME_UNIT_SECONDS),
617 0, 1, GNUNET_TIME_UNIT_MINUTES, 620 0, 1, GNUNET_TIME_UNIT_MINUTES,
618 &run_tests, crc)) 621 &run_tests, crc))
619 { 622 {
diff --git a/src/datastore/test_datastore_api_management.c b/src/datastore/test_datastore_api_management.c
index 2873caa02..50a426af6 100644
--- a/src/datastore/test_datastore_api_management.c
+++ b/src/datastore/test_datastore_api_management.c
@@ -231,6 +231,7 @@ run_continuation (void *cls,
231 get_type (crc->i), 231 get_type (crc->i),
232 get_priority (crc->i), 232 get_priority (crc->i),
233 get_anonymity (crc->i), 233 get_anonymity (crc->i),
234 0,
234 get_expiration (crc->i), 235 get_expiration (crc->i),
235 1, 1, TIMEOUT, 236 1, 1, TIMEOUT,
236 &check_success, 237 &check_success,
@@ -327,7 +328,7 @@ run (void *cls,
327 GNUNET_DATASTORE_put (datastore, 0, 328 GNUNET_DATASTORE_put (datastore, 0,
328 &zkey, 4, "TEST", 329 &zkey, 4, "TEST",
329 GNUNET_BLOCK_TYPE_TEST, 330 GNUNET_BLOCK_TYPE_TEST,
330 0, 0, GNUNET_TIME_relative_to_absolute (GNUNET_TIME_UNIT_SECONDS), 331 0, 0, 0, GNUNET_TIME_relative_to_absolute (GNUNET_TIME_UNIT_SECONDS),
331 0, 1, GNUNET_TIME_UNIT_MINUTES, 332 0, 1, GNUNET_TIME_UNIT_MINUTES,
332 &run_tests, crc)) 333 &run_tests, crc))
333 { 334 {
diff --git a/src/fs/fs.c b/src/fs/fs.c
index 36eb3e5e1..81250b88c 100644
--- a/src/fs/fs.c
+++ b/src/fs/fs.c
@@ -1,6 +1,6 @@
1/* 1/*
2 This file is part of GNUnet. 2 This file is part of GNUnet.
3 (C) 2001, 2002, 2003, 2004, 2005, 2006, 2008, 2009, 2010 Christian Grothoff (and other contributing authors) 3 (C) 2001, 2002, 2003, 2004, 2005, 2006, 2008, 2009, 2010, 2011 Christian Grothoff (and other contributing authors)
4 4
5 GNUnet is free software; you can redistribute it and/or modify 5 GNUnet is free software; you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published 6 it under the terms of the GNU General Public License as published
@@ -769,17 +769,19 @@ deserialize_fi_node (struct GNUNET_FS_Handle *h,
769 (GNUNET_YES != 769 (GNUNET_YES !=
770 GNUNET_FS_uri_test_chk (ret->chk_uri)) ) ) || 770 GNUNET_FS_uri_test_chk (ret->chk_uri)) ) ) ||
771 (GNUNET_OK != 771 (GNUNET_OK !=
772 GNUNET_BIO_read_int64 (rh, &ret->expirationTime.abs_value)) ||
773 (GNUNET_OK !=
774 read_start_time (rh, &ret->start_time)) || 772 read_start_time (rh, &ret->start_time)) ||
775 (GNUNET_OK != 773 (GNUNET_OK !=
776 GNUNET_BIO_read_string (rh, "emsg", &ret->emsg, 16*1024)) || 774 GNUNET_BIO_read_string (rh, "emsg", &ret->emsg, 16*1024)) ||
777 (GNUNET_OK != 775 (GNUNET_OK !=
778 GNUNET_BIO_read_string (rh, "fn", &ret->filename, 16*1024)) || 776 GNUNET_BIO_read_string (rh, "fn", &ret->filename, 16*1024)) ||
779 (GNUNET_OK != 777 (GNUNET_OK !=
780 GNUNET_BIO_read_int32 (rh, &ret->anonymity)) || 778 GNUNET_BIO_read_int64 (rh, &ret->bo.expiration_time.abs_value)) ||
779 (GNUNET_OK !=
780 GNUNET_BIO_read_int32 (rh, &ret->bo.anonymity_level)) ||
781 (GNUNET_OK !=
782 GNUNET_BIO_read_int32 (rh, &ret->bo.content_priority)) ||
781 (GNUNET_OK != 783 (GNUNET_OK !=
782 GNUNET_BIO_read_int32 (rh, &ret->priority)) ) 784 GNUNET_BIO_read_int32 (rh, &ret->bo.replication_level)) )
783 { 785 {
784 GNUNET_break (0); 786 GNUNET_break (0);
785 goto cleanup; 787 goto cleanup;
@@ -1181,17 +1183,19 @@ GNUNET_FS_file_information_sync_ (struct GNUNET_FS_FileInformation * fi)
1181 (GNUNET_OK != 1183 (GNUNET_OK !=
1182 GNUNET_BIO_write_string (wh, chks)) || 1184 GNUNET_BIO_write_string (wh, chks)) ||
1183 (GNUNET_OK != 1185 (GNUNET_OK !=
1184 GNUNET_BIO_write_int64 (wh, fi->expirationTime.abs_value)) ||
1185 (GNUNET_OK !=
1186 write_start_time (wh, fi->start_time)) || 1186 write_start_time (wh, fi->start_time)) ||
1187 (GNUNET_OK != 1187 (GNUNET_OK !=
1188 GNUNET_BIO_write_string (wh, fi->emsg)) || 1188 GNUNET_BIO_write_string (wh, fi->emsg)) ||
1189 (GNUNET_OK != 1189 (GNUNET_OK !=
1190 GNUNET_BIO_write_string (wh, fi->filename)) || 1190 GNUNET_BIO_write_string (wh, fi->filename)) ||
1191 (GNUNET_OK != 1191 (GNUNET_OK !=
1192 GNUNET_BIO_write_int32 (wh, fi->anonymity)) || 1192 GNUNET_BIO_write_int64 (wh, fi->bo.expiration_time.abs_value)) ||
1193 (GNUNET_OK !=
1194 GNUNET_BIO_write_int32 (wh, fi->bo.anonymity_level)) ||
1195 (GNUNET_OK !=
1196 GNUNET_BIO_write_int32 (wh, fi->bo.content_priority)) ||
1193 (GNUNET_OK != 1197 (GNUNET_OK !=
1194 GNUNET_BIO_write_int32 (wh, fi->priority)) ) 1198 GNUNET_BIO_write_int32 (wh, fi->bo.replication_level)) )
1195 { 1199 {
1196 GNUNET_break (0); 1200 GNUNET_break (0);
1197 goto cleanup; 1201 goto cleanup;
@@ -1340,10 +1344,8 @@ find_file_position (struct GNUNET_FS_FileInformation *pos,
1340 * @param length length of the file or directory 1344 * @param length length of the file or directory
1341 * @param meta metadata for the file or directory (can be modified) 1345 * @param meta metadata for the file or directory (can be modified)
1342 * @param uri pointer to the keywords that will be used for this entry (can be modified) 1346 * @param uri pointer to the keywords that will be used for this entry (can be modified)
1343 * @param anonymity pointer to selected anonymity level (can be modified) 1347 * @param bo block options (can be modified)
1344 * @param priority pointer to selected priority (can be modified)
1345 * @param do_index should we index? 1348 * @param do_index should we index?
1346 * @param expirationTime pointer to selected expiration time (can be modified)
1347 * @param client_info pointer to client context set upon creation (can be modified) 1349 * @param client_info pointer to client context set upon creation (can be modified)
1348 * @return GNUNET_OK to continue (always) 1350 * @return GNUNET_OK to continue (always)
1349 */ 1351 */
@@ -1353,10 +1355,8 @@ fip_signal_resume(void *cls,
1353 uint64_t length, 1355 uint64_t length,
1354 struct GNUNET_CONTAINER_MetaData *meta, 1356 struct GNUNET_CONTAINER_MetaData *meta,
1355 struct GNUNET_FS_Uri **uri, 1357 struct GNUNET_FS_Uri **uri,
1356 uint32_t *anonymity, 1358 struct GNUNET_FS_BlockOptions *bo,
1357 uint32_t *priority,
1358 int *do_index, 1359 int *do_index,
1359 struct GNUNET_TIME_Absolute *expirationTime,
1360 void **client_info) 1360 void **client_info)
1361{ 1361{
1362 struct GNUNET_FS_PublishContext *sc = cls; 1362 struct GNUNET_FS_PublishContext *sc = cls;
diff --git a/src/fs/fs.h b/src/fs/fs.h
index ff769cfca..2040d035a 100644
--- a/src/fs/fs.h
+++ b/src/fs/fs.h
@@ -438,9 +438,9 @@ struct GNUNET_FS_FileInformation
438 struct GNUNET_FS_Uri *chk_uri; 438 struct GNUNET_FS_Uri *chk_uri;
439 439
440 /** 440 /**
441 * At what time should the content expire? 441 * Block options for the file.
442 */ 442 */
443 struct GNUNET_TIME_Absolute expirationTime; 443 struct GNUNET_FS_BlockOptions bo;
444 444
445 /** 445 /**
446 * At what time did we start this upload? 446 * At what time did we start this upload?
@@ -548,16 +548,6 @@ struct GNUNET_FS_FileInformation
548 } data; 548 } data;
549 549
550 /** 550 /**
551 * Desired anonymity level.
552 */
553 uint32_t anonymity;
554
555 /**
556 * Desired priority (for keeping the content in the DB).
557 */
558 uint32_t priority;
559
560 /**
561 * Is this struct for a file or directory? 551 * Is this struct for a file or directory?
562 */ 552 */
563 int is_directory; 553 int is_directory;
diff --git a/src/fs/fs_file_information.c b/src/fs/fs_file_information.c
index 2ae708e59..b248fae44 100644
--- a/src/fs/fs_file_information.c
+++ b/src/fs/fs_file_information.c
@@ -1,6 +1,6 @@
1/* 1/*
2 This file is part of GNUnet. 2 This file is part of GNUnet.
3 (C) 2009 Christian Grothoff (and other contributing authors) 3 (C) 2009, 2011 Christian Grothoff (and other contributing authors)
4 4
5 GNUnet is free software; you can redistribute it and/or modify 5 GNUnet is free software; you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published 6 it under the terms of the GNU General Public License as published
@@ -132,11 +132,7 @@ GNUNET_FS_file_information_get_id (struct GNUNET_FS_FileInformation *s)
132 * @param meta metadata for the file 132 * @param meta metadata for the file
133 * @param do_index GNUNET_YES for index, GNUNET_NO for insertion, 133 * @param do_index GNUNET_YES for index, GNUNET_NO for insertion,
134 * GNUNET_SYSERR for simulation 134 * GNUNET_SYSERR for simulation
135 * @param anonymity what is the desired anonymity level for sharing? 135 * @param bo block options
136 * @param priority what is the priority for OUR node to
137 * keep this file available? Use 0 for maximum anonymity and
138 * minimum reliability...
139 * @param expirationTime when should this content expire?
140 * @return publish structure entry for the file 136 * @return publish structure entry for the file
141 */ 137 */
142struct GNUNET_FS_FileInformation * 138struct GNUNET_FS_FileInformation *
@@ -146,9 +142,7 @@ GNUNET_FS_file_information_create_from_file (struct GNUNET_FS_Handle *h,
146 const struct GNUNET_FS_Uri *keywords, 142 const struct GNUNET_FS_Uri *keywords,
147 const struct GNUNET_CONTAINER_MetaData *meta, 143 const struct GNUNET_CONTAINER_MetaData *meta,
148 int do_index, 144 int do_index,
149 uint32_t anonymity, 145 const struct GNUNET_FS_BlockOptions *bo)
150 uint32_t priority,
151 struct GNUNET_TIME_Absolute expirationTime)
152{ 146{
153 struct FileInfo *fi; 147 struct FileInfo *fi;
154 struct stat sbuf; 148 struct stat sbuf;
@@ -177,9 +171,7 @@ GNUNET_FS_file_information_create_from_file (struct GNUNET_FS_Handle *h,
177 keywords, 171 keywords,
178 meta, 172 meta,
179 do_index, 173 do_index,
180 anonymity, 174 bo);
181 priority,
182 expirationTime);
183 if (ret == NULL) 175 if (ret == NULL)
184 return NULL; 176 return NULL;
185 ret->h = h; 177 ret->h = h;
@@ -212,11 +204,7 @@ GNUNET_FS_file_information_create_from_file (struct GNUNET_FS_Handle *h,
212 * @param meta metadata for the file 204 * @param meta metadata for the file
213 * @param do_index GNUNET_YES for index, GNUNET_NO for insertion, 205 * @param do_index GNUNET_YES for index, GNUNET_NO for insertion,
214 * GNUNET_SYSERR for simulation 206 * GNUNET_SYSERR for simulation
215 * @param anonymity what is the desired anonymity level for sharing? 207 * @param bo block options
216 * @param priority what is the priority for OUR node to
217 * keep this file available? Use 0 for maximum anonymity and
218 * minimum reliability...
219 * @param expirationTime when should this content expire?
220 * @return publish structure entry for the file 208 * @return publish structure entry for the file
221 */ 209 */
222struct GNUNET_FS_FileInformation * 210struct GNUNET_FS_FileInformation *
@@ -227,9 +215,7 @@ GNUNET_FS_file_information_create_from_data (struct GNUNET_FS_Handle *h,
227 const struct GNUNET_FS_Uri *keywords, 215 const struct GNUNET_FS_Uri *keywords,
228 const struct GNUNET_CONTAINER_MetaData *meta, 216 const struct GNUNET_CONTAINER_MetaData *meta,
229 int do_index, 217 int do_index,
230 uint32_t anonymity, 218 const struct GNUNET_FS_BlockOptions *bo)
231 uint32_t priority,
232 struct GNUNET_TIME_Absolute expirationTime)
233{ 219{
234 if (GNUNET_YES == do_index) 220 if (GNUNET_YES == do_index)
235 { 221 {
@@ -244,9 +230,7 @@ GNUNET_FS_file_information_create_from_data (struct GNUNET_FS_Handle *h,
244 keywords, 230 keywords,
245 meta, 231 meta,
246 do_index, 232 do_index,
247 anonymity, 233 bo);
248 priority,
249 expirationTime);
250} 234}
251 235
252 236
@@ -263,11 +247,7 @@ GNUNET_FS_file_information_create_from_data (struct GNUNET_FS_Handle *h,
263 * @param meta metadata for the file 247 * @param meta metadata for the file
264 * @param do_index GNUNET_YES for index, GNUNET_NO for insertion, 248 * @param do_index GNUNET_YES for index, GNUNET_NO for insertion,
265 * GNUNET_SYSERR for simulation 249 * GNUNET_SYSERR for simulation
266 * @param anonymity what is the desired anonymity level for sharing? 250 * @param bo block options
267 * @param priority what is the priority for OUR node to
268 * keep this file available? Use 0 for maximum anonymity and
269 * minimum reliability...
270 * @param expirationTime when should this content expire?
271 * @return publish structure entry for the file 251 * @return publish structure entry for the file
272 */ 252 */
273struct GNUNET_FS_FileInformation * 253struct GNUNET_FS_FileInformation *
@@ -279,9 +259,7 @@ GNUNET_FS_file_information_create_from_reader (struct GNUNET_FS_Handle *h,
279 const struct GNUNET_FS_Uri *keywords, 259 const struct GNUNET_FS_Uri *keywords,
280 const struct GNUNET_CONTAINER_MetaData *meta, 260 const struct GNUNET_CONTAINER_MetaData *meta,
281 int do_index, 261 int do_index,
282 uint32_t anonymity, 262 const struct GNUNET_FS_BlockOptions *bo)
283 uint32_t priority,
284 struct GNUNET_TIME_Absolute expirationTime)
285{ 263{
286 struct GNUNET_FS_FileInformation *ret; 264 struct GNUNET_FS_FileInformation *ret;
287 265
@@ -298,13 +276,11 @@ GNUNET_FS_file_information_create_from_reader (struct GNUNET_FS_Handle *h,
298 if (ret->meta == NULL) 276 if (ret->meta == NULL)
299 ret->meta = GNUNET_CONTAINER_meta_data_create (); 277 ret->meta = GNUNET_CONTAINER_meta_data_create ();
300 ret->keywords = (keywords == NULL) ? NULL : GNUNET_FS_uri_dup (keywords); 278 ret->keywords = (keywords == NULL) ? NULL : GNUNET_FS_uri_dup (keywords);
301 ret->expirationTime = expirationTime;
302 ret->data.file.reader = reader; 279 ret->data.file.reader = reader;
303 ret->data.file.reader_cls = reader_cls; 280 ret->data.file.reader_cls = reader_cls;
304 ret->data.file.do_index = do_index; 281 ret->data.file.do_index = do_index;
305 ret->data.file.file_size = length; 282 ret->data.file.file_size = length;
306 ret->anonymity = anonymity; 283 ret->bo = *bo;
307 ret->priority = priority;
308 return ret; 284 return ret;
309} 285}
310 286
@@ -350,24 +326,15 @@ struct DirScanCls
350 char *emsg; 326 char *emsg;
351 327
352 /** 328 /**
353 * Should files be indexed? 329 * Block options.
354 */
355 int do_index;
356
357 /**
358 * Desired anonymity level.
359 */ 330 */
360 uint32_t anonymity; 331 const struct GNUNET_FS_BlockOptions *bo;
361 332
362 /** 333 /**
363 * Desired publishing priority. 334 * Should files be indexed?
364 */ 335 */
365 uint32_t priority; 336 int do_index;
366 337
367 /**
368 * Expiration time for publication.
369 */
370 struct GNUNET_TIME_Absolute expiration;
371}; 338};
372 339
373 340
@@ -406,9 +373,7 @@ dir_scan_cb (void *cls,
406 dsc->scanner, 373 dsc->scanner,
407 dsc->scanner_cls, 374 dsc->scanner_cls,
408 dsc->do_index, 375 dsc->do_index,
409 dsc->anonymity, 376 dsc->bo,
410 dsc->priority,
411 dsc->expiration,
412 &dsc->emsg); 377 &dsc->emsg);
413 if (NULL == fi) 378 if (NULL == fi)
414 { 379 {
@@ -430,9 +395,7 @@ dir_scan_cb (void *cls,
430 ksk_uri, 395 ksk_uri,
431 meta, 396 meta,
432 dsc->do_index, 397 dsc->do_index,
433 dsc->anonymity, 398 dsc->bo);
434 dsc->priority,
435 dsc->expiration);
436 GNUNET_CONTAINER_meta_data_destroy (meta); 399 GNUNET_CONTAINER_meta_data_destroy (meta);
437 GNUNET_FS_uri_destroy (keywords); 400 GNUNET_FS_uri_destroy (keywords);
438 GNUNET_FS_uri_destroy (ksk_uri); 401 GNUNET_FS_uri_destroy (ksk_uri);
@@ -459,9 +422,7 @@ dir_scan_cb (void *cls,
459 * @param h handle to the file sharing subsystem 422 * @param h handle to the file sharing subsystem
460 * @param dirname name of the directory to scan 423 * @param dirname name of the directory to scan
461 * @param do_index should files be indexed or inserted 424 * @param do_index should files be indexed or inserted
462 * @param anonymity desired anonymity level 425 * @param bo block options
463 * @param priority priority for publishing
464 * @param expirationTime expiration for publication
465 * @param proc function called on each entry 426 * @param proc function called on each entry
466 * @param proc_cls closure for proc 427 * @param proc_cls closure for proc
467 * @param emsg where to store an error message (on errors) 428 * @param emsg where to store an error message (on errors)
@@ -472,9 +433,7 @@ GNUNET_FS_directory_scanner_default (void *cls,
472 struct GNUNET_FS_Handle *h, 433 struct GNUNET_FS_Handle *h,
473 const char *dirname, 434 const char *dirname,
474 int do_index, 435 int do_index,
475 uint32_t anonymity, 436 const struct GNUNET_FS_BlockOptions *bo,
476 uint32_t priority,
477 struct GNUNET_TIME_Absolute expirationTime,
478 GNUNET_FS_FileProcessor proc, 437 GNUNET_FS_FileProcessor proc,
479 void *proc_cls, 438 void *proc_cls,
480 char **emsg) 439 char **emsg)
@@ -489,9 +448,7 @@ GNUNET_FS_directory_scanner_default (void *cls,
489 dsc.scanner = &GNUNET_FS_directory_scanner_default; 448 dsc.scanner = &GNUNET_FS_directory_scanner_default;
490 dsc.scanner_cls = cls; 449 dsc.scanner_cls = cls;
491 dsc.do_index = do_index; 450 dsc.do_index = do_index;
492 dsc.anonymity = anonymity; 451 dsc.bo = bo;
493 dsc.priority = priority;
494 dsc.expiration = expirationTime;
495 if (-1 == GNUNET_DISK_directory_scan (dirname, 452 if (-1 == GNUNET_DISK_directory_scan (dirname,
496 &dir_scan_cb, 453 &dir_scan_cb,
497 &dsc)) 454 &dsc))
@@ -555,11 +512,7 @@ dirproc (void *cls,
555 * @param scanner function used to get a list of files in a directory 512 * @param scanner function used to get a list of files in a directory
556 * @param scanner_cls closure for scanner 513 * @param scanner_cls closure for scanner
557 * @param do_index should files in the hierarchy be indexed? 514 * @param do_index should files in the hierarchy be indexed?
558 * @param anonymity what is the desired anonymity level for sharing? 515 * @param bo block options
559 * @param priority what is the priority for OUR node to
560 * keep this file available? Use 0 for maximum anonymity and
561 * minimum reliability...
562 * @param expirationTime when should this content expire?
563 * @param emsg where to store an error message 516 * @param emsg where to store an error message
564 * @return publish structure entry for the directory, NULL on error 517 * @return publish structure entry for the directory, NULL on error
565 */ 518 */
@@ -570,9 +523,7 @@ GNUNET_FS_file_information_create_from_directory (struct GNUNET_FS_Handle *h,
570 GNUNET_FS_DirectoryScanner scanner, 523 GNUNET_FS_DirectoryScanner scanner,
571 void *scanner_cls, 524 void *scanner_cls,
572 int do_index, 525 int do_index,
573 uint32_t anonymity, 526 const struct GNUNET_FS_BlockOptions *bo,
574 uint32_t priority,
575 struct GNUNET_TIME_Absolute expirationTime,
576 char **emsg) 527 char **emsg)
577{ 528{
578 struct GNUNET_FS_FileInformation *ret; 529 struct GNUNET_FS_FileInformation *ret;
@@ -590,9 +541,7 @@ GNUNET_FS_file_information_create_from_directory (struct GNUNET_FS_Handle *h,
590 h, 541 h,
591 filename, 542 filename,
592 do_index, 543 do_index,
593 anonymity, 544 bo,
594 priority,
595 expirationTime,
596 &dirproc, 545 &dirproc,
597 &dc, 546 &dc,
598 emsg); 547 emsg);
@@ -602,9 +551,7 @@ GNUNET_FS_file_information_create_from_directory (struct GNUNET_FS_Handle *h,
602 client_info, 551 client_info,
603 ksk, 552 ksk,
604 meta, 553 meta,
605 anonymity, 554 bo);
606 priority,
607 expirationTime);
608 GNUNET_CONTAINER_meta_data_destroy (meta); 555 GNUNET_CONTAINER_meta_data_destroy (meta);
609 ret->data.dir.entries = dc.entries; 556 ret->data.dir.entries = dc.entries;
610 while (dc.entries != NULL) 557 while (dc.entries != NULL)
@@ -657,11 +604,7 @@ GNUNET_FS_file_information_is_directory (struct GNUNET_FS_FileInformation *ent)
657 * @param meta metadata for the directory 604 * @param meta metadata for the directory
658 * @param keywords under which keywords should this directory be available 605 * @param keywords under which keywords should this directory be available
659 * directly; can be NULL 606 * directly; can be NULL
660 * @param anonymity what is the desired anonymity level for sharing? 607 * @param bo block options
661 * @param priority what is the priority for OUR node to
662 * keep this file available? Use 0 for maximum anonymity and
663 * minimum reliability...
664 * @param expirationTime when should this content expire?
665 * @return publish structure entry for the directory , NULL on error 608 * @return publish structure entry for the directory , NULL on error
666 */ 609 */
667struct GNUNET_FS_FileInformation * 610struct GNUNET_FS_FileInformation *
@@ -669,9 +612,7 @@ GNUNET_FS_file_information_create_empty_directory (struct GNUNET_FS_Handle *h,
669 void *client_info, 612 void *client_info,
670 const struct GNUNET_FS_Uri *keywords, 613 const struct GNUNET_FS_Uri *keywords,
671 const struct GNUNET_CONTAINER_MetaData *meta, 614 const struct GNUNET_CONTAINER_MetaData *meta,
672 uint32_t anonymity, 615 const struct GNUNET_FS_BlockOptions *bo)
673 uint32_t priority,
674 struct GNUNET_TIME_Absolute expirationTime)
675{ 616{
676 struct GNUNET_FS_FileInformation *ret; 617 struct GNUNET_FS_FileInformation *ret;
677 618
@@ -680,10 +621,8 @@ GNUNET_FS_file_information_create_empty_directory (struct GNUNET_FS_Handle *h,
680 ret->client_info = client_info; 621 ret->client_info = client_info;
681 ret->meta = GNUNET_CONTAINER_meta_data_duplicate (meta); 622 ret->meta = GNUNET_CONTAINER_meta_data_duplicate (meta);
682 ret->keywords = GNUNET_FS_uri_dup (keywords); 623 ret->keywords = GNUNET_FS_uri_dup (keywords);
683 ret->expirationTime = expirationTime; 624 ret->bo = *bo;
684 ret->is_directory = GNUNET_YES; 625 ret->is_directory = GNUNET_YES;
685 ret->anonymity = anonymity;
686 ret->priority = priority;
687 return ret; 626 return ret;
688} 627}
689 628
@@ -747,10 +686,8 @@ GNUNET_FS_file_information_inspect (struct GNUNET_FS_FileInformation *dir,
747 (dir->is_directory) ? dir->data.dir.dir_size : dir->data.file.file_size, 686 (dir->is_directory) ? dir->data.dir.dir_size : dir->data.file.file_size,
748 dir->meta, 687 dir->meta,
749 &dir->keywords, 688 &dir->keywords,
750 &dir->anonymity, 689 &dir->bo,
751 &dir->priority,
752 (dir->is_directory) ? &no : &dir->data.file.do_index, 690 (dir->is_directory) ? &no : &dir->data.file.do_index,
753 &dir->expirationTime,
754 &dir->client_info)) 691 &dir->client_info))
755 return; 692 return;
756 if (! dir->is_directory) 693 if (! dir->is_directory)
@@ -765,10 +702,8 @@ GNUNET_FS_file_information_inspect (struct GNUNET_FS_FileInformation *dir,
765 (pos->is_directory) ? pos->data.dir.dir_size : pos->data.file.file_size, 702 (pos->is_directory) ? pos->data.dir.dir_size : pos->data.file.file_size,
766 pos->meta, 703 pos->meta,
767 &pos->keywords, 704 &pos->keywords,
768 &pos->anonymity, 705 &pos->bo,
769 &pos->priority,
770 (dir->is_directory) ? &no : &dir->data.file.do_index, 706 (dir->is_directory) ? &no : &dir->data.file.do_index,
771 &pos->expirationTime,
772 &pos->client_info)) 707 &pos->client_info))
773 break; 708 break;
774 pos = pos->next; 709 pos = pos->next;
@@ -810,10 +745,8 @@ GNUNET_FS_file_information_destroy (struct GNUNET_FS_FileInformation *fi,
810 fi->data.dir.dir_size, 745 fi->data.dir.dir_size,
811 fi->meta, 746 fi->meta,
812 &fi->keywords, 747 &fi->keywords,
813 &fi->anonymity, 748 &fi->bo,
814 &fi->priority,
815 &no, 749 &no,
816 &fi->expirationTime,
817 &fi->client_info); 750 &fi->client_info);
818 GNUNET_free_non_null (fi->data.dir.dir_data); 751 GNUNET_free_non_null (fi->data.dir.dir_data);
819 } 752 }
@@ -830,10 +763,8 @@ GNUNET_FS_file_information_destroy (struct GNUNET_FS_FileInformation *fi,
830 fi->data.file.file_size, 763 fi->data.file.file_size,
831 fi->meta, 764 fi->meta,
832 &fi->keywords, 765 &fi->keywords,
833 &fi->anonymity, 766 &fi->bo,
834 &fi->priority,
835 &fi->data.file.do_index, 767 &fi->data.file.do_index,
836 &fi->expirationTime,
837 &fi->client_info); 768 &fi->client_info);
838 } 769 }
839 GNUNET_free_non_null (fi->filename); 770 GNUNET_free_non_null (fi->filename);
diff --git a/src/fs/fs_namespace.c b/src/fs/fs_namespace.c
index bc66bb21f..175879707 100644
--- a/src/fs/fs_namespace.c
+++ b/src/fs/fs_namespace.c
@@ -285,9 +285,9 @@ struct AdvertisementContext
285 struct GNUNET_FS_Namespace *ns; 285 struct GNUNET_FS_Namespace *ns;
286 286
287 /** 287 /**
288 * Expiration time. 288 * Block options.
289 */ 289 */
290 struct GNUNET_TIME_Absolute expiration; 290 struct GNUNET_FS_BlockOptions bo;
291 291
292 /** 292 /**
293 * Number of bytes of plaintext. 293 * Number of bytes of plaintext.
@@ -295,16 +295,6 @@ struct AdvertisementContext
295 size_t pt_size; 295 size_t pt_size;
296 296
297 /** 297 /**
298 * Anonymity level.
299 */
300 uint32_t anonymity;
301
302 /**
303 * Content priority.
304 */
305 uint32_t priority;
306
307 /**
308 * Current keyword offset. 298 * Current keyword offset.
309 */ 299 */
310 unsigned int pos; 300 unsigned int pos;
@@ -410,9 +400,10 @@ advertisement_cont (void *cls,
410 ac->pt_size + sizeof (struct NBlock), 400 ac->pt_size + sizeof (struct NBlock),
411 ac->nb, 401 ac->nb,
412 GNUNET_BLOCK_TYPE_FS_NBLOCK, 402 GNUNET_BLOCK_TYPE_FS_NBLOCK,
413 ac->priority, 403 ac->bo.content_priority,
414 ac->anonymity, 404 ac->bo.anonymity_level,
415 ac->expiration, 405 ac->bo.replication_level,
406 ac->bo.expiration_time,
416 -2, 1, 407 -2, 1,
417 GNUNET_CONSTANTS_SERVICE_TIMEOUT, 408 GNUNET_CONSTANTS_SERVICE_TIMEOUT,
418 &advertisement_cont, 409 &advertisement_cont,
@@ -427,9 +418,7 @@ advertisement_cont (void *cls,
427 * @param ksk_uri keywords to use for advertisment 418 * @param ksk_uri keywords to use for advertisment
428 * @param namespace handle for the namespace that should be advertised 419 * @param namespace handle for the namespace that should be advertised
429 * @param meta meta-data for the namespace advertisement 420 * @param meta meta-data for the namespace advertisement
430 * @param anonymity for the namespace advertismement 421 * @param bo block options
431 * @param priority for the namespace advertisement
432 * @param expiration for the namespace advertisement
433 * @param rootEntry name of the root of the namespace 422 * @param rootEntry name of the root of the namespace
434 * @param cont continuation 423 * @param cont continuation
435 * @param cont_cls closure for cont 424 * @param cont_cls closure for cont
@@ -439,9 +428,7 @@ GNUNET_FS_namespace_advertise (struct GNUNET_FS_Handle *h,
439 struct GNUNET_FS_Uri *ksk_uri, 428 struct GNUNET_FS_Uri *ksk_uri,
440 struct GNUNET_FS_Namespace *namespace, 429 struct GNUNET_FS_Namespace *namespace,
441 const struct GNUNET_CONTAINER_MetaData *meta, 430 const struct GNUNET_CONTAINER_MetaData *meta,
442 uint32_t anonymity, 431 const struct GNUNET_FS_BlockOptions *bo,
443 uint32_t priority,
444 struct GNUNET_TIME_Absolute expiration,
445 const char *rootEntry, 432 const char *rootEntry,
446 GNUNET_FS_PublishContinuation cont, 433 GNUNET_FS_PublishContinuation cont,
447 void *cont_cls) 434 void *cont_cls)
@@ -512,9 +499,7 @@ GNUNET_FS_namespace_advertise (struct GNUNET_FS_Handle *h,
512 ctx->pt_size = mdsize + reslen; 499 ctx->pt_size = mdsize + reslen;
513 ctx->ns = namespace; 500 ctx->ns = namespace;
514 ctx->ns->rc++; 501 ctx->ns->rc++;
515 ctx->anonymity = anonymity; 502 ctx->bo = *bo;
516 ctx->priority = priority;
517 ctx->expiration = expiration;
518 advertisement_cont (ctx, GNUNET_OK, NULL); 503 advertisement_cont (ctx, GNUNET_OK, NULL);
519} 504}
520 505
@@ -828,9 +813,7 @@ sb_put_cont (void *cls,
828 * @param update update identifier to use 813 * @param update update identifier to use
829 * @param meta metadata to use 814 * @param meta metadata to use
830 * @param uri URI to refer to in the SBlock 815 * @param uri URI to refer to in the SBlock
831 * @param expirationTime when the SBlock expires 816 * @param bo block options
832 * @param anonymity anonymity level for the SBlock
833 * @param priority priority for the SBlock
834 * @param options publication options 817 * @param options publication options
835 * @param cont continuation 818 * @param cont continuation
836 * @param cont_cls closure for cont 819 * @param cont_cls closure for cont
@@ -842,9 +825,7 @@ GNUNET_FS_publish_sks (struct GNUNET_FS_Handle *h,
842 const char *update, 825 const char *update,
843 const struct GNUNET_CONTAINER_MetaData *meta, 826 const struct GNUNET_CONTAINER_MetaData *meta,
844 const struct GNUNET_FS_Uri *uri, 827 const struct GNUNET_FS_Uri *uri,
845 struct GNUNET_TIME_Absolute expirationTime, 828 const struct GNUNET_FS_BlockOptions *bo,
846 uint32_t anonymity,
847 uint32_t priority,
848 enum GNUNET_FS_PublishOptions options, 829 enum GNUNET_FS_PublishOptions options,
849 GNUNET_FS_PublishContinuation cont, 830 GNUNET_FS_PublishContinuation cont,
850 void *cont_cls) 831 void *cont_cls)
@@ -975,9 +956,10 @@ GNUNET_FS_publish_sks (struct GNUNET_FS_Handle *h,
975 size, 956 size,
976 sb_enc, 957 sb_enc,
977 GNUNET_BLOCK_TYPE_FS_SBLOCK, 958 GNUNET_BLOCK_TYPE_FS_SBLOCK,
978 priority, 959 bo->content_priority,
979 anonymity, 960 bo->anonymity_level,
980 expirationTime, 961 bo->replication_level,
962 bo->expiration_time,
981 -2, 1, 963 -2, 1,
982 GNUNET_CONSTANTS_SERVICE_TIMEOUT, 964 GNUNET_CONSTANTS_SERVICE_TIMEOUT,
983 &sb_put_cont, 965 &sb_put_cont,
diff --git a/src/fs/fs_publish.c b/src/fs/fs_publish.c
index ac69c94a1..36efb27f6 100644
--- a/src/fs/fs_publish.c
+++ b/src/fs/fs_publish.c
@@ -95,7 +95,7 @@ GNUNET_FS_publish_make_status_ (struct GNUNET_FS_ProgressInfo *pi,
95 pi->value.publish.size); 95 pi->value.publish.size);
96 pi->value.publish.completed = offset; 96 pi->value.publish.completed = offset;
97 pi->value.publish.duration = GNUNET_TIME_absolute_get_duration (p->start_time); 97 pi->value.publish.duration = GNUNET_TIME_absolute_get_duration (p->start_time);
98 pi->value.publish.anonymity = p->anonymity; 98 pi->value.publish.anonymity = p->bo.anonymity_level;
99 return sc->h->upcb (sc->h->upcb_cls, 99 return sc->h->upcb (sc->h->upcb_cls,
100 pi); 100 pi);
101} 101}
@@ -324,9 +324,7 @@ publish_sblock (struct GNUNET_FS_PublishContext *sc)
324 sc->nuid, 324 sc->nuid,
325 sc->fi->meta, 325 sc->fi->meta,
326 sc->fi->chk_uri, 326 sc->fi->chk_uri,
327 sc->fi->expirationTime, 327 &sc->fi->bo,
328 sc->fi->anonymity,
329 sc->fi->priority,
330 sc->options, 328 sc->options,
331 &publish_sblocks_cont, 329 &publish_sblocks_cont,
332 sc); 330 sc);
@@ -569,9 +567,10 @@ block_proc (void *cls,
569 sizeof (struct OnDemandBlock), 567 sizeof (struct OnDemandBlock),
570 &odb, 568 &odb,
571 GNUNET_BLOCK_TYPE_FS_ONDEMAND, 569 GNUNET_BLOCK_TYPE_FS_ONDEMAND,
572 p->priority, 570 p->bo.content_priority,
573 p->anonymity, 571 p->bo.anonymity_level,
574 p->expirationTime, 572 p->bo.replication_level,
573 p->bo.expiration_time,
575 -2, 1, 574 -2, 1,
576 GNUNET_CONSTANTS_SERVICE_TIMEOUT, 575 GNUNET_CONSTANTS_SERVICE_TIMEOUT,
577 &ds_put_cont, 576 &ds_put_cont,
@@ -591,9 +590,10 @@ block_proc (void *cls,
591 block_size, 590 block_size,
592 block, 591 block,
593 type, 592 type,
594 p->priority, 593 p->bo.content_priority,
595 p->anonymity, 594 p->bo.anonymity_level,
596 p->expirationTime, 595 p->bo.replication_level,
596 p->bo.expiration_time,
597 -2, 1, 597 -2, 1,
598 GNUNET_CONSTANTS_SERVICE_TIMEOUT, 598 GNUNET_CONSTANTS_SERVICE_TIMEOUT,
599 &ds_put_cont, 599 &ds_put_cont,
@@ -990,12 +990,12 @@ GNUNET_FS_publish_main_ (void *cls,
990 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 990 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
991 "File upload complete, now publishing KSK blocks.\n"); 991 "File upload complete, now publishing KSK blocks.\n");
992#endif 992#endif
993 if (0 == p->anonymity) 993 if (0 == p->bo.anonymity_level)
994 { 994 {
995 /* zero anonymity, box CHK URI in LOC URI */ 995 /* zero anonymity, box CHK URI in LOC URI */
996 loc = GNUNET_FS_uri_loc_create (p->chk_uri, 996 loc = GNUNET_FS_uri_loc_create (p->chk_uri,
997 pc->h->cfg, 997 pc->h->cfg,
998 p->expirationTime); 998 p->bo.expiration_time);
999 GNUNET_FS_uri_destroy (p->chk_uri); 999 GNUNET_FS_uri_destroy (p->chk_uri);
1000 p->chk_uri = loc; 1000 p->chk_uri = loc;
1001 } 1001 }
@@ -1007,9 +1007,7 @@ GNUNET_FS_publish_main_ (void *cls,
1007 p->keywords, 1007 p->keywords,
1008 p->meta, 1008 p->meta,
1009 p->chk_uri, 1009 p->chk_uri,
1010 p->expirationTime, 1010 &p->bo,
1011 p->anonymity,
1012 p->priority,
1013 pc->options, 1011 pc->options,
1014 &publish_kblocks_cont, 1012 &publish_kblocks_cont,
1015 pc); 1013 pc);
@@ -1065,10 +1063,8 @@ GNUNET_FS_publish_main_ (void *cls,
1065 * @param length length of the file or directory 1063 * @param length length of the file or directory
1066 * @param meta metadata for the file or directory (can be modified) 1064 * @param meta metadata for the file or directory (can be modified)
1067 * @param uri pointer to the keywords that will be used for this entry (can be modified) 1065 * @param uri pointer to the keywords that will be used for this entry (can be modified)
1068 * @param anonymity pointer to selected anonymity level (can be modified) 1066 * @param bo block options
1069 * @param priority pointer to selected priority (can be modified)
1070 * @param do_index should we index? 1067 * @param do_index should we index?
1071 * @param expirationTime pointer to selected expiration time (can be modified)
1072 * @param client_info pointer to client context set upon creation (can be modified) 1068 * @param client_info pointer to client context set upon creation (can be modified)
1073 * @return GNUNET_OK to continue (always) 1069 * @return GNUNET_OK to continue (always)
1074 */ 1070 */
@@ -1078,10 +1074,8 @@ fip_signal_start(void *cls,
1078 uint64_t length, 1074 uint64_t length,
1079 struct GNUNET_CONTAINER_MetaData *meta, 1075 struct GNUNET_CONTAINER_MetaData *meta,
1080 struct GNUNET_FS_Uri **uri, 1076 struct GNUNET_FS_Uri **uri,
1081 uint32_t *anonymity, 1077 struct GNUNET_FS_BlockOptions *bo,
1082 uint32_t *priority,
1083 int *do_index, 1078 int *do_index,
1084 struct GNUNET_TIME_Absolute *expirationTime,
1085 void **client_info) 1079 void **client_info)
1086{ 1080{
1087 struct GNUNET_FS_PublishContext *sc = cls; 1081 struct GNUNET_FS_PublishContext *sc = cls;
@@ -1134,10 +1128,8 @@ fip_signal_start(void *cls,
1134 * @param length length of the file or directory 1128 * @param length length of the file or directory
1135 * @param meta metadata for the file or directory (can be modified) 1129 * @param meta metadata for the file or directory (can be modified)
1136 * @param uri pointer to the keywords that will be used for this entry (can be modified) 1130 * @param uri pointer to the keywords that will be used for this entry (can be modified)
1137 * @param anonymity pointer to selected anonymity level (can be modified) 1131 * @param bo block options
1138 * @param priority pointer to selected priority (can be modified)
1139 * @param do_index should we index? 1132 * @param do_index should we index?
1140 * @param expirationTime pointer to selected expiration time (can be modified)
1141 * @param client_info pointer to client context set upon creation (can be modified) 1133 * @param client_info pointer to client context set upon creation (can be modified)
1142 * @return GNUNET_OK to continue (always) 1134 * @return GNUNET_OK to continue (always)
1143 */ 1135 */
@@ -1147,10 +1139,8 @@ fip_signal_suspend(void *cls,
1147 uint64_t length, 1139 uint64_t length,
1148 struct GNUNET_CONTAINER_MetaData *meta, 1140 struct GNUNET_CONTAINER_MetaData *meta,
1149 struct GNUNET_FS_Uri **uri, 1141 struct GNUNET_FS_Uri **uri,
1150 uint32_t *anonymity, 1142 struct GNUNET_FS_BlockOptions *bo,
1151 uint32_t *priority,
1152 int *do_index, 1143 int *do_index,
1153 struct GNUNET_TIME_Absolute *expirationTime,
1154 void **client_info) 1144 void **client_info)
1155{ 1145{
1156 struct GNUNET_FS_PublishContext*sc = cls; 1146 struct GNUNET_FS_PublishContext*sc = cls;
@@ -1322,10 +1312,8 @@ GNUNET_FS_publish_start (struct GNUNET_FS_Handle *h,
1322 * @param length length of the file or directory 1312 * @param length length of the file or directory
1323 * @param meta metadata for the file or directory (can be modified) 1313 * @param meta metadata for the file or directory (can be modified)
1324 * @param uri pointer to the keywords that will be used for this entry (can be modified) 1314 * @param uri pointer to the keywords that will be used for this entry (can be modified)
1325 * @param anonymity pointer to selected anonymity level (can be modified) 1315 * @param bo block options (can be modified)
1326 * @param priority pointer to selected priority (can be modified)
1327 * @param do_index should we index? 1316 * @param do_index should we index?
1328 * @param expirationTime pointer to selected expiration time (can be modified)
1329 * @param client_info pointer to client context set upon creation (can be modified) 1317 * @param client_info pointer to client context set upon creation (can be modified)
1330 * @return GNUNET_OK to continue (always) 1318 * @return GNUNET_OK to continue (always)
1331 */ 1319 */
@@ -1335,10 +1323,8 @@ fip_signal_stop(void *cls,
1335 uint64_t length, 1323 uint64_t length,
1336 struct GNUNET_CONTAINER_MetaData *meta, 1324 struct GNUNET_CONTAINER_MetaData *meta,
1337 struct GNUNET_FS_Uri **uri, 1325 struct GNUNET_FS_Uri **uri,
1338 uint32_t *anonymity, 1326 struct GNUNET_FS_BlockOptions *bo,
1339 uint32_t *priority,
1340 int *do_index, 1327 int *do_index,
1341 struct GNUNET_TIME_Absolute *expirationTime,
1342 void **client_info) 1328 void **client_info)
1343{ 1329{
1344 struct GNUNET_FS_PublishContext*sc = cls; 1330 struct GNUNET_FS_PublishContext*sc = cls;
@@ -1454,7 +1440,7 @@ struct PublishKskContext
1454 /** 1440 /**
1455 * When should the KBlocks expire? 1441 * When should the KBlocks expire?
1456 */ 1442 */
1457 struct GNUNET_TIME_Absolute expirationTime; 1443 struct GNUNET_FS_BlockOptions bo;
1458 1444
1459 /** 1445 /**
1460 * Size of the serialized metadata. 1446 * Size of the serialized metadata.
@@ -1471,15 +1457,6 @@ struct PublishKskContext
1471 */ 1457 */
1472 unsigned int i; 1458 unsigned int i;
1473 1459
1474 /**
1475 * Anonymity level for the KBlocks.
1476 */
1477 uint32_t anonymity;
1478
1479 /**
1480 * Priority for the KBlocks.
1481 */
1482 uint32_t priority;
1483}; 1460};
1484 1461
1485 1462
@@ -1604,9 +1581,10 @@ publish_ksk_cont (void *cls,
1604 pkc->slen, 1581 pkc->slen,
1605 pkc->cpy, 1582 pkc->cpy,
1606 GNUNET_BLOCK_TYPE_FS_KBLOCK, 1583 GNUNET_BLOCK_TYPE_FS_KBLOCK,
1607 pkc->priority, 1584 pkc->bo.content_priority,
1608 pkc->anonymity, 1585 pkc->bo.anonymity_level,
1609 pkc->expirationTime, 1586 pkc->bo.replication_level,
1587 pkc->bo.expiration_time,
1610 -2, 1, 1588 -2, 1,
1611 GNUNET_CONSTANTS_SERVICE_TIMEOUT, 1589 GNUNET_CONSTANTS_SERVICE_TIMEOUT,
1612 &kb_put_cont, 1590 &kb_put_cont,
@@ -1621,9 +1599,7 @@ publish_ksk_cont (void *cls,
1621 * @param ksk_uri keywords to use 1599 * @param ksk_uri keywords to use
1622 * @param meta metadata to use 1600 * @param meta metadata to use
1623 * @param uri URI to refer to in the KBlock 1601 * @param uri URI to refer to in the KBlock
1624 * @param expirationTime when the KBlock expires 1602 * @param bo per-block options
1625 * @param anonymity anonymity level for the KBlock
1626 * @param priority priority for the KBlock
1627 * @param options publication options 1603 * @param options publication options
1628 * @param cont continuation 1604 * @param cont continuation
1629 * @param cont_cls closure for cont 1605 * @param cont_cls closure for cont
@@ -1633,9 +1609,7 @@ GNUNET_FS_publish_ksk (struct GNUNET_FS_Handle *h,
1633 const struct GNUNET_FS_Uri *ksk_uri, 1609 const struct GNUNET_FS_Uri *ksk_uri,
1634 const struct GNUNET_CONTAINER_MetaData *meta, 1610 const struct GNUNET_CONTAINER_MetaData *meta,
1635 const struct GNUNET_FS_Uri *uri, 1611 const struct GNUNET_FS_Uri *uri,
1636 struct GNUNET_TIME_Absolute expirationTime, 1612 const struct GNUNET_FS_BlockOptions *bo,
1637 uint32_t anonymity,
1638 uint32_t priority,
1639 enum GNUNET_FS_PublishOptions options, 1613 enum GNUNET_FS_PublishOptions options,
1640 GNUNET_FS_PublishContinuation cont, 1614 GNUNET_FS_PublishContinuation cont,
1641 void *cont_cls) 1615 void *cont_cls)
@@ -1649,9 +1623,7 @@ GNUNET_FS_publish_ksk (struct GNUNET_FS_Handle *h,
1649 GNUNET_assert (NULL != uri); 1623 GNUNET_assert (NULL != uri);
1650 pkc = GNUNET_malloc (sizeof (struct PublishKskContext)); 1624 pkc = GNUNET_malloc (sizeof (struct PublishKskContext));
1651 pkc->h = h; 1625 pkc->h = h;
1652 pkc->expirationTime = expirationTime; 1626 pkc->bo = *bo;
1653 pkc->anonymity = anonymity;
1654 pkc->priority = priority;
1655 pkc->cont = cont; 1627 pkc->cont = cont;
1656 pkc->cont_cls = cont_cls; 1628 pkc->cont_cls = cont_cls;
1657 if (0 == (options & GNUNET_FS_PUBLISH_OPTION_SIMULATE_ONLY)) 1629 if (0 == (options & GNUNET_FS_PUBLISH_OPTION_SIMULATE_ONLY))
diff --git a/src/fs/fs_test_lib.c b/src/fs/fs_test_lib.c
index 4af4dae33..c379d91ad 100644
--- a/src/fs/fs_test_lib.c
+++ b/src/fs/fs_test_lib.c
@@ -1,6 +1,6 @@
1/* 1/*
2 This file is part of GNUnet. 2 This file is part of GNUnet.
3 (C) 2010 Christian Grothoff (and other contributing authors) 3 (C) 2010, 2011 Christian Grothoff (and other contributing authors)
4 4
5 GNUnet is free software; you can redistribute it and/or modify 5 GNUnet is free software; you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published 6 it under the terms of the GNU General Public License as published
@@ -637,12 +637,17 @@ GNUNET_FS_TEST_publish (struct GNUNET_FS_TestDaemon *daemon,
637 uint64_t off; 637 uint64_t off;
638 char buf[DBLOCK_SIZE]; 638 char buf[DBLOCK_SIZE];
639 size_t bsize; 639 size_t bsize;
640 640 struct GNUNET_FS_BlockOptions bo;
641
641 GNUNET_assert (daemon->publish_cont == NULL); 642 GNUNET_assert (daemon->publish_cont == NULL);
642 daemon->publish_cont = cont; 643 daemon->publish_cont = cont;
643 daemon->publish_cont_cls = cont_cls; 644 daemon->publish_cont_cls = cont_cls;
644 daemon->publish_seed = seed; 645 daemon->publish_seed = seed;
645 daemon->verbose = verbose; 646 daemon->verbose = verbose;
647 bo.expiration_time = GNUNET_TIME_relative_to_absolute (CONTENT_LIFETIME);
648 bo.anonymity_level = anonymity;
649 bo.content_priority = 42;
650 bo.replication_level = 1;
646 if (GNUNET_YES == do_index) 651 if (GNUNET_YES == do_index)
647 { 652 {
648 GNUNET_assert (daemon->publish_tmp_file == NULL); 653 GNUNET_assert (daemon->publish_tmp_file == NULL);
@@ -678,9 +683,7 @@ GNUNET_FS_TEST_publish (struct GNUNET_FS_TestDaemon *daemon,
678 daemon->publish_tmp_file, 683 daemon->publish_tmp_file,
679 NULL, NULL, 684 NULL, NULL,
680 do_index, 685 do_index,
681 anonymity, 686 &bo);
682 42 /* priority */,
683 GNUNET_TIME_relative_to_absolute (CONTENT_LIFETIME));
684 } 687 }
685 else 688 else
686 { 689 {
@@ -692,9 +695,7 @@ GNUNET_FS_TEST_publish (struct GNUNET_FS_TestDaemon *daemon,
692 NULL, 695 NULL,
693 NULL, 696 NULL,
694 do_index, 697 do_index,
695 anonymity, 698 &bo);
696 42 /* priority */,
697 GNUNET_TIME_relative_to_absolute (CONTENT_LIFETIME));
698 } 699 }
699 daemon->publish_context = GNUNET_FS_publish_start (daemon->fs, 700 daemon->publish_context = GNUNET_FS_publish_start (daemon->fs,
700 fi, 701 fi,
diff --git a/src/fs/gnunet-pseudonym.c b/src/fs/gnunet-pseudonym.c
index b7aba8ef4..769b4239d 100644
--- a/src/fs/gnunet-pseudonym.c
+++ b/src/fs/gnunet-pseudonym.c
@@ -26,11 +26,6 @@
26#include "gnunet_fs_service.h" 26#include "gnunet_fs_service.h"
27 27
28/** 28/**
29 * -a optiton.
30 */
31static unsigned int anonymity;
32
33/**
34 * -C option 29 * -C option
35 */ 30 */
36static char *create_ns; 31static char *create_ns;
@@ -56,9 +51,9 @@ static int print_local_only;
56static struct GNUNET_CONTAINER_MetaData *adv_metadata; 51static struct GNUNET_CONTAINER_MetaData *adv_metadata;
57 52
58/** 53/**
59 * -p option. 54 * Our block options (-p, -r, -a).
60 */ 55 */
61static unsigned int priority = 365; 56static struct GNUNET_FS_BlockOptions bo = { { 2 * 365 * 24 * 60 * 60 * 1000LL }, 1, 365, 1 };
62 57
63/** 58/**
64 * -q option given. 59 * -q option given.
@@ -279,9 +274,7 @@ run (void *cls,
279 ksk_uri, 274 ksk_uri,
280 ns, 275 ns,
281 adv_metadata, 276 adv_metadata,
282 anonymity, 277 &bo,
283 priority,
284 expiration,
285 root_identifier, 278 root_identifier,
286 &post_advertising, 279 &post_advertising,
287 NULL); 280 NULL);
@@ -307,7 +300,8 @@ run (void *cls,
307 300
308 301
309/** 302/**
310 * The main function to inspect GNUnet directories. 303 * The main function to manipulate GNUnet pseudonyms (and publish
304 * to namespaces).
311 * 305 *
312 * @param argc number of arguments from the command line 306 * @param argc number of arguments from the command line
313 * @param argv command line arguments 307 * @param argv command line arguments
@@ -319,7 +313,7 @@ main (int argc, char *const *argv)
319 static const struct GNUNET_GETOPT_CommandLineOption options[] = { 313 static const struct GNUNET_GETOPT_CommandLineOption options[] = {
320 {'a', "anonymity", "LEVEL", 314 {'a', "anonymity", "LEVEL",
321 gettext_noop ("set the desired LEVEL of sender-anonymity"), 315 gettext_noop ("set the desired LEVEL of sender-anonymity"),
322 1, &GNUNET_GETOPT_set_uint, &anonymity}, 316 1, &GNUNET_GETOPT_set_uint, &bo.anonymity_level},
323 {'C', "create", "NAME", 317 {'C', "create", "NAME",
324 gettext_noop 318 gettext_noop
325 ("create or advertise namespace NAME"), 319 ("create or advertise namespace NAME"),
@@ -341,11 +335,14 @@ main (int argc, char *const *argv)
341 0, &GNUNET_GETOPT_set_one, &print_local_only}, 335 0, &GNUNET_GETOPT_set_one, &print_local_only},
342 {'p', "priority", "PRIORITY", 336 {'p', "priority", "PRIORITY",
343 gettext_noop ("use the given PRIORITY for the advertisments"), 337 gettext_noop ("use the given PRIORITY for the advertisments"),
344 1, &GNUNET_GETOPT_set_uint, &priority}, 338 1, &GNUNET_GETOPT_set_uint, &bo.content_priority},
345 {'q', "quiet", NULL, 339 {'q', "quiet", NULL,
346 gettext_noop ("do not print names of remote namespaces"), 340 gettext_noop ("do not print names of remote namespaces"),
347 0, &GNUNET_GETOPT_set_one, &no_remote_printing}, 341 0, &GNUNET_GETOPT_set_one, &no_remote_printing},
348 {'r', "root", "ID", 342 {'r', "replication", "LEVEL",
343 gettext_noop ("set the desired replication LEVEL"),
344 0, &GNUNET_GETOPT_set_uint, &bo.replication_level},
345 {'R', "root", "ID",
349 gettext_noop 346 gettext_noop
350 ("specify ID of the root of the namespace"), 347 ("specify ID of the root of the namespace"),
351 1, &GNUNET_GETOPT_set_string, &root_identifier}, 348 1, &GNUNET_GETOPT_set_string, &root_identifier},
diff --git a/src/fs/gnunet-publish.c b/src/fs/gnunet-publish.c
index 2021a9816..1fbdb9e07 100644
--- a/src/fs/gnunet-publish.c
+++ b/src/fs/gnunet-publish.c
@@ -1,6 +1,6 @@
1/* 1/*
2 This file is part of GNUnet. 2 This file is part of GNUnet.
3 (C) 2001, 2002, 2004, 2005, 2006, 2007, 2009, 2010 Christian Grothoff (and other contributing authors) 3 (C) 2001, 2002, 2004, 2005, 2006, 2007, 2009, 2010, 2011 Christian Grothoff (and other contributing authors)
4 4
5 GNUnet is free software; you can redistribute it and/or modify 5 GNUnet is free software; you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published 6 it under the terms of the GNU General Public License as published
@@ -28,8 +28,6 @@
28#include "platform.h" 28#include "platform.h"
29#include "gnunet_fs_service.h" 29#include "gnunet_fs_service.h"
30 30
31#define DEFAULT_EXPIRATION GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_YEARS, 2)
32
33static int ret; 31static int ret;
34 32
35static int verbose; 33static int verbose;
@@ -46,9 +44,7 @@ static struct GNUNET_FS_Uri *topKeywords;
46 44
47static struct GNUNET_FS_Uri *uri; 45static struct GNUNET_FS_Uri *uri;
48 46
49static unsigned int anonymity = 1; 47static struct GNUNET_FS_BlockOptions bo = { { 2 * 365 * 24 * 60 * 60 * 1000LL }, 1, 365, 1 };
50
51static unsigned int priority = 365;
52 48
53static char *uri_string; 49static char *uri_string;
54 50
@@ -240,10 +236,8 @@ keyword_printer (void *cls,
240 * @param length length of the file or directory 236 * @param length length of the file or directory
241 * @param m metadata for the file or directory (can be modified) 237 * @param m metadata for the file or directory (can be modified)
242 * @param uri pointer to the keywords that will be used for this entry (can be modified) 238 * @param uri pointer to the keywords that will be used for this entry (can be modified)
243 * @param anonymity pointer to selected anonymity level (can be modified) 239 * @param bo block options
244 * @param priority pointer to selected priority (can be modified)
245 * @param do_index should we index? 240 * @param do_index should we index?
246 * @param expirationTime pointer to selected expiration time (can be modified)
247 * @param client_info pointer to client context set upon creation (can be modified) 241 * @param client_info pointer to client context set upon creation (can be modified)
248 * @return GNUNET_OK to continue, GNUNET_NO to remove 242 * @return GNUNET_OK to continue, GNUNET_NO to remove
249 * this entry from the directory, GNUNET_SYSERR 243 * this entry from the directory, GNUNET_SYSERR
@@ -255,10 +249,8 @@ publish_inspector (void *cls,
255 uint64_t length, 249 uint64_t length,
256 struct GNUNET_CONTAINER_MetaData *m, 250 struct GNUNET_CONTAINER_MetaData *m,
257 struct GNUNET_FS_Uri **uri, 251 struct GNUNET_FS_Uri **uri,
258 unsigned int *anonymity, 252 struct GNUNET_FS_BlockOptions *bo,
259 unsigned int *priority,
260 int *do_index, 253 int *do_index,
261 struct GNUNET_TIME_Absolute *expirationTime,
262 void **client_info) 254 void **client_info)
263{ 255{
264 char *fn; 256 char *fn;
@@ -375,9 +367,7 @@ uri_ksk_continuation (void *cls,
375 next_id, 367 next_id,
376 meta, 368 meta,
377 uri, 369 uri,
378 GNUNET_TIME_relative_to_absolute (DEFAULT_EXPIRATION), 370 &bo,
379 anonymity,
380 priority,
381 GNUNET_FS_PUBLISH_OPTION_NONE, 371 GNUNET_FS_PUBLISH_OPTION_NONE,
382 uri_sks_continuation, 372 uri_sks_continuation,
383 NULL); 373 NULL);
@@ -517,9 +507,7 @@ run (void *cls,
517 topKeywords, 507 topKeywords,
518 meta, 508 meta,
519 uri, 509 uri,
520 GNUNET_TIME_relative_to_absolute (DEFAULT_EXPIRATION), 510 &bo,
521 anonymity,
522 priority,
523 GNUNET_FS_PUBLISH_OPTION_NONE, 511 GNUNET_FS_PUBLISH_OPTION_NONE,
524 &uri_ksk_continuation, 512 &uri_ksk_continuation,
525 NULL); 513 NULL);
@@ -557,9 +545,7 @@ run (void *cls,
557 &GNUNET_FS_directory_scanner_default, 545 &GNUNET_FS_directory_scanner_default,
558 plugins, 546 plugins,
559 !do_insert, 547 !do_insert,
560 anonymity, 548 &bo,
561 priority,
562 GNUNET_TIME_relative_to_absolute (DEFAULT_EXPIRATION),
563 &emsg); 549 &emsg);
564 } 550 }
565 else 551 else
@@ -576,9 +562,7 @@ run (void *cls,
576 keywords, 562 keywords,
577 NULL, 563 NULL,
578 !do_insert, 564 !do_insert,
579 anonymity, 565 &bo);
580 priority,
581 GNUNET_TIME_relative_to_absolute (DEFAULT_EXPIRATION));
582 GNUNET_break (fi != NULL); 566 GNUNET_break (fi != NULL);
583 GNUNET_FS_uri_destroy (keywords); 567 GNUNET_FS_uri_destroy (keywords);
584 } 568 }
@@ -644,7 +628,7 @@ main (int argc, char *const *argv)
644 static const struct GNUNET_GETOPT_CommandLineOption options[] = { 628 static const struct GNUNET_GETOPT_CommandLineOption options[] = {
645 {'a', "anonymity", "LEVEL", 629 {'a', "anonymity", "LEVEL",
646 gettext_noop ("set the desired LEVEL of sender-anonymity"), 630 gettext_noop ("set the desired LEVEL of sender-anonymity"),
647 1, &GNUNET_GETOPT_set_uint, &anonymity}, 631 1, &GNUNET_GETOPT_set_uint, &bo.anonymity_level},
648 {'d', "disable-creation-time", NULL, 632 {'d', "disable-creation-time", NULL,
649 gettext_noop 633 gettext_noop
650 ("disable adding the creation time to the metadata of the uploaded file"), 634 ("disable adding the creation time to the metadata of the uploaded file"),
@@ -676,11 +660,14 @@ main (int argc, char *const *argv)
676 1, &GNUNET_GETOPT_set_string, &next_id}, 660 1, &GNUNET_GETOPT_set_string, &next_id},
677 {'p', "priority", "PRIORITY", 661 {'p', "priority", "PRIORITY",
678 gettext_noop ("specify the priority of the content"), 662 gettext_noop ("specify the priority of the content"),
679 1, &GNUNET_GETOPT_set_uint, &priority}, 663 1, &GNUNET_GETOPT_set_uint, &bo.content_priority},
680 {'P', "pseudonym", "NAME", 664 {'P', "pseudonym", "NAME",
681 gettext_noop 665 gettext_noop
682 ("publish the files under the pseudonym NAME (place file into namespace)"), 666 ("publish the files under the pseudonym NAME (place file into namespace)"),
683 1, &GNUNET_GETOPT_set_string, &pseudonym}, 667 1, &GNUNET_GETOPT_set_string, &pseudonym},
668 {'r', "replication", "LEVEL",
669 gettext_noop ("set the desired replication LEVEL"),
670 0, &GNUNET_GETOPT_set_uint, &bo.replication_level},
684 {'s', "simulate-only", NULL, 671 {'s', "simulate-only", NULL,
685 gettext_noop ("only simulate the process but do not do any " 672 gettext_noop ("only simulate the process but do not do any "
686 "actual publishing (useful to compute URIs)"), 673 "actual publishing (useful to compute URIs)"),
diff --git a/src/fs/gnunet-service-fs.c b/src/fs/gnunet-service-fs.c
index 74a88e7b2..caf534140 100644
--- a/src/fs/gnunet-service-fs.c
+++ b/src/fs/gnunet-service-fs.c
@@ -1432,9 +1432,9 @@ gather_migration_blocks (void *cls,
1432 mig_task = GNUNET_SCHEDULER_NO_TASK; 1432 mig_task = GNUNET_SCHEDULER_NO_TASK;
1433 if (dsh != NULL) 1433 if (dsh != NULL)
1434 { 1434 {
1435 mig_qe = GNUNET_DATASTORE_get_random (dsh, 0, UINT_MAX, 1435 mig_qe = GNUNET_DATASTORE_get_for_replication (dsh, 0, UINT_MAX,
1436 GNUNET_TIME_UNIT_FOREVER_REL, 1436 GNUNET_TIME_UNIT_FOREVER_REL,
1437 &process_migration_content, NULL); 1437 &process_migration_content, NULL);
1438 GNUNET_assert (mig_qe != NULL); 1438 GNUNET_assert (mig_qe != NULL);
1439 } 1439 }
1440} 1440}
@@ -3764,8 +3764,10 @@ handle_p2p_put (void *cls,
3764 GNUNET_DATASTORE_put (dsh, 3764 GNUNET_DATASTORE_put (dsh,
3765 0, &query, dsize, &put[1], 3765 0, &query, dsize, &put[1],
3766 type, prq.priority, 1 /* anonymity */, 3766 type, prq.priority, 1 /* anonymity */,
3767 0 /* replication */,
3767 expiration, 3768 expiration,
3768 1 + prq.priority, MAX_DATASTORE_QUEUE, 3769 1 + prq.priority,
3770 MAX_DATASTORE_QUEUE,
3769 GNUNET_CONSTANTS_SERVICE_TIMEOUT, 3771 GNUNET_CONSTANTS_SERVICE_TIMEOUT,
3770 &put_migration_continuation, 3772 &put_migration_continuation,
3771 start); 3773 start);
diff --git a/src/fs/gnunet-service-fs_new.c b/src/fs/gnunet-service-fs_new.c
index acfb95600..20a98e6f2 100644
--- a/src/fs/gnunet-service-fs_new.c
+++ b/src/fs/gnunet-service-fs_new.c
@@ -523,7 +523,7 @@ main_init (struct GNUNET_SERVER_Handle *server,
523 }; 523 };
524 524
525 GSF_core = GNUNET_CORE_connect (GSF_cfg, 525 GSF_core = GNUNET_CORE_connect (GSF_cfg,
526 1, /* larger? */ 526 2, /* larger? */
527 NULL, 527 NULL,
528 &peer_init_handler, 528 &peer_init_handler,
529 &peer_connect_handler, 529 &peer_connect_handler,
diff --git a/src/fs/gnunet-service-fs_pr.c b/src/fs/gnunet-service-fs_pr.c
index f6b31c4e2..c44a658df 100644
--- a/src/fs/gnunet-service-fs_pr.c
+++ b/src/fs/gnunet-service-fs_pr.c
@@ -915,6 +915,7 @@ handle_dht_reply (void *cls,
915 GNUNET_DATASTORE_put (GSF_dsh, 915 GNUNET_DATASTORE_put (GSF_dsh,
916 0, key, size, data, 916 0, key, size, data,
917 type, prq.priority, 1 /* anonymity */, 917 type, prq.priority, 1 /* anonymity */,
918 0 /* replication */,
918 exp, 919 exp,
919 1 + prq.priority, MAX_DATASTORE_QUEUE, 920 1 + prq.priority, MAX_DATASTORE_QUEUE,
920 GNUNET_CONSTANTS_SERVICE_TIMEOUT, 921 GNUNET_CONSTANTS_SERVICE_TIMEOUT,
@@ -1237,6 +1238,7 @@ GSF_handle_p2p_content_ (struct GSF_ConnectedPeer *cp,
1237 GNUNET_DATASTORE_put (GSF_dsh, 1238 GNUNET_DATASTORE_put (GSF_dsh,
1238 0, &query, dsize, &put[1], 1239 0, &query, dsize, &put[1],
1239 type, prq.priority, 1 /* anonymity */, 1240 type, prq.priority, 1 /* anonymity */,
1241 0 /* replication */,
1240 expiration, 1242 expiration,
1241 1 + prq.priority, MAX_DATASTORE_QUEUE, 1243 1 + prq.priority, MAX_DATASTORE_QUEUE,
1242 GNUNET_CONSTANTS_SERVICE_TIMEOUT, 1244 GNUNET_CONSTANTS_SERVICE_TIMEOUT,
diff --git a/src/fs/gnunet-service-fs_push.c b/src/fs/gnunet-service-fs_push.c
index 38d916832..094489273 100644
--- a/src/fs/gnunet-service-fs_push.c
+++ b/src/fs/gnunet-service-fs_push.c
@@ -576,10 +576,10 @@ gather_migration_blocks (void *cls,
576 return; 576 return;
577 if (GSF_dsh != NULL) 577 if (GSF_dsh != NULL)
578 { 578 {
579 mig_qe = GNUNET_DATASTORE_get_random (GSF_dsh, 579 mig_qe = GNUNET_DATASTORE_get_for_replication (GSF_dsh,
580 0, UINT_MAX, 580 0, UINT_MAX,
581 GNUNET_TIME_UNIT_FOREVER_REL, 581 GNUNET_TIME_UNIT_FOREVER_REL,
582 &process_migration_content, NULL); 582 &process_migration_content, NULL);
583 GNUNET_assert (mig_qe != NULL); 583 GNUNET_assert (mig_qe != NULL);
584 } 584 }
585} 585}
diff --git a/src/fs/test_fs_download.c b/src/fs/test_fs_download.c
index 5091c5a61..35592225a 100644
--- a/src/fs/test_fs_download.c
+++ b/src/fs/test_fs_download.c
@@ -295,6 +295,7 @@ run (void *cls,
295 struct GNUNET_FS_Uri *kuri; 295 struct GNUNET_FS_Uri *kuri;
296 struct GNUNET_FS_FileInformation *fi; 296 struct GNUNET_FS_FileInformation *fi;
297 size_t i; 297 size_t i;
298 struct GNUNET_FS_BlockOptions bo;
298 299
299 setup_peer (&p1, "test_fs_download_data.conf"); 300 setup_peer (&p1, "test_fs_download_data.conf");
300 fs = GNUNET_FS_start (cfg, 301 fs = GNUNET_FS_start (cfg,
@@ -309,6 +310,10 @@ run (void *cls,
309 buf[i] = GNUNET_CRYPTO_random_u32 (GNUNET_CRYPTO_QUALITY_WEAK, 256); 310 buf[i] = GNUNET_CRYPTO_random_u32 (GNUNET_CRYPTO_QUALITY_WEAK, 256);
310 meta = GNUNET_CONTAINER_meta_data_create (); 311 meta = GNUNET_CONTAINER_meta_data_create ();
311 kuri = GNUNET_FS_uri_ksk_create_from_args (2, keywords); 312 kuri = GNUNET_FS_uri_ksk_create_from_args (2, keywords);
313 bo.content_priority = 42;
314 bo.anonymity_level = 1;
315 bo.replication_level = 0;
316 bo.expiration_time = GNUNET_TIME_relative_to_absolute (LIFETIME);
312 fi = GNUNET_FS_file_information_create_from_data (fs, 317 fi = GNUNET_FS_file_information_create_from_data (fs,
313 "publish-context", 318 "publish-context",
314 FILESIZE, 319 FILESIZE,
@@ -316,9 +321,7 @@ run (void *cls,
316 kuri, 321 kuri,
317 meta, 322 meta,
318 GNUNET_NO, 323 GNUNET_NO,
319 1, 324 &bo);
320 42,
321 GNUNET_TIME_relative_to_absolute (LIFETIME));
322 GNUNET_FS_uri_destroy (kuri); 325 GNUNET_FS_uri_destroy (kuri);
323 GNUNET_CONTAINER_meta_data_destroy (meta); 326 GNUNET_CONTAINER_meta_data_destroy (meta);
324 GNUNET_assert (NULL != fi); 327 GNUNET_assert (NULL != fi);
diff --git a/src/fs/test_fs_download_indexed.c b/src/fs/test_fs_download_indexed.c
index 33ca42a16..afb544f51 100644
--- a/src/fs/test_fs_download_indexed.c
+++ b/src/fs/test_fs_download_indexed.c
@@ -294,6 +294,7 @@ run (void *cls,
294 struct GNUNET_CONTAINER_MetaData *meta; 294 struct GNUNET_CONTAINER_MetaData *meta;
295 struct GNUNET_FS_Uri *kuri; 295 struct GNUNET_FS_Uri *kuri;
296 struct GNUNET_FS_FileInformation *fi; 296 struct GNUNET_FS_FileInformation *fi;
297 struct GNUNET_FS_BlockOptions bo;
297 size_t i; 298 size_t i;
298 299
299 setup_peer (&p1, "test_fs_download_data.conf"); 300 setup_peer (&p1, "test_fs_download_data.conf");
@@ -317,15 +318,17 @@ run (void *cls,
317 GNUNET_free (buf); 318 GNUNET_free (buf);
318 meta = GNUNET_CONTAINER_meta_data_create (); 319 meta = GNUNET_CONTAINER_meta_data_create ();
319 kuri = GNUNET_FS_uri_ksk_create_from_args (2, keywords); 320 kuri = GNUNET_FS_uri_ksk_create_from_args (2, keywords);
321 bo.content_priority = 42;
322 bo.anonymity_level = 1;
323 bo.replication_level = 0;
324 bo.expiration_time = GNUNET_TIME_relative_to_absolute (LIFETIME);
320 fi = GNUNET_FS_file_information_create_from_file (fs, 325 fi = GNUNET_FS_file_information_create_from_file (fs,
321 "publish-context", 326 "publish-context",
322 fn1, 327 fn1,
323 kuri, 328 kuri,
324 meta, 329 meta,
325 GNUNET_YES, 330 GNUNET_YES,
326 1, 331 &bo);
327 42,
328 GNUNET_TIME_relative_to_absolute (LIFETIME));
329 GNUNET_FS_uri_destroy (kuri); 332 GNUNET_FS_uri_destroy (kuri);
330 GNUNET_CONTAINER_meta_data_destroy (meta); 333 GNUNET_CONTAINER_meta_data_destroy (meta);
331 GNUNET_assert (NULL != fi); 334 GNUNET_assert (NULL != fi);
diff --git a/src/fs/test_fs_download_persistence.c b/src/fs/test_fs_download_persistence.c
index 0ea7a5524..035cbb55e 100644
--- a/src/fs/test_fs_download_persistence.c
+++ b/src/fs/test_fs_download_persistence.c
@@ -359,6 +359,7 @@ run (void *cls,
359 struct GNUNET_FS_Uri *kuri; 359 struct GNUNET_FS_Uri *kuri;
360 struct GNUNET_FS_FileInformation *fi; 360 struct GNUNET_FS_FileInformation *fi;
361 size_t i; 361 size_t i;
362 struct GNUNET_FS_BlockOptions bo;
362 363
363 cfg = c; 364 cfg = c;
364 setup_peer (&p1, "test_fs_download_data.conf"); 365 setup_peer (&p1, "test_fs_download_data.conf");
@@ -374,6 +375,10 @@ run (void *cls,
374 buf[i] = GNUNET_CRYPTO_random_u32 (GNUNET_CRYPTO_QUALITY_WEAK, 256); 375 buf[i] = GNUNET_CRYPTO_random_u32 (GNUNET_CRYPTO_QUALITY_WEAK, 256);
375 meta = GNUNET_CONTAINER_meta_data_create (); 376 meta = GNUNET_CONTAINER_meta_data_create ();
376 kuri = GNUNET_FS_uri_ksk_create_from_args (2, keywords); 377 kuri = GNUNET_FS_uri_ksk_create_from_args (2, keywords);
378 bo.content_priority = 42;
379 bo.anonymity_level = 1;
380 bo.replication_level = 0;
381 bo.expiration_time = GNUNET_TIME_relative_to_absolute (LIFETIME);
377 fi = GNUNET_FS_file_information_create_from_data (fs, 382 fi = GNUNET_FS_file_information_create_from_data (fs,
378 "publish-context", 383 "publish-context",
379 FILESIZE, 384 FILESIZE,
@@ -381,9 +386,7 @@ run (void *cls,
381 kuri, 386 kuri,
382 meta, 387 meta,
383 GNUNET_NO, 388 GNUNET_NO,
384 1, 389 &bo);
385 42,
386 GNUNET_TIME_relative_to_absolute (LIFETIME));
387 GNUNET_FS_uri_destroy (kuri); 390 GNUNET_FS_uri_destroy (kuri);
388 GNUNET_CONTAINER_meta_data_destroy (meta); 391 GNUNET_CONTAINER_meta_data_destroy (meta);
389 GNUNET_assert (NULL != fi); 392 GNUNET_assert (NULL != fi);
diff --git a/src/fs/test_fs_file_information.c b/src/fs/test_fs_file_information.c
index 914dbad9f..00e3c2211 100644
--- a/src/fs/test_fs_file_information.c
+++ b/src/fs/test_fs_file_information.c
@@ -55,10 +55,8 @@ mycleaner(void *cls,
55 uint64_t length, 55 uint64_t length,
56 struct GNUNET_CONTAINER_MetaData *meta, 56 struct GNUNET_CONTAINER_MetaData *meta,
57 struct GNUNET_FS_Uri **uri, 57 struct GNUNET_FS_Uri **uri,
58 uint32_t *anonymity, 58 struct GNUNET_FS_BlockOptions *bo,
59 uint32_t *priority,
60 int *do_index, 59 int *do_index,
61 struct GNUNET_TIME_Absolute *expirationTime,
62 void **client_info) 60 void **client_info)
63{ 61{
64 return GNUNET_OK; 62 return GNUNET_OK;
@@ -85,6 +83,7 @@ run (void *cls,
85 struct GNUNET_FS_FileInformation *fidir; 83 struct GNUNET_FS_FileInformation *fidir;
86 struct GNUNET_FS_Handle *fs; 84 struct GNUNET_FS_Handle *fs;
87 size_t i; 85 size_t i;
86 struct GNUNET_FS_BlockOptions bo;
88 87
89 fs = GNUNET_FS_start (cfg, "test-fs-file-information", NULL, NULL, 88 fs = GNUNET_FS_start (cfg, "test-fs-file-information", NULL, NULL,
90 GNUNET_FS_FLAGS_NONE, 89 GNUNET_FS_FLAGS_NONE,
@@ -112,16 +111,18 @@ run (void *cls,
112 GNUNET_free (buf); 111 GNUNET_free (buf);
113 112
114 meta = GNUNET_CONTAINER_meta_data_create (); 113 meta = GNUNET_CONTAINER_meta_data_create ();
115 kuri = GNUNET_FS_uri_ksk_create_from_args (2, keywords); 114 kuri = GNUNET_FS_uri_ksk_create_from_args (2, keywords);
115 bo.content_priority = 42;
116 bo.anonymity_level = 1;
117 bo.replication_level = 0;
118 bo.expiration_time = GNUNET_TIME_relative_to_absolute (LIFETIME);
116 fi1 = GNUNET_FS_file_information_create_from_file (fs, 119 fi1 = GNUNET_FS_file_information_create_from_file (fs,
117 "file_information-context1", 120 "file_information-context1",
118 fn1, 121 fn1,
119 kuri, 122 kuri,
120 meta, 123 meta,
121 GNUNET_YES, 124 GNUNET_YES,
122 1, 125 &bo);
123 42,
124 GNUNET_TIME_relative_to_absolute (LIFETIME));
125 GNUNET_assert (fi1 != NULL); 126 GNUNET_assert (fi1 != NULL);
126 fi2 = GNUNET_FS_file_information_create_from_file (fs, 127 fi2 = GNUNET_FS_file_information_create_from_file (fs,
127 "file_information-context2", 128 "file_information-context2",
@@ -129,17 +130,13 @@ run (void *cls,
129 kuri, 130 kuri,
130 meta, 131 meta,
131 GNUNET_YES, 132 GNUNET_YES,
132 1, 133 &bo);
133 42,
134 GNUNET_TIME_relative_to_absolute (LIFETIME));
135 GNUNET_assert (fi2 != NULL); 134 GNUNET_assert (fi2 != NULL);
136 fidir = GNUNET_FS_file_information_create_empty_directory (fs, 135 fidir = GNUNET_FS_file_information_create_empty_directory (fs,
137 "file_information-context-dir", 136 "file_information-context-dir",
138 kuri, 137 kuri,
139 meta, 138 meta,
140 1, 139 &bo);
141 42,
142 GNUNET_TIME_relative_to_absolute (LIFETIME));
143 GNUNET_assert (GNUNET_OK == GNUNET_FS_file_information_add (fidir, fi1)); 140 GNUNET_assert (GNUNET_OK == GNUNET_FS_file_information_add (fidir, fi1));
144 GNUNET_assert (GNUNET_OK == GNUNET_FS_file_information_add (fidir, fi2)); 141 GNUNET_assert (GNUNET_OK == GNUNET_FS_file_information_add (fidir, fi2));
145 GNUNET_FS_uri_destroy (kuri); 142 GNUNET_FS_uri_destroy (kuri);
diff --git a/src/fs/test_fs_list_indexed.c b/src/fs/test_fs_list_indexed.c
index ec3d6fecd..d53732eaf 100644
--- a/src/fs/test_fs_list_indexed.c
+++ b/src/fs/test_fs_list_indexed.c
@@ -239,6 +239,7 @@ run (void *cls,
239 struct GNUNET_FS_FileInformation *fi2; 239 struct GNUNET_FS_FileInformation *fi2;
240 struct GNUNET_FS_FileInformation *fidir; 240 struct GNUNET_FS_FileInformation *fidir;
241 size_t i; 241 size_t i;
242 struct GNUNET_FS_BlockOptions bo;
242 243
243 setup_peer (&p1, "test_fs_list_indexed_data.conf"); 244 setup_peer (&p1, "test_fs_list_indexed_data.conf");
244 fs = GNUNET_FS_start (cfg, 245 fs = GNUNET_FS_start (cfg,
@@ -272,33 +273,33 @@ run (void *cls,
272 273
273 meta = GNUNET_CONTAINER_meta_data_create (); 274 meta = GNUNET_CONTAINER_meta_data_create ();
274 kuri = GNUNET_FS_uri_ksk_create_from_args (2, keywords); 275 kuri = GNUNET_FS_uri_ksk_create_from_args (2, keywords);
276 bo.content_priority = 42;
277 bo.anonymity_level = 1;
278 bo.replication_level = 0;
279 bo.expiration_time = GNUNET_TIME_relative_to_absolute (LIFETIME);
275 fi1 = GNUNET_FS_file_information_create_from_file (fs, 280 fi1 = GNUNET_FS_file_information_create_from_file (fs,
276 "list_indexed-context1", 281 "list_indexed-context1",
277 fn1, 282 fn1,
278 kuri, 283 kuri,
279 meta, 284 meta,
280 GNUNET_YES, 285 GNUNET_YES,
281 1, 286 &bo);
282 42,
283 GNUNET_TIME_relative_to_absolute (LIFETIME));
284 GNUNET_assert (NULL != fi1); 287 GNUNET_assert (NULL != fi1);
288 bo.anonymity_level = 2;
285 fi2 = GNUNET_FS_file_information_create_from_file (fs, 289 fi2 = GNUNET_FS_file_information_create_from_file (fs,
286 "list_indexed-context2", 290 "list_indexed-context2",
287 fn2, 291 fn2,
288 kuri, 292 kuri,
289 meta, 293 meta,
290 GNUNET_YES, 294 GNUNET_YES,
291 2, 295 &bo);
292 42,
293 GNUNET_TIME_relative_to_absolute (LIFETIME));
294 GNUNET_assert (NULL != fi2); 296 GNUNET_assert (NULL != fi2);
297 bo.anonymity_level = 3;
295 fidir = GNUNET_FS_file_information_create_empty_directory (fs, 298 fidir = GNUNET_FS_file_information_create_empty_directory (fs,
296 "list_indexed-context-dir", 299 "list_indexed-context-dir",
297 kuri, 300 kuri,
298 meta, 301 meta,
299 3, 302 &bo);
300 42,
301 GNUNET_TIME_relative_to_absolute (LIFETIME));
302 GNUNET_assert (GNUNET_OK == GNUNET_FS_file_information_add (fidir, fi1)); 303 GNUNET_assert (GNUNET_OK == GNUNET_FS_file_information_add (fidir, fi1));
303 GNUNET_assert (GNUNET_OK == GNUNET_FS_file_information_add (fidir, fi2)); 304 GNUNET_assert (GNUNET_OK == GNUNET_FS_file_information_add (fidir, fi2));
304 GNUNET_FS_uri_destroy (kuri); 305 GNUNET_FS_uri_destroy (kuri);
diff --git a/src/fs/test_fs_namespace.c b/src/fs/test_fs_namespace.c
index 11b6ef8c2..02bb62807 100644
--- a/src/fs/test_fs_namespace.c
+++ b/src/fs/test_fs_namespace.c
@@ -275,22 +275,24 @@ sks_cont (void *cls,
275 const char *emsg) 275 const char *emsg)
276{ 276{
277 struct GNUNET_CONTAINER_MetaData *meta; 277 struct GNUNET_CONTAINER_MetaData *meta;
278 struct GNUNET_TIME_Absolute expiration;
279 struct GNUNET_FS_Uri *ksk_uri; 278 struct GNUNET_FS_Uri *ksk_uri;
280 char * msg; 279 char * msg;
280 struct GNUNET_FS_BlockOptions bo;
281 281
282 expiration = GNUNET_TIME_relative_to_absolute (GNUNET_TIME_UNIT_MINUTES);
283 meta = GNUNET_CONTAINER_meta_data_create (); 282 meta = GNUNET_CONTAINER_meta_data_create ();
284 msg = NULL; 283 msg = NULL;
285 ksk_uri = GNUNET_FS_uri_parse ("gnunet://fs/ksk/ns-search", &msg); 284 ksk_uri = GNUNET_FS_uri_parse ("gnunet://fs/ksk/ns-search", &msg);
286 GNUNET_assert (NULL == msg); 285 GNUNET_assert (NULL == msg);
287 ksk_expect_uri = GNUNET_FS_uri_dup (uri); 286 ksk_expect_uri = GNUNET_FS_uri_dup (uri);
287 bo.content_priority = 1;
288 bo.anonymity_level = 1;
289 bo.replication_level = 0;
290 bo.expiration_time = GNUNET_TIME_relative_to_absolute (GNUNET_TIME_UNIT_MINUTES);
288 GNUNET_FS_publish_ksk (fs, 291 GNUNET_FS_publish_ksk (fs,
289 ksk_uri, 292 ksk_uri,
290 meta, 293 meta,
291 uri, 294 uri,
292 expiration, 295 &bo,
293 1, 1,
294 GNUNET_FS_PUBLISH_OPTION_NONE, 296 GNUNET_FS_PUBLISH_OPTION_NONE,
295 &publish_cont, 297 &publish_cont,
296 NULL); 298 NULL);
@@ -306,7 +308,7 @@ adv_cont (void *cls,
306{ 308{
307 struct GNUNET_CONTAINER_MetaData *meta; 309 struct GNUNET_CONTAINER_MetaData *meta;
308 struct GNUNET_FS_Namespace *ns; 310 struct GNUNET_FS_Namespace *ns;
309 struct GNUNET_TIME_Absolute expiration; 311 struct GNUNET_FS_BlockOptions bo;
310 312
311 if (NULL != emsg) 313 if (NULL != emsg)
312 { 314 {
@@ -315,21 +317,23 @@ adv_cont (void *cls,
315 GNUNET_FS_stop (fs); 317 GNUNET_FS_stop (fs);
316 return; 318 return;
317 } 319 }
318 expiration = GNUNET_TIME_relative_to_absolute (GNUNET_TIME_UNIT_MINUTES);
319 ns = GNUNET_FS_namespace_create (fs, 320 ns = GNUNET_FS_namespace_create (fs,
320 "testNamespace"); 321 "testNamespace");
321 GNUNET_assert (NULL != ns); 322 GNUNET_assert (NULL != ns);
322 meta = GNUNET_CONTAINER_meta_data_create (); 323 meta = GNUNET_CONTAINER_meta_data_create ();
323 GNUNET_assert (NULL == emsg); 324 GNUNET_assert (NULL == emsg);
324 sks_expect_uri = GNUNET_FS_uri_dup (uri); 325 sks_expect_uri = GNUNET_FS_uri_dup (uri);
326 bo.content_priority = 1;
327 bo.anonymity_level = 1;
328 bo.replication_level = 0;
329 bo.expiration_time = GNUNET_TIME_relative_to_absolute (GNUNET_TIME_UNIT_MINUTES);
325 GNUNET_FS_publish_sks (fs, 330 GNUNET_FS_publish_sks (fs,
326 ns, 331 ns,
327 "this", 332 "this",
328 "next", 333 "next",
329 meta, 334 meta,
330 uri, /* FIXME: this is non-sense (use CHK URI!?) */ 335 uri, /* FIXME: this is non-sense (use CHK URI!?) */
331 expiration, 336 &bo,
332 1, 1,
333 GNUNET_FS_PUBLISH_OPTION_NONE, 337 GNUNET_FS_PUBLISH_OPTION_NONE,
334 &sks_cont, 338 &sks_cont,
335 NULL); 339 NULL);
@@ -357,7 +361,7 @@ static void
357testNamespace () 361testNamespace ()
358{ 362{
359 struct GNUNET_FS_Namespace *ns; 363 struct GNUNET_FS_Namespace *ns;
360 struct GNUNET_TIME_Absolute expiration; 364 struct GNUNET_FS_BlockOptions bo;
361 struct GNUNET_CONTAINER_MetaData *meta; 365 struct GNUNET_CONTAINER_MetaData *meta;
362 struct GNUNET_FS_Uri *ksk_uri; 366 struct GNUNET_FS_Uri *ksk_uri;
363 int ok; 367 int ok;
@@ -375,15 +379,17 @@ testNamespace ()
375 err = 1; 379 err = 1;
376 return; 380 return;
377 } 381 }
378 expiration = GNUNET_TIME_relative_to_absolute (GNUNET_TIME_UNIT_MINUTES);
379 meta = GNUNET_CONTAINER_meta_data_create (); 382 meta = GNUNET_CONTAINER_meta_data_create ();
380 ksk_uri = GNUNET_FS_uri_parse ("gnunet://fs/ksk/testnsa", NULL); 383 ksk_uri = GNUNET_FS_uri_parse ("gnunet://fs/ksk/testnsa", NULL);
384 bo.content_priority = 1;
385 bo.anonymity_level = 1;
386 bo.replication_level = 0;
387 bo.expiration_time = GNUNET_TIME_relative_to_absolute (GNUNET_TIME_UNIT_MINUTES);
381 GNUNET_FS_namespace_advertise (fs, 388 GNUNET_FS_namespace_advertise (fs,
382 ksk_uri, 389 ksk_uri,
383 ns, 390 ns,
384 meta, 391 meta,
385 1, 1, 392 &bo,
386 expiration,
387 "root", 393 "root",
388 &adv_cont, NULL); 394 &adv_cont, NULL);
389 kill_task = GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_UNIT_MINUTES, 395 kill_task = GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_UNIT_MINUTES,
diff --git a/src/fs/test_fs_namespace_list_updateable.c b/src/fs/test_fs_namespace_list_updateable.c
index 359800f56..dda7bb4f2 100644
--- a/src/fs/test_fs_namespace_list_updateable.c
+++ b/src/fs/test_fs_namespace_list_updateable.c
@@ -40,14 +40,14 @@ static int err;
40 40
41static struct GNUNET_FS_Namespace *ns; 41static struct GNUNET_FS_Namespace *ns;
42 42
43static struct GNUNET_TIME_Absolute expiration;
44
45static struct GNUNET_CONTAINER_MetaData *meta; 43static struct GNUNET_CONTAINER_MetaData *meta;
46 44
47static struct GNUNET_FS_Uri *uri_this; 45static struct GNUNET_FS_Uri *uri_this;
48 46
49static struct GNUNET_FS_Uri *uri_next; 47static struct GNUNET_FS_Uri *uri_next;
50 48
49static struct GNUNET_FS_BlockOptions bo;
50
51 51
52struct PeerContext 52struct PeerContext
53{ 53{
@@ -172,6 +172,7 @@ sks_cont_this (void *cls,
172 const struct GNUNET_FS_Uri *uri, 172 const struct GNUNET_FS_Uri *uri,
173 const char *emsg) 173 const char *emsg)
174{ 174{
175
175 GNUNET_assert (NULL == emsg); 176 GNUNET_assert (NULL == emsg);
176 err = 1; 177 err = 1;
177 GNUNET_FS_namespace_list_updateable (ns, 178 GNUNET_FS_namespace_list_updateable (ns,
@@ -184,8 +185,7 @@ sks_cont_this (void *cls,
184 "future", 185 "future",
185 meta, 186 meta,
186 uri_next, 187 uri_next,
187 expiration, 188 &bo,
188 1, 1,
189 GNUNET_FS_PUBLISH_OPTION_NONE, 189 GNUNET_FS_PUBLISH_OPTION_NONE,
190 &sks_cont_next, 190 &sks_cont_next,
191 NULL); 191 NULL);
@@ -201,7 +201,10 @@ testNamespace ()
201 ns = GNUNET_FS_namespace_create (fs, 201 ns = GNUNET_FS_namespace_create (fs,
202 "testNamespace"); 202 "testNamespace");
203 GNUNET_assert (NULL != ns); 203 GNUNET_assert (NULL != ns);
204 expiration = GNUNET_TIME_relative_to_absolute (GNUNET_TIME_UNIT_MINUTES); 204 bo.content_priority = 1;
205 bo.anonymity_level = 1;
206 bo.replication_level = 0;
207 bo.expiration_time = GNUNET_TIME_relative_to_absolute (GNUNET_TIME_UNIT_MINUTES);
205 meta = GNUNET_CONTAINER_meta_data_create (); 208 meta = GNUNET_CONTAINER_meta_data_create ();
206 209
207 uri_this = 210 uri_this =
@@ -214,8 +217,7 @@ testNamespace ()
214 "next", 217 "next",
215 meta, 218 meta,
216 uri_this, 219 uri_this,
217 expiration, 220 &bo,
218 1, 1,
219 GNUNET_FS_PUBLISH_OPTION_NONE, 221 GNUNET_FS_PUBLISH_OPTION_NONE,
220 &sks_cont_this, 222 &sks_cont_this,
221 NULL); 223 NULL);
diff --git a/src/fs/test_fs_publish.c b/src/fs/test_fs_publish.c
index 99d4b6710..b206fb415 100644
--- a/src/fs/test_fs_publish.c
+++ b/src/fs/test_fs_publish.c
@@ -225,6 +225,7 @@ run (void *cls,
225 struct GNUNET_FS_FileInformation *fi2; 225 struct GNUNET_FS_FileInformation *fi2;
226 struct GNUNET_FS_FileInformation *fidir; 226 struct GNUNET_FS_FileInformation *fidir;
227 size_t i; 227 size_t i;
228 struct GNUNET_FS_BlockOptions bo;
228 229
229 setup_peer (&p1, "test_fs_publish_data.conf"); 230 setup_peer (&p1, "test_fs_publish_data.conf");
230 fs = GNUNET_FS_start (cfg, 231 fs = GNUNET_FS_start (cfg,
@@ -258,33 +259,35 @@ run (void *cls,
258 259
259 meta = GNUNET_CONTAINER_meta_data_create (); 260 meta = GNUNET_CONTAINER_meta_data_create ();
260 kuri = GNUNET_FS_uri_ksk_create_from_args (2, keywords); 261 kuri = GNUNET_FS_uri_ksk_create_from_args (2, keywords);
262 bo.content_priority = 42;
263 bo.anonymity_level = 1;
264 bo.replication_level = 0;
265 bo.expiration_time = GNUNET_TIME_relative_to_absolute (LIFETIME);
266
261 fi1 = GNUNET_FS_file_information_create_from_file (fs, 267 fi1 = GNUNET_FS_file_information_create_from_file (fs,
262 "publish-context1", 268 "publish-context1",
263 fn1, 269 fn1,
264 kuri, 270 kuri,
265 meta, 271 meta,
266 GNUNET_YES, 272 GNUNET_YES,
267 1, 273 &bo);
268 42, 274
269 GNUNET_TIME_relative_to_absolute (LIFETIME));
270 GNUNET_assert (NULL != fi1); 275 GNUNET_assert (NULL != fi1);
276 bo.anonymity_level = 2;
271 fi2 = GNUNET_FS_file_information_create_from_file (fs, 277 fi2 = GNUNET_FS_file_information_create_from_file (fs,
272 "publish-context2", 278 "publish-context2",
273 fn2, 279 fn2,
274 kuri, 280 kuri,
275 meta, 281 meta,
276 GNUNET_YES, 282 GNUNET_YES,
277 2, 283 &bo);
278 42,
279 GNUNET_TIME_relative_to_absolute (LIFETIME));
280 GNUNET_assert (NULL != fi2); 284 GNUNET_assert (NULL != fi2);
285 bo.anonymity_level = 3;
281 fidir = GNUNET_FS_file_information_create_empty_directory (fs, 286 fidir = GNUNET_FS_file_information_create_empty_directory (fs,
282 "publish-context-dir", 287 "publish-context-dir",
283 kuri, 288 kuri,
284 meta, 289 meta,
285 3, 290 &bo);
286 42,
287 GNUNET_TIME_relative_to_absolute (LIFETIME));
288 GNUNET_assert (GNUNET_OK == GNUNET_FS_file_information_add (fidir, fi1)); 291 GNUNET_assert (GNUNET_OK == GNUNET_FS_file_information_add (fidir, fi1));
289 GNUNET_assert (GNUNET_OK == GNUNET_FS_file_information_add (fidir, fi2)); 292 GNUNET_assert (GNUNET_OK == GNUNET_FS_file_information_add (fidir, fi2));
290 GNUNET_FS_uri_destroy (kuri); 293 GNUNET_FS_uri_destroy (kuri);
diff --git a/src/fs/test_fs_publish_persistence.c b/src/fs/test_fs_publish_persistence.c
index 4a84bf9dc..1610c25c1 100644
--- a/src/fs/test_fs_publish_persistence.c
+++ b/src/fs/test_fs_publish_persistence.c
@@ -282,6 +282,7 @@ run (void *cls,
282 struct GNUNET_FS_FileInformation *fi2; 282 struct GNUNET_FS_FileInformation *fi2;
283 struct GNUNET_FS_FileInformation *fidir; 283 struct GNUNET_FS_FileInformation *fidir;
284 size_t i; 284 size_t i;
285 struct GNUNET_FS_BlockOptions bo;
285 286
286 cfg = c; 287 cfg = c;
287 setup_peer (&p1, "test_fs_publish_data.conf"); 288 setup_peer (&p1, "test_fs_publish_data.conf");
@@ -316,33 +317,33 @@ run (void *cls,
316 317
317 meta = GNUNET_CONTAINER_meta_data_create (); 318 meta = GNUNET_CONTAINER_meta_data_create ();
318 kuri = GNUNET_FS_uri_ksk_create_from_args (2, keywords); 319 kuri = GNUNET_FS_uri_ksk_create_from_args (2, keywords);
320 bo.content_priority = 42;
321 bo.anonymity_level = 1;
322 bo.replication_level = 0;
323 bo.expiration_time = GNUNET_TIME_relative_to_absolute (LIFETIME);
319 fi1 = GNUNET_FS_file_information_create_from_file (fs, 324 fi1 = GNUNET_FS_file_information_create_from_file (fs,
320 "publish-context1", 325 "publish-context1",
321 fn1, 326 fn1,
322 kuri, 327 kuri,
323 meta, 328 meta,
324 GNUNET_YES, 329 GNUNET_YES,
325 1, 330 &bo);
326 42,
327 GNUNET_TIME_relative_to_absolute (LIFETIME));
328 GNUNET_assert (NULL != fi1); 331 GNUNET_assert (NULL != fi1);
332 bo.anonymity_level = 2;
329 fi2 = GNUNET_FS_file_information_create_from_file (fs, 333 fi2 = GNUNET_FS_file_information_create_from_file (fs,
330 "publish-context2", 334 "publish-context2",
331 fn2, 335 fn2,
332 kuri, 336 kuri,
333 meta, 337 meta,
334 GNUNET_YES, 338 GNUNET_YES,
335 2, 339 &bo);
336 42,
337 GNUNET_TIME_relative_to_absolute (LIFETIME));
338 GNUNET_assert (NULL != fi2); 340 GNUNET_assert (NULL != fi2);
341 bo.anonymity_level = 3;
339 fidir = GNUNET_FS_file_information_create_empty_directory (fs, 342 fidir = GNUNET_FS_file_information_create_empty_directory (fs,
340 "publish-context-dir", 343 "publish-context-dir",
341 kuri, 344 kuri,
342 meta, 345 meta,
343 3, 346 &bo);
344 42,
345 GNUNET_TIME_relative_to_absolute (LIFETIME));
346 GNUNET_assert (GNUNET_OK == GNUNET_FS_file_information_add (fidir, fi1)); 347 GNUNET_assert (GNUNET_OK == GNUNET_FS_file_information_add (fidir, fi1));
347 GNUNET_assert (GNUNET_OK == GNUNET_FS_file_information_add (fidir, fi2)); 348 GNUNET_assert (GNUNET_OK == GNUNET_FS_file_information_add (fidir, fi2));
348 GNUNET_FS_uri_destroy (kuri); 349 GNUNET_FS_uri_destroy (kuri);
diff --git a/src/fs/test_fs_search.c b/src/fs/test_fs_search.c
index 2544b8a6e..0c44cb612 100644
--- a/src/fs/test_fs_search.c
+++ b/src/fs/test_fs_search.c
@@ -226,6 +226,7 @@ run (void *cls,
226 char *buf; 226 char *buf;
227 struct GNUNET_CONTAINER_MetaData *meta; 227 struct GNUNET_CONTAINER_MetaData *meta;
228 struct GNUNET_FS_Uri *kuri; 228 struct GNUNET_FS_Uri *kuri;
229 struct GNUNET_FS_BlockOptions bo;
229 struct GNUNET_FS_FileInformation *fi; 230 struct GNUNET_FS_FileInformation *fi;
230 size_t i; 231 size_t i;
231 232
@@ -242,6 +243,10 @@ run (void *cls,
242 buf[i] = GNUNET_CRYPTO_random_u32 (GNUNET_CRYPTO_QUALITY_WEAK, 256); 243 buf[i] = GNUNET_CRYPTO_random_u32 (GNUNET_CRYPTO_QUALITY_WEAK, 256);
243 meta = GNUNET_CONTAINER_meta_data_create (); 244 meta = GNUNET_CONTAINER_meta_data_create ();
244 kuri = GNUNET_FS_uri_ksk_create_from_args (2, keywords); 245 kuri = GNUNET_FS_uri_ksk_create_from_args (2, keywords);
246 bo.content_priority = 42;
247 bo.anonymity_level = 1;
248 bo.replication_level = 0;
249 bo.expiration_time = GNUNET_TIME_relative_to_absolute (LIFETIME);
245 fi = GNUNET_FS_file_information_create_from_data (fs, 250 fi = GNUNET_FS_file_information_create_from_data (fs,
246 "publish-context", 251 "publish-context",
247 FILESIZE, 252 FILESIZE,
@@ -249,9 +254,7 @@ run (void *cls,
249 kuri, 254 kuri,
250 meta, 255 meta,
251 GNUNET_NO, 256 GNUNET_NO,
252 1, 257 &bo);
253 42,
254 GNUNET_TIME_relative_to_absolute (LIFETIME));
255 GNUNET_FS_uri_destroy (kuri); 258 GNUNET_FS_uri_destroy (kuri);
256 GNUNET_CONTAINER_meta_data_destroy (meta); 259 GNUNET_CONTAINER_meta_data_destroy (meta);
257 GNUNET_assert (NULL != fi); 260 GNUNET_assert (NULL != fi);
diff --git a/src/fs/test_fs_search_persistence.c b/src/fs/test_fs_search_persistence.c
index e2a213cd8..f04dad9f3 100644
--- a/src/fs/test_fs_search_persistence.c
+++ b/src/fs/test_fs_search_persistence.c
@@ -297,6 +297,7 @@ run (void *cls,
297 struct GNUNET_FS_Uri *kuri; 297 struct GNUNET_FS_Uri *kuri;
298 struct GNUNET_FS_FileInformation *fi; 298 struct GNUNET_FS_FileInformation *fi;
299 size_t i; 299 size_t i;
300 struct GNUNET_FS_BlockOptions bo;
300 301
301 cfg = c; 302 cfg = c;
302 setup_peer (&p1, "test_fs_search_data.conf"); 303 setup_peer (&p1, "test_fs_search_data.conf");
@@ -312,6 +313,10 @@ run (void *cls,
312 buf[i] = GNUNET_CRYPTO_random_u32 (GNUNET_CRYPTO_QUALITY_WEAK, 256); 313 buf[i] = GNUNET_CRYPTO_random_u32 (GNUNET_CRYPTO_QUALITY_WEAK, 256);
313 meta = GNUNET_CONTAINER_meta_data_create (); 314 meta = GNUNET_CONTAINER_meta_data_create ();
314 kuri = GNUNET_FS_uri_ksk_create_from_args (2, keywords); 315 kuri = GNUNET_FS_uri_ksk_create_from_args (2, keywords);
316 bo.content_priority = 42;
317 bo.anonymity_level = 1;
318 bo.replication_level = 0;
319 bo.expiration_time = GNUNET_TIME_relative_to_absolute (LIFETIME);
315 fi = GNUNET_FS_file_information_create_from_data (fs, 320 fi = GNUNET_FS_file_information_create_from_data (fs,
316 "publish-context", 321 "publish-context",
317 FILESIZE, 322 FILESIZE,
@@ -319,9 +324,7 @@ run (void *cls,
319 kuri, 324 kuri,
320 meta, 325 meta,
321 GNUNET_NO, 326 GNUNET_NO,
322 1, 327 &bo);
323 42,
324 GNUNET_TIME_relative_to_absolute (LIFETIME));
325 GNUNET_FS_uri_destroy (kuri); 328 GNUNET_FS_uri_destroy (kuri);
326 GNUNET_CONTAINER_meta_data_destroy (meta); 329 GNUNET_CONTAINER_meta_data_destroy (meta);
327 GNUNET_assert (NULL != fi); 330 GNUNET_assert (NULL != fi);
diff --git a/src/fs/test_fs_unindex.c b/src/fs/test_fs_unindex.c
index 82d4cdcf7..99611a6c8 100644
--- a/src/fs/test_fs_unindex.c
+++ b/src/fs/test_fs_unindex.c
@@ -233,6 +233,7 @@ run (void *cls,
233 struct GNUNET_FS_Uri *kuri; 233 struct GNUNET_FS_Uri *kuri;
234 struct GNUNET_FS_FileInformation *fi; 234 struct GNUNET_FS_FileInformation *fi;
235 size_t i; 235 size_t i;
236 struct GNUNET_FS_BlockOptions bo;
236 237
237 setup_peer (&p1, "test_fs_unindex_data.conf"); 238 setup_peer (&p1, "test_fs_unindex_data.conf");
238 fn = GNUNET_DISK_mktemp ("gnunet-unindex-test-dst"); 239 fn = GNUNET_DISK_mktemp ("gnunet-unindex-test-dst");
@@ -254,15 +255,17 @@ run (void *cls,
254 GNUNET_free (buf); 255 GNUNET_free (buf);
255 meta = GNUNET_CONTAINER_meta_data_create (); 256 meta = GNUNET_CONTAINER_meta_data_create ();
256 kuri = GNUNET_FS_uri_ksk_create_from_args (2, keywords); 257 kuri = GNUNET_FS_uri_ksk_create_from_args (2, keywords);
258 bo.content_priority = 42;
259 bo.anonymity_level = 1;
260 bo.replication_level = 0;
261 bo.expiration_time = GNUNET_TIME_relative_to_absolute (LIFETIME);
257 fi = GNUNET_FS_file_information_create_from_file (fs, 262 fi = GNUNET_FS_file_information_create_from_file (fs,
258 "publish-context", 263 "publish-context",
259 fn, 264 fn,
260 kuri, 265 kuri,
261 meta, 266 meta,
262 GNUNET_YES, 267 GNUNET_YES,
263 1, 268 &bo);
264 42,
265 GNUNET_TIME_relative_to_absolute (LIFETIME));
266 GNUNET_FS_uri_destroy (kuri); 269 GNUNET_FS_uri_destroy (kuri);
267 GNUNET_CONTAINER_meta_data_destroy (meta); 270 GNUNET_CONTAINER_meta_data_destroy (meta);
268 GNUNET_assert (NULL != fi); 271 GNUNET_assert (NULL != fi);
diff --git a/src/fs/test_fs_unindex_persistence.c b/src/fs/test_fs_unindex_persistence.c
index 162dd59af..ee4a4c2db 100644
--- a/src/fs/test_fs_unindex_persistence.c
+++ b/src/fs/test_fs_unindex_persistence.c
@@ -301,6 +301,7 @@ run (void *cls,
301 struct GNUNET_FS_Uri *kuri; 301 struct GNUNET_FS_Uri *kuri;
302 struct GNUNET_FS_FileInformation *fi; 302 struct GNUNET_FS_FileInformation *fi;
303 size_t i; 303 size_t i;
304 struct GNUNET_FS_BlockOptions bo;
304 305
305 cfg = c; 306 cfg = c;
306 setup_peer (&p1, "test_fs_unindex_data.conf"); 307 setup_peer (&p1, "test_fs_unindex_data.conf");
@@ -323,15 +324,17 @@ run (void *cls,
323 GNUNET_free (buf); 324 GNUNET_free (buf);
324 meta = GNUNET_CONTAINER_meta_data_create (); 325 meta = GNUNET_CONTAINER_meta_data_create ();
325 kuri = GNUNET_FS_uri_ksk_create_from_args (2, keywords); 326 kuri = GNUNET_FS_uri_ksk_create_from_args (2, keywords);
327 bo.content_priority = 42;
328 bo.anonymity_level = 1;
329 bo.replication_level = 0;
330 bo.expiration_time = GNUNET_TIME_relative_to_absolute (LIFETIME);
326 fi = GNUNET_FS_file_information_create_from_file (fs, 331 fi = GNUNET_FS_file_information_create_from_file (fs,
327 "publish-context", 332 "publish-context",
328 fn, 333 fn,
329 kuri, 334 kuri,
330 meta, 335 meta,
331 GNUNET_YES, 336 GNUNET_YES,
332 1, 337 &bo);
333 42,
334 GNUNET_TIME_relative_to_absolute (LIFETIME));
335 GNUNET_FS_uri_destroy (kuri); 338 GNUNET_FS_uri_destroy (kuri);
336 GNUNET_CONTAINER_meta_data_destroy (meta); 339 GNUNET_CONTAINER_meta_data_destroy (meta);
337 GNUNET_assert (NULL != fi); 340 GNUNET_assert (NULL != fi);
diff --git a/src/include/gnunet_datastore_service.h b/src/include/gnunet_datastore_service.h
index e9cb8a76f..1e2e9e050 100644
--- a/src/include/gnunet_datastore_service.h
+++ b/src/include/gnunet_datastore_service.h
@@ -1,6 +1,6 @@
1/* 1/*
2 This file is part of GNUnet 2 This file is part of GNUnet
3 (C) 2004, 2005, 2006, 2007, 2009, 2010 Christian Grothoff (and other contributing authors) 3 (C) 2004, 2005, 2006, 2007, 2009, 2010, 2011 Christian Grothoff (and other contributing authors)
4 4
5 GNUnet is free software; you can redistribute it and/or modify 5 GNUnet is free software; you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published 6 it under the terms of the GNU General Public License as published
@@ -122,8 +122,8 @@ GNUNET_DATASTORE_reserve (struct GNUNET_DATASTORE_Handle *h,
122 122
123/** 123/**
124 * Store an item in the datastore. If the item is already present, 124 * Store an item in the datastore. If the item is already present,
125 * the priorities are summed up and the higher expiration time and 125 * the priorities and replication values are summed up and the higher
126 * lower anonymity level is used. 126 * expiration time and lower anonymity level is used.
127 * 127 *
128 * @param h handle to the datastore 128 * @param h handle to the datastore
129 * @param rid reservation ID to use (from "reserve"); use 0 if no 129 * @param rid reservation ID to use (from "reserve"); use 0 if no
@@ -134,6 +134,7 @@ GNUNET_DATASTORE_reserve (struct GNUNET_DATASTORE_Handle *h,
134 * @param type type of the content 134 * @param type type of the content
135 * @param priority priority of the content 135 * @param priority priority of the content
136 * @param anonymity anonymity-level for the content 136 * @param anonymity anonymity-level for the content
137 * @param replication how often should the content be replicated to other peers?
137 * @param expiration expiration time for the content 138 * @param expiration expiration time for the content
138 * @param queue_priority ranking of this request in the priority queue 139 * @param queue_priority ranking of this request in the priority queue
139 * @param max_queue_size at what queue size should this request be dropped 140 * @param max_queue_size at what queue size should this request be dropped
@@ -154,6 +155,7 @@ GNUNET_DATASTORE_put (struct GNUNET_DATASTORE_Handle *h,
154 enum GNUNET_BLOCK_Type type, 155 enum GNUNET_BLOCK_Type type,
155 uint32_t priority, 156 uint32_t priority,
156 uint32_t anonymity, 157 uint32_t anonymity,
158 uint32_t replication,
157 struct GNUNET_TIME_Absolute expiration, 159 struct GNUNET_TIME_Absolute expiration,
158 unsigned int queue_priority, 160 unsigned int queue_priority,
159 unsigned int max_queue_size, 161 unsigned int max_queue_size,
@@ -323,7 +325,11 @@ GNUNET_DATASTORE_get_next (struct GNUNET_DATASTORE_Handle *h);
323 325
324 326
325/** 327/**
326 * Get a random value from the datastore. 328 * Get a random value from the datastore for content replication.
329 * Returns a single, random value among those with the highest
330 * replication score, lowering positive replication scores by one for
331 * the chosen value (if only content with a replication score exists,
332 * a random value is returned and replication scores are not changed).
327 * 333 *
328 * @param h handle to the datastore 334 * @param h handle to the datastore
329 * @param queue_priority ranking of this request in the priority queue 335 * @param queue_priority ranking of this request in the priority queue
@@ -339,12 +345,12 @@ GNUNET_DATASTORE_get_next (struct GNUNET_DATASTORE_Handle *h);
339 * (or rather, will already have been invoked) 345 * (or rather, will already have been invoked)
340 */ 346 */
341struct GNUNET_DATASTORE_QueueEntry * 347struct GNUNET_DATASTORE_QueueEntry *
342GNUNET_DATASTORE_get_random (struct GNUNET_DATASTORE_Handle *h, 348GNUNET_DATASTORE_get_for_replication (struct GNUNET_DATASTORE_Handle *h,
343 unsigned int queue_priority, 349 unsigned int queue_priority,
344 unsigned int max_queue_size, 350 unsigned int max_queue_size,
345 struct GNUNET_TIME_Relative timeout, 351 struct GNUNET_TIME_Relative timeout,
346 GNUNET_DATASTORE_Iterator iter, 352 GNUNET_DATASTORE_Iterator iter,
347 void *iter_cls); 353 void *iter_cls);
348 354
349 355
350/** 356/**
diff --git a/src/include/gnunet_fs_service.h b/src/include/gnunet_fs_service.h
index 52cd8bd78..8238083b1 100644
--- a/src/include/gnunet_fs_service.h
+++ b/src/include/gnunet_fs_service.h
@@ -1574,6 +1574,52 @@ enum GNUNET_FS_OPTIONS
1574 1574
1575 1575
1576/** 1576/**
1577 * Settings for publishing a block (which may of course also
1578 * apply to an entire directory or file).
1579 */
1580struct GNUNET_FS_BlockOptions
1581{
1582
1583 /**
1584 * At what time should the block expire? Data blocks (DBLOCKS and
1585 * IBLOCKS) may still be used even if they are expired (however,
1586 * they'd be removed quickly from the datastore if we are short on
1587 * space), all other types of blocks will no longer be returned
1588 * after they expire.
1589 */
1590 struct GNUNET_TIME_Absolute expiration_time;
1591
1592 /**
1593 * At which anonymity level should the block be shared?
1594 * (0: no anonymity, 1: normal GAP, >1: with cover traffic).
1595 */
1596 uint32_t anonymity_level;
1597
1598 /**
1599 * How important is it for us to store the block? If we run
1600 * out of space, the highest-priority, non-expired blocks will
1601 * be kept.
1602 */
1603 uint32_t content_priority;
1604
1605 /**
1606 * How often should we try to migrate the block to other peers?
1607 * Only used if "CONTENT_PUSHING" is set to YES, in which case we
1608 * first push each block to other peers according to their
1609 * replication levels. Once each block has been pushed that many
1610 * times to other peers, blocks are chosen for migration at random.
1611 * Naturally, there is no guarantee that the other peers will keep
1612 * these blocks for any period of time (since they won't have any
1613 * priority or might be too busy to even store the block in the
1614 * first place).
1615 */
1616 uint32_t replication_level;
1617
1618};
1619
1620
1621
1622/**
1577 * Handle to the file-sharing service. 1623 * Handle to the file-sharing service.
1578 */ 1624 */
1579struct GNUNET_FS_Handle; 1625struct GNUNET_FS_Handle;
@@ -1635,10 +1681,8 @@ GNUNET_FS_meta_data_extract_from_file (struct
1635 * @param length length of the file or directory 1681 * @param length length of the file or directory
1636 * @param meta metadata for the file or directory (can be modified) 1682 * @param meta metadata for the file or directory (can be modified)
1637 * @param uri pointer to the keywords that will be used for this entry (can be modified) 1683 * @param uri pointer to the keywords that will be used for this entry (can be modified)
1638 * @param anonymity pointer to selected anonymity level (can be modified) 1684 * @param bo block options (can be modified)
1639 * @param priority pointer to selected priority (can be modified)
1640 * @param do_index should we index (can be modified) 1685 * @param do_index should we index (can be modified)
1641 * @param expirationTime pointer to selected expiration time (can be modified)
1642 * @param client_info pointer to client context set upon creation (can be modified) 1686 * @param client_info pointer to client context set upon creation (can be modified)
1643 * @return GNUNET_OK to continue, GNUNET_NO to remove 1687 * @return GNUNET_OK to continue, GNUNET_NO to remove
1644 * this entry from the directory, GNUNET_SYSERR 1688 * this entry from the directory, GNUNET_SYSERR
@@ -1649,10 +1693,8 @@ typedef int (*GNUNET_FS_FileInformationProcessor)(void *cls,
1649 uint64_t length, 1693 uint64_t length,
1650 struct GNUNET_CONTAINER_MetaData *meta, 1694 struct GNUNET_CONTAINER_MetaData *meta,
1651 struct GNUNET_FS_Uri **uri, 1695 struct GNUNET_FS_Uri **uri,
1652 uint32_t *anonymity, 1696 struct GNUNET_FS_BlockOptions *bo,
1653 uint32_t *priority,
1654 int *do_index, 1697 int *do_index,
1655 struct GNUNET_TIME_Absolute *expirationTime,
1656 void **client_info); 1698 void **client_info);
1657 1699
1658 1700
@@ -1682,11 +1724,7 @@ GNUNET_FS_file_information_get_id (struct GNUNET_FS_FileInformation *s);
1682 * @param meta metadata for the file 1724 * @param meta metadata for the file
1683 * @param do_index GNUNET_YES for index, GNUNET_NO for insertion, 1725 * @param do_index GNUNET_YES for index, GNUNET_NO for insertion,
1684 * GNUNET_SYSERR for simulation 1726 * GNUNET_SYSERR for simulation
1685 * @param anonymity what is the desired anonymity level for sharing? 1727 * @param bo block options
1686 * @param priority what is the priority for OUR node to
1687 * keep this file available? Use 0 for maximum anonymity and
1688 * minimum reliability...
1689 * @param expirationTime when should this content expire?
1690 * @return publish structure entry for the file 1728 * @return publish structure entry for the file
1691 */ 1729 */
1692struct GNUNET_FS_FileInformation * 1730struct GNUNET_FS_FileInformation *
@@ -1696,9 +1734,7 @@ GNUNET_FS_file_information_create_from_file (struct GNUNET_FS_Handle *h,
1696 const struct GNUNET_FS_Uri *keywords, 1734 const struct GNUNET_FS_Uri *keywords,
1697 const struct GNUNET_CONTAINER_MetaData *meta, 1735 const struct GNUNET_CONTAINER_MetaData *meta,
1698 int do_index, 1736 int do_index,
1699 uint32_t anonymity, 1737 const struct GNUNET_FS_BlockOptions *bo);
1700 uint32_t priority,
1701 struct GNUNET_TIME_Absolute expirationTime);
1702 1738
1703 1739
1704/** 1740/**
@@ -1714,11 +1750,7 @@ GNUNET_FS_file_information_create_from_file (struct GNUNET_FS_Handle *h,
1714 * @param meta metadata for the file 1750 * @param meta metadata for the file
1715 * @param do_index GNUNET_YES for index, GNUNET_NO for insertion, 1751 * @param do_index GNUNET_YES for index, GNUNET_NO for insertion,
1716 * GNUNET_SYSERR for simulation 1752 * GNUNET_SYSERR for simulation
1717 * @param anonymity what is the desired anonymity level for sharing? 1753 * @param bo block options
1718 * @param priority what is the priority for OUR node to
1719 * keep this file available? Use 0 for maximum anonymity and
1720 * minimum reliability...
1721 * @param expirationTime when should this content expire?
1722 * @return publish structure entry for the file 1754 * @return publish structure entry for the file
1723 */ 1755 */
1724struct GNUNET_FS_FileInformation * 1756struct GNUNET_FS_FileInformation *
@@ -1729,9 +1761,7 @@ GNUNET_FS_file_information_create_from_data (struct GNUNET_FS_Handle *h,
1729 const struct GNUNET_FS_Uri *keywords, 1761 const struct GNUNET_FS_Uri *keywords,
1730 const struct GNUNET_CONTAINER_MetaData *meta, 1762 const struct GNUNET_CONTAINER_MetaData *meta,
1731 int do_index, 1763 int do_index,
1732 uint32_t anonymity, 1764 const struct GNUNET_FS_BlockOptions *bo);
1733 uint32_t priority,
1734 struct GNUNET_TIME_Absolute expirationTime);
1735 1765
1736 1766
1737/** 1767/**
@@ -1770,11 +1800,7 @@ typedef size_t (*GNUNET_FS_DataReader)(void *cls,
1770 * @param meta metadata for the file 1800 * @param meta metadata for the file
1771 * @param do_index GNUNET_YES for index, GNUNET_NO for insertion, 1801 * @param do_index GNUNET_YES for index, GNUNET_NO for insertion,
1772 * GNUNET_SYSERR for simulation 1802 * GNUNET_SYSERR for simulation
1773 * @param anonymity what is the desired anonymity level for sharing? 1803 * @param bo block options
1774 * @param priority what is the priority for OUR node to
1775 * keep this file available? Use 0 for maximum anonymity and
1776 * minimum reliability...
1777 * @param expirationTime when should this content expire?
1778 * @return publish structure entry for the file 1804 * @return publish structure entry for the file
1779 */ 1805 */
1780struct GNUNET_FS_FileInformation * 1806struct GNUNET_FS_FileInformation *
@@ -1786,9 +1812,7 @@ GNUNET_FS_file_information_create_from_reader (struct GNUNET_FS_Handle *h,
1786 const struct GNUNET_FS_Uri *keywords, 1812 const struct GNUNET_FS_Uri *keywords,
1787 const struct GNUNET_CONTAINER_MetaData *meta, 1813 const struct GNUNET_CONTAINER_MetaData *meta,
1788 int do_index, 1814 int do_index,
1789 uint32_t anonymity, 1815 const struct GNUNET_FS_BlockOptions *bo);
1790 uint32_t priority,
1791 struct GNUNET_TIME_Absolute expirationTime);
1792 1816
1793 1817
1794/** 1818/**
@@ -1813,9 +1837,7 @@ typedef void (*GNUNET_FS_FileProcessor)(void *cls,
1813 * @param h handle to the file sharing subsystem 1837 * @param h handle to the file sharing subsystem
1814 * @param dirname name of the directory to scan 1838 * @param dirname name of the directory to scan
1815 * @param do_index should files be indexed or inserted 1839 * @param do_index should files be indexed or inserted
1816 * @param anonymity desired anonymity level 1840 * @param bo block options
1817 * @param priority priority for publishing
1818 * @param expirationTime expiration for publication
1819 * @param proc function to call on each entry 1841 * @param proc function to call on each entry
1820 * @param proc_cls closure for proc 1842 * @param proc_cls closure for proc
1821 * @param emsg where to store an error message (on errors) 1843 * @param emsg where to store an error message (on errors)
@@ -1825,9 +1847,7 @@ typedef int (*GNUNET_FS_DirectoryScanner)(void *cls,
1825 struct GNUNET_FS_Handle *h, 1847 struct GNUNET_FS_Handle *h,
1826 const char *dirname, 1848 const char *dirname,
1827 int do_index, 1849 int do_index,
1828 uint32_t anonymity, 1850 const struct GNUNET_FS_BlockOptions *bo,
1829 uint32_t priority,
1830 struct GNUNET_TIME_Absolute expirationTime,
1831 GNUNET_FS_FileProcessor proc, 1851 GNUNET_FS_FileProcessor proc,
1832 void *proc_cls, 1852 void *proc_cls,
1833 char **emsg); 1853 char **emsg);
@@ -1849,9 +1869,7 @@ typedef int (*GNUNET_FS_DirectoryScanner)(void *cls,
1849 * @param h handle to the file sharing subsystem 1869 * @param h handle to the file sharing subsystem
1850 * @param dirname name of the directory to scan 1870 * @param dirname name of the directory to scan
1851 * @param do_index should files be indexed or inserted 1871 * @param do_index should files be indexed or inserted
1852 * @param anonymity desired anonymity level 1872 * @param bo block options
1853 * @param priority priority for publishing
1854 * @param expirationTime expiration for publication
1855 * @param proc function called on each entry 1873 * @param proc function called on each entry
1856 * @param proc_cls closure for proc 1874 * @param proc_cls closure for proc
1857 * @param emsg where to store an error message (on errors) 1875 * @param emsg where to store an error message (on errors)
@@ -1862,9 +1880,7 @@ GNUNET_FS_directory_scanner_default (void *cls,
1862 struct GNUNET_FS_Handle *h, 1880 struct GNUNET_FS_Handle *h,
1863 const char *dirname, 1881 const char *dirname,
1864 int do_index, 1882 int do_index,
1865 uint32_t anonymity, 1883 const struct GNUNET_FS_BlockOptions *bo,
1866 uint32_t priority,
1867 struct GNUNET_TIME_Absolute expirationTime,
1868 GNUNET_FS_FileProcessor proc, 1884 GNUNET_FS_FileProcessor proc,
1869 void *proc_cls, 1885 void *proc_cls,
1870 char **emsg); 1886 char **emsg);
@@ -1886,11 +1902,7 @@ GNUNET_FS_directory_scanner_default (void *cls,
1886 * @param scanner function used to get a list of files in a directory 1902 * @param scanner function used to get a list of files in a directory
1887 * @param scanner_cls closure for scanner 1903 * @param scanner_cls closure for scanner
1888 * @param do_index should files in the hierarchy be indexed? 1904 * @param do_index should files in the hierarchy be indexed?
1889 * @param anonymity what is the desired anonymity level for sharing? 1905 * @param bo block options
1890 * @param priority what is the priority for OUR node to
1891 * keep this file available? Use 0 for maximum anonymity and
1892 * minimum reliability...
1893 * @param expirationTime when should this content expire?
1894 * @param emsg where to store an error message 1906 * @param emsg where to store an error message
1895 * @return publish structure entry for the directory, NULL on error 1907 * @return publish structure entry for the directory, NULL on error
1896 */ 1908 */
@@ -1901,9 +1913,7 @@ GNUNET_FS_file_information_create_from_directory (struct GNUNET_FS_Handle *h,
1901 GNUNET_FS_DirectoryScanner scanner, 1913 GNUNET_FS_DirectoryScanner scanner,
1902 void *scanner_cls, 1914 void *scanner_cls,
1903 int do_index, 1915 int do_index,
1904 uint32_t anonymity, 1916 const struct GNUNET_FS_BlockOptions *bo,
1905 uint32_t priority,
1906 struct GNUNET_TIME_Absolute expirationTime,
1907 char **emsg); 1917 char **emsg);
1908 1918
1909 1919
@@ -1918,11 +1928,7 @@ GNUNET_FS_file_information_create_from_directory (struct GNUNET_FS_Handle *h,
1918 * @param keywords under which keywords should this directory be available 1928 * @param keywords under which keywords should this directory be available
1919 * directly; can be NULL 1929 * directly; can be NULL
1920 * @param meta metadata for the directory 1930 * @param meta metadata for the directory
1921 * @param anonymity what is the desired anonymity level for sharing? 1931 * @param bo block options
1922 * @param priority what is the priority for OUR node to
1923 * keep this file available? Use 0 for maximum anonymity and
1924 * minimum reliability...
1925 * @param expirationTime when should this content expire?
1926 * @return publish structure entry for the directory , NULL on error 1932 * @return publish structure entry for the directory , NULL on error
1927 */ 1933 */
1928struct GNUNET_FS_FileInformation * 1934struct GNUNET_FS_FileInformation *
@@ -1930,9 +1936,7 @@ GNUNET_FS_file_information_create_empty_directory (struct GNUNET_FS_Handle *h,
1930 void *client_info, 1936 void *client_info,
1931 const struct GNUNET_FS_Uri *keywords, 1937 const struct GNUNET_FS_Uri *keywords,
1932 const struct GNUNET_CONTAINER_MetaData *meta, 1938 const struct GNUNET_CONTAINER_MetaData *meta,
1933 uint32_t anonymity, 1939 const struct GNUNET_FS_BlockOptions *bo);
1934 uint32_t priority,
1935 struct GNUNET_TIME_Absolute expirationTime);
1936 1940
1937 1941
1938/** 1942/**
@@ -2069,9 +2073,8 @@ typedef void (*GNUNET_FS_PublishContinuation)(void *cls,
2069 * @param ksk_uri keywords to use 2073 * @param ksk_uri keywords to use
2070 * @param meta metadata to use 2074 * @param meta metadata to use
2071 * @param uri URI to refer to in the KBlock 2075 * @param uri URI to refer to in the KBlock
2072 * @param expirationTime when the KBlock expires 2076 * @param bo block options
2073 * @param anonymity anonymity level for the KBlock 2077 * @param options publication options
2074 * @param priority priority for the KBlock
2075 * @param cont continuation 2078 * @param cont continuation
2076 * @param cont_cls closure for cont 2079 * @param cont_cls closure for cont
2077 */ 2080 */
@@ -2080,9 +2083,7 @@ GNUNET_FS_publish_ksk (struct GNUNET_FS_Handle *h,
2080 const struct GNUNET_FS_Uri *ksk_uri, 2083 const struct GNUNET_FS_Uri *ksk_uri,
2081 const struct GNUNET_CONTAINER_MetaData *meta, 2084 const struct GNUNET_CONTAINER_MetaData *meta,
2082 const struct GNUNET_FS_Uri *uri, 2085 const struct GNUNET_FS_Uri *uri,
2083 struct GNUNET_TIME_Absolute expirationTime, 2086 const struct GNUNET_FS_BlockOptions *bo,
2084 uint32_t anonymity,
2085 uint32_t priority,
2086 enum GNUNET_FS_PublishOptions options, 2087 enum GNUNET_FS_PublishOptions options,
2087 GNUNET_FS_PublishContinuation cont, 2088 GNUNET_FS_PublishContinuation cont,
2088 void *cont_cls); 2089 void *cont_cls);
@@ -2097,9 +2098,8 @@ GNUNET_FS_publish_ksk (struct GNUNET_FS_Handle *h,
2097 * @param update update identifier to use 2098 * @param update update identifier to use
2098 * @param meta metadata to use 2099 * @param meta metadata to use
2099 * @param uri URI to refer to in the SBlock 2100 * @param uri URI to refer to in the SBlock
2100 * @param expirationTime when the SBlock expires 2101 * @param bo block options
2101 * @param anonymity anonymity level for the SBlock 2102 * @param options publication options
2102 * @param priority priority for the SBlock
2103 * @param cont continuation 2103 * @param cont continuation
2104 * @param cont_cls closure for cont 2104 * @param cont_cls closure for cont
2105 */ 2105 */
@@ -2110,9 +2110,7 @@ GNUNET_FS_publish_sks (struct GNUNET_FS_Handle *h,
2110 const char *update, 2110 const char *update,
2111 const struct GNUNET_CONTAINER_MetaData *meta, 2111 const struct GNUNET_CONTAINER_MetaData *meta,
2112 const struct GNUNET_FS_Uri *uri, 2112 const struct GNUNET_FS_Uri *uri,
2113 struct GNUNET_TIME_Absolute expirationTime, 2113 const struct GNUNET_FS_BlockOptions *bo,
2114 uint32_t anonymity,
2115 uint32_t priority,
2116 enum GNUNET_FS_PublishOptions options, 2114 enum GNUNET_FS_PublishOptions options,
2117 GNUNET_FS_PublishContinuation cont, 2115 GNUNET_FS_PublishContinuation cont,
2118 void *cont_cls); 2116 void *cont_cls);
@@ -2180,9 +2178,7 @@ GNUNET_FS_unindex_stop (struct GNUNET_FS_UnindexContext *uc);
2180 * @param ksk_uri keywords to use for advertisment 2178 * @param ksk_uri keywords to use for advertisment
2181 * @param namespace handle for the namespace that should be advertised 2179 * @param namespace handle for the namespace that should be advertised
2182 * @param meta meta-data for the namespace advertisement 2180 * @param meta meta-data for the namespace advertisement
2183 * @param anonymity for the namespace advertismement 2181 * @param bo block options
2184 * @param priority for the namespace advertisement
2185 * @param expiration for the namespace advertisement
2186 * @param rootEntry name of the root of the namespace 2182 * @param rootEntry name of the root of the namespace
2187 * @param cont continuation 2183 * @param cont continuation
2188 * @param cont_cls closure for cont 2184 * @param cont_cls closure for cont
@@ -2192,9 +2188,7 @@ GNUNET_FS_namespace_advertise (struct GNUNET_FS_Handle *h,
2192 struct GNUNET_FS_Uri *ksk_uri, 2188 struct GNUNET_FS_Uri *ksk_uri,
2193 struct GNUNET_FS_Namespace *namespace, 2189 struct GNUNET_FS_Namespace *namespace,
2194 const struct GNUNET_CONTAINER_MetaData *meta, 2190 const struct GNUNET_CONTAINER_MetaData *meta,
2195 uint32_t anonymity, 2191 const struct GNUNET_FS_BlockOptions *bo,
2196 uint32_t priority,
2197 struct GNUNET_TIME_Absolute expiration,
2198 const char *rootEntry, 2192 const char *rootEntry,
2199 GNUNET_FS_PublishContinuation cont, 2193 GNUNET_FS_PublishContinuation cont,
2200 void *cont_cls); 2194 void *cont_cls);