aboutsummaryrefslogtreecommitdiff
path: root/src/fs/gnunet-publish.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/fs/gnunet-publish.c')
-rw-r--r--src/fs/gnunet-publish.c39
1 files changed, 13 insertions, 26 deletions
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)"),