Implementable right now (but not necessarily important), with caveats
(unavailable components that will limit what can be implemented right
away), in order in which they will likely be done:
-* TESTING-TESTBED [Nate]
-* SETUP
+* TESTING [Nate]
* DV [Nate]
-* TBENCH
-* TRACEKIT
+* DHT [Nate]
+* TBENCH [MW]
+* TRACEKIT [MW]
* FRAGMENTATION [Ji Lu]
-* HTTP transport
-* MySQL / Postgres plugins (datastore, datacache)
+* HTTP transport [Matthias]
* UPNP [Milan]
* ARM [Safey]
-* FS [Christian]
+* FS [CG]
+* SETUP
+* MySQL / Postgres plugins (datastore, datacache)
-0.9.0pre0:
-* CORE:
+0.9.0pre0 [April]:
+* CORE: [CG]
- "Forcing disconnect of XXX due to inactivity" -- can happen every few MS!?
(disconnect does not really succeed, or what?)
Also, core does not seem to actually decrement the number of active
sessions even if no connections exist for a while! (likely related...)
- - transport reports bw quota violations on big-endian systems (core or
+ - transport reports bw quota violations on slow systems (core or
transport issue?)
-* DATASTORE:
+* DATASTORE: [CG]
- utilization can (easily, restart?) go out of control (very large), causing
content expiration job to go crazy and delete everything!
-* FS:
- - gnunet-publish cannot be aborted using CTRL-C
+* FS: [CG]
+ T gnunet-publish cannot be aborted using CTRL-C
- on some systems, keyword search does not find locally published content
(need testcase of command-line tools! - also good to cover getopt API!)
[could be related to datastore issue above!]
- 2-peer download is still too slow (why?)
- advanced FS API parts
- + search: SBlocks, NBlocks, probes, notify FS-service of known results
- + gnunet-publish (URI args)
- + gnunet-download (directory)
- + gnunet-search (options, incl. namespace search)
- + gnunet-download (many options)
- + gnunet-directory (man page, options)
- + gnunet-pseudonym (listing of namespaces, advertisement uris, testing)
+ T gnunet-download (directory-file download [easy])
+ T fs_download (recursive download; bounded parallelism)
+ T indexing: index-failure-cleanup [easy]
+ gnunet-service-fs (remove failing on-demand blocks, hot-path routing,
load-based routing, nitpicks)
- + indexing: index-failure-cleanup
- - implement adv. FS testcases
- - [./fs/gnunet-service-fs.c:208]: (style) struct or union member 'LocalGetContext::results_bf_size' is never used
- - [./fs/gnunet-service-fs.c:501]: (style) struct or union member 'PendingRequest::used_pids_size' is never used
- - [./fs/gnunet-service-fs.c:654]: (style) struct or union member 'ConnectedPeer::last_client_replies' is never used
- - [./fs/gnunet-service-fs.c:669]: (style) struct or union member 'ConnectedPeer::avg_delay' is never used
- - [./fs/gnunet-service-fs.c:675]: (style) struct or union member 'ConnectedPeer::avg_priority' is never used
- - [./fs/gnunet-service-fs.c:688]: (style) struct or union member 'ConnectedPeer::pending_requests' is never used
- - [./fs/gnunet-service-fs.c:694]: (style) struct or union member 'ConnectedPeer::last_p2p_replies_woff' is never used
- - [./fs/gnunet-service-fs.c:700]: (style) struct or union member 'ConnectedPeer::last_client_replies_woff' is never used
+ - [gnunet-service-fs.c:208]: member 'LocalGetContext::results_bf_size' is never used
+ - [gnunet-service-fs.c:501]: member 'PendingRequest::used_pids_size' is never used
+ - [gnunet-service-fs.c:654]: member 'ConnectedPeer::last_client_replies' is never used
+ - [gnunet-service-fs.c:669]: member 'ConnectedPeer::avg_delay' is never used
+ - [gnunet-service-fs.c:675]: member 'ConnectedPeer::avg_priority' is never used
+ - [gnunet-service-fs.c:688]: member 'ConnectedPeer::pending_requests' is never used
+ - [gnunet-service-fs.c:694]: member 'ConnectedPeer::last_p2p_replies_woff' is never used
+ - [gnunet-service-fs.c:700]: member 'ConnectedPeer::last_client_replies_woff' is never used
* WWW:
- Get IPv6 hooked up
- change DNS
0.9.0pre1:
-* Module features to implement:
- - tbench (RC-pre1)
- + good to have for DV evaluation! [MW]
- - DV (RC-pre1)
- + write DV API
- + implement DV service [Nate & CG]
- + implement DV library [Nate]
- + implement DV transport plugin [Nate & CG]
- + implement testcases [Nate]
- + implement performance tests [Nate]
-* SETUP:
- - design & implement new setup tool
-* GUIs to implement:
- - gtk (RC-pre1)
- + how to integrate scheduler with GTK event loop!
-* STATISTICS:
- - does not seem to work with timeouts (especially if service is not running)
* PEERINFO:
- trust: need *fast* way to check/update trust in peers
(async peerinfo would not be right; certainly not with the
- only connect() sockets that are ready (select()) [Nils]
[On W32, we need to select after calling socket before
doing connect etc.]
-* FS:
- - datastore reservation (publishing)
- - persistence support (publish, unindex, search, download)
- - download: management/bounding of parallel downloads (for recursive dl.)
- - non-anonymous FS service (needs DHT)
- + basic DHT integration
- + CS-DHT-functions (DHT-put of LOC)
- + P2P-functions (DHT-get)
- - active migration support (in fs or in datastore or new daemon?)
- - GAP improvements:
- + active reply route caching design & implementation of service; gap extension!
+* HELLO: [CG]
+ - need function to test "equivalency" of HELLOs (or integrate with "merge"?); use in PEERINFO
+* SETUP:
+ - design & implement new setup tool
+* TBENCH: [MW]
+ - good to have for transport/DV evaluation!
+* DV: [Nate]
+ - write DV API
+ - implement DV service
+ - implement DV library
+ - implement DV transport plugin
+ - implement testcases
+ - implement performance tests
+* STATISTICS:
+ - does not seem to work with timeouts (especially if service is not running)
* TOPOLOGY:
- needs more testing (especially F2F topology)
- needs to re-try connecting after disconnect (currently, it
disconnect-reconnect events and the implicit whitelisting
that might happen here; that's not so bad since we will
re-blacklist on pre-connect attempts anyway, so this is
- a minor issue).
+ a minor issue; OTOH, we might want to be more explicit about
+ allowing/forbidding connects on pre-connect to avoid
+ entering connect attempts to just be blacklisted shortly afterwards).
- the code uses the term 'blacklist' for both peers that are forbidden
to connect (i.e. F2F mode) as well as peers that we currently
won't try to actively connect to ourselves (since we just tried);
- This is confusing. We need two distinct terms.
+ This is confusing. We need two distinct terms (greylist?).
- move code to use hash table instead of linked list
- instead of periodically discarding blacklisted entries,
simply add task that is triggered at the right time (earlier free,
more balanced load)
- check if new HELLO learned is different from old HELLO
before resetting entire state!
-* HELLO:
- - need function to test "equivalency" of HELLOs (or integrate with "merge"?); use in PEERINFO
+* FS: [CG]
+ - datastore reservation (publishing)
+ - search: availability probes
+ - persistence support (publish, unindex, search, download)
+ - active migration support (in fs or in datastore or new daemon?)
+ - GAP improvements:
+ + active reply route caching design & implementation of service; gap extension!
+* GNUNET-GTK:
+ - how to integrate scheduler with GTK event loop!?
0.9.0pre2:
-* Module features to implement:
- - tracekit (RC-pre2)
- + good to have for DV/DHT evaluation!
- - DHT (RC-pre2)
- + implement DHT service (needs DV, DATACACHE)
- + implement DHT library
- + implement testcases
- + implement performance tests
-* GUIs to implement:
- - fuse (RC-pre2)
-* Plugins to implement:
- - UDP backend (RC-pre2)
- + Fragmentation library
- + actual plugin
- - HTTP backend (RC-pre2)
-* ARM:
+* TRACEKIT: [MW]
+ - good to have for DV/DHT evaluation!
+* DHT: [Nate]
+ - implement DHT service (needs DV, DATACACHE)
+ - implement DHT library
+ - implement testcases
+ - implement performance tests
+* TRANSPORT:
+ - HTTP backend [MW]
+* ARM: [Safey]
- need to get rid of synchronous API for service starts (cause all kinds of problems)
[=> eliminate for need to tell ARM about service starts most of the time!] [Safey]
- better tracking of which config changes actually need to cause process restarts by ARM.
- better crash management (attach debugging support, capture and analyze
debug output, detect random vs. deterministic crashes)
- shutdown sequence?
-* FS:
+* FS: [CG]
- location URIs (publish, search, download)
+ - non-anonymous FS service (needs DHT)
+ + DHT integration for search
+ + CS-DHT-functions (DHT-put of LOC)
+ + P2P-functions (DHT-get)
- collection API & tests
+ gnunet-pseudonym (collection support)
- implement FS performance tests
+ search
+ unindex
-
0.9.0pre3:
-* GUIs to implement:
- - qt (RC-pre3)
- + see discussions @ FISL about integration with event loop!
* Determine RC bugs and fix those!
-* TESTING:
+* TESTING: [Nate]
- modify configuration to allow controlling connections for non-local starts
- - testbed creation with topology (needs working F2F topology) [Nate]
- - testbed with churn [Nate]
- - implement testcases for distributed testing [Nate]
- - test basic peer re-configure [Nate]
- - test topology creation [Nate]
- - test churn generation [Nate]
+ - testbed creation with topology (needs working F2F topology)
+ - testbed with churn
+ - implement testcases for distributed testing
+ - test basic peer re-configure
+ - test topology creation
+ - test churn generation
- consider changing API for peer-group termination to
call continuation when done
-
0.9.0:
-* Documentation
- - update man pages
- - update webpage documentation
* new webpage:
- expand bibliography
- convert documentation pages to books
enable developers to publish TGZs nicely
- port "contact" page
- add content type for "todo" items?
- - DNS activation
-* Plugins to implement:
+* Plugins to implement: [CG]
- MySQL database backends
+ datacache
+ datastore
- Postgres database backends
+ datacache
+ datastore
- - vpn
+* VPN
* Determine RC bugs and fix those!
-
0.9.x:
-* TRANSPORT:
+* TRANSPORT: [MW]
- SMTP transport backend
- HTTPS transport backend
+ improved HTTPS support in MHD
- implement gnunet-transport (transport configurator / tester)
- UPnP-based IP detection
(Note: build library always, build service when libxml2/etc. are available)
-* FS:
+* FS: [CG]
- Remove KBlocks in gnunet-unindex (see discussion with Kenneth Almquist on gnunet-devs in 9/2009)
- Allow checking of presence of search results and/or content via command-line tools
(add options to gnunet-search / gnunet-download to limit search to local peer)
-* PEERINFO:
+* PEERINFO: [CG]
- expire 'ancient' HELLOs (those without valid addresses AND that
we have not 'used' (for their public keys) in a while; need a way
to track actual 'use')
\fB\-m \fITYPE:VALUE\fR, \fB\-\-meta=\fITYPE:VALUE\fR
For the main file (or directory), set the metadata of the given TYPE to the given VALUE. Note that this will not add the respective VALUE to the set of keywords under which the file can be found.
-.TP
-\fB\-n\fR, \fB\-\-no\-advertisement\fR
-Do not generate an advertisement for the namespace (use with \-C).
-
.TP
\fB\-p \fIPRIORITY\fR, \fB\-\-prio=\fIPRIORITY\fR
Set the priority of the namespace advertisement (default: 365). If the local database is full, GNUnet will discard the content with the lowest ranking. Note that ranks change over time depending on popularity. The default should be high enough to preserve the locally inserted content in favor of content that migrates from other peers.
.TP
\fB\-r IDENTIFIER\fR, \fB\-\-root=IDENTIFIER\fR
-Specify 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).
+Specify 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.
.TP
\fB\-s ID:VALUE\fR, \fB\-\-set-rating=ID:VALUE\fR
Change the loglevel. Possible values for LOGLEVEL are
ERROR, WARNING, INFO and DEBUG.
.TP
-\fB\-o \fIPREFIX\fR, \fB\-\-output=\fIPREFIX\fR
-Writes the encountered (unencrypted) RBlocks or SBlocks to files with name PREFIX.XXX, where XXX is a number. This is useful to keep search results around.
+\fB\-o \fIFILENAME\fR, \fB\-\-output=\fIFILENAME\fR
+Writes a GNUnet directory containing all of the search results to FILENAME.
.TP
\fB\-v\fR, \fB\-\-version\fR
print the version number
.SH NOTES
-You can run gnunet\-search with an URI instead of a keyword. The URI can have the format for a namespace search or for a keyword search. For a namespace search, the format is gnunet://fs/sks/NAMESPACE/IDENTIFIER. For a keyword search, use gnunet://ecrs/ksk/KEYWORD[+KEYWORD]*. If the format does not correspond to a GNUnet URI, GNUnet will automatically assume that keywords are supplied directly.
+You can run gnunet\-search with an URI instead of a keyword. The URI can have the format for a namespace search or for a keyword search. For a namespace search, the format is gnunet://fs/sks/NAMESPACE/IDENTIFIER. For a keyword search, use gnunet://fs/ksk/KEYWORD[+KEYWORD]*. If the format does not correspond to a GNUnet URI, GNUnet will automatically assume that keywords are supplied directly.
If multiple keywords are passed, gnunet-search will look for content matching any of the keywords. The prefix "+" makes a keyword mandatory.
Mime-type: text/plain
.ad b
-The first line contains the command to run to download the file. The suggested filename in the example is COPYING. The GNUnet URI consists of the key and query hash of the file and finally the size of the file. After the command to download the file GNUnet will print meta\-data about the file as advertised in the search result, here "The GNU Public License" and the mime\-type (see the options for gnunet\-insert on how to supply meta-data by hand).
+The first line contains the command to run to download the file. The suggested filename in the example is COPYING. The GNUnet URI consists of the key and query hash of the file and finally the size of the file. After the command to download the file GNUnet will print meta\-data about the file as advertised in the search result, here "The GNU Public License" and the mime\-type (see the options for gnunet\-publish on how to supply meta-data by hand).
.SH FILES
.TP
~/.gnunet/gnunet.conf
GNUnet configuration file; specifies the default value for the timeout
.SH "REPORTING BUGS"
-Report bugs to <https://gnunet.org/bugs/> or by sending electronic mail to <gnunet-developers@gnu.org>
+Report bugs to <https://gnunet.org/bugs/> or by sending electronic mail to <gnunet\-developers@gnu.org>
.SH "SEE ALSO"
\fBgnunet\-gtk\fP(1), \fBgnunet\-publish\fP(1), \fBgnunet\-download\fP(1), \fBgnunet\-pseudonym\fP(1), \fBgnunet.conf\fP(5), \fBgnunetd\fP(1)
gnunet_pseudonym_LDADD = \
$(top_builddir)/src/fs/libgnunetfs.la \
$(top_builddir)/src/util/libgnunetutil.la \
+ -lextractor \
$(GN_LIBINTL)
gnunet_search_SOURCES = \
struct GNUNET_FS_DirectoryBuilder *ret;
ret = GNUNET_malloc(sizeof(struct GNUNET_FS_DirectoryBuilder));
- ret->meta = GNUNET_CONTAINER_meta_data_duplicate (mdir);
+ if (mdir != NULL)
+ ret->meta = GNUNET_CONTAINER_meta_data_duplicate (mdir);
+ else
+ ret->meta = GNUNET_CONTAINER_meta_data_create ();
GNUNET_FS_meta_data_make_directory (ret->meta);
return ret;
}
* @author Christian Grothoff
*
* TODO:
+ * - handle recursive downloads (need directory &
+ * fs-level download-parallelism management)
* - location URI suppport (can wait, easy)
* - check if blocks exist already (can wait, easy)
- * - handle recursive downloads (need directory &
- * fs-level download-parallelism management, can wait)
* - check if iblocks can be computed from existing blocks (can wait, hard)
* - persistence (can wait)
*/
* @author Christian Grothoff
*
* TODO:
- * - handle SKS updates searches nicely (can wait)
- * - handle availability probes (can wait)
- * - make operations persistent (can wait)
- * - handle namespace advertisements (can wait)
+ * - handle namespace advertisements (can wait; might already work!?)
* - add support for pushing "already seen" information
* to FS service for bloomfilter (can wait)
+ * - handle availability probes (can wait)
+ * - make operations persistent (can wait)
*/
#include "platform.h"
}
+/**
+ * Create an SKS URI from a namespace and an identifier.
+ *
+ * @param ns namespace
+ * @param id identifier
+ * @param emsg where to store an error message
+ * @return an FS URI for the given namespace and identifier
+ */
+struct GNUNET_FS_Uri *
+GNUNET_FS_uri_sks_create (struct GNUNET_FS_Namespace *ns,
+ const char *id,
+ char **emsg)
+{
+ struct GNUNET_FS_Uri *ns_uri;
+ struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded pk;
+
+ ns_uri = GNUNET_malloc (sizeof (struct GNUNET_FS_Uri));
+ ns_uri->type = sks;
+ GNUNET_CRYPTO_rsa_key_get_public (ns->key,
+ &pk);
+ GNUNET_CRYPTO_hash (&pk,
+ sizeof (pk),
+ &ns_uri->data.sks.namespace);
+ ns_uri->data.sks.identifier = GNUNET_strdup (id);
+ return ns_uri;
+}
+
+
/**
* Canonicalize a keyword.
*
* @author Igor Wronsky
*
* TODO:
- * - many command-line options
+ * - download-directory option support (do_directory)
*/
#include "platform.h"
#include "gnunet_fs_service.h"
static unsigned int anonymity = 1;
+static unsigned int parallelism = 16;
+
+static int do_recursive;
+
+static int do_directory;
+
static char *filename;
info->value.download.filename,
s);
GNUNET_free (s);
- if (info->value.download.dc == dc)
- GNUNET_SCHEDULER_shutdown (sched);
+ if (do_directory)
+ {
+ GNUNET_break (0); //FIXME: not implemented
+ }
+ else
+ {
+ if (info->value.download.dc == dc)
+ GNUNET_SCHEDULER_shutdown (sched);
+ }
break;
case GNUNET_FS_STATUS_DOWNLOAD_STOPPED:
if (info->value.download.dc == dc)
enum GNUNET_FS_DownloadOptions options;
sched = s;
- /* FIXME: check arguments */
- uri = GNUNET_FS_uri_parse (args[0],
- &emsg);
- if (NULL == uri)
+ if (do_directory)
{
- fprintf (stderr,
- _("Failed to parse URI: %s\n"),
- emsg);
- GNUNET_free (emsg);
- ret = 1;
- return;
+ GNUNET_break (0); //FIXME: not implemented
}
- if (! GNUNET_FS_uri_test_chk (uri))
+ else
{
- fprintf (stderr,
- "Only CHK URIs supported right now.\n");
- ret = 1;
- GNUNET_FS_uri_destroy (uri);
- return;
+ uri = GNUNET_FS_uri_parse (args[0],
+ &emsg);
+ if (NULL == uri)
+ {
+ fprintf (stderr,
+ _("Failed to parse URI: %s\n"),
+ emsg);
+ GNUNET_free (emsg);
+ ret = 1;
+ return;
+ }
+ if (! GNUNET_FS_uri_test_chk (uri))
+ {
+ fprintf (stderr,
+ "Only CHK URIs supported right now.\n");
+ ret = 1;
+ GNUNET_FS_uri_destroy (uri);
+ return;
+ }
}
if (NULL == filename)
{
&progress_cb,
NULL,
GNUNET_FS_FLAGS_NONE,
+ GNUNET_FS_OPTIONS_DOWNLOAD_PARALLELISM,
+ parallelism,
GNUNET_FS_OPTIONS_END);
if (NULL == ctx)
{
return;
}
options = GNUNET_FS_DOWNLOAD_OPTION_NONE;
- dc = GNUNET_FS_download_start (ctx,
- uri,
- NULL,
- filename,
- 0,
- GNUNET_FS_uri_chk_get_file_size (uri),
- anonymity,
- options,
- NULL,
- NULL);
- GNUNET_FS_uri_destroy (uri);
- if (dc == NULL)
+ if (do_recursive)
+ options |= GNUNET_FS_DOWNLOAD_OPTION_RECURSIVE;
+ if (do_directory)
{
- GNUNET_FS_stop (ctx);
- ctx = NULL;
- return;
+ GNUNET_break (0); //FIXME: not implemented
+ }
+ else
+ {
+ dc = GNUNET_FS_download_start (ctx,
+ uri,
+ NULL,
+ filename,
+ 0,
+ GNUNET_FS_uri_chk_get_file_size (uri),
+ anonymity,
+ options,
+ NULL,
+ NULL);
+ GNUNET_FS_uri_destroy (uri);
+ if (dc == NULL)
+ {
+ GNUNET_FS_stop (ctx);
+ ctx = NULL;
+ return;
+ }
}
GNUNET_SCHEDULER_add_delayed (sched,
GNUNET_TIME_UNIT_FOREVER_REL,
{'a', "anonymity", "LEVEL",
gettext_noop ("set the desired LEVEL of receiver-anonymity"),
1, &GNUNET_GETOPT_set_uint, &anonymity},
-#if 0
- // FIXME: options!
{'d', "directory", NULL,
gettext_noop
("download a GNUnet directory that has already been downloaded. Requires that a filename of an existing file is specified instead of the URI. The download will only download the top-level files in the directory unless the `-R' option is also specified."),
- 0, &GNUNET_getopt_configure_set_one, &do_directory},
+ 0, &GNUNET_GETOPT_set_one, &do_directory},
{'D', "delete-incomplete", NULL,
gettext_noop ("delete incomplete downloads (when aborted with CTRL-C)"),
- 0, &GNUNET_getopt_configure_set_one, &do_delete_incomplete},
-#endif
+ 0, &GNUNET_GETOPT_set_one, &delete_incomplete},
{'o', "output", "FILENAME",
gettext_noop ("write the file to FILENAME"),
1, &GNUNET_GETOPT_set_string, &filename},
-#if 0
{'p', "parallelism", "DOWNLOADS",
gettext_noop
("set the maximum number of parallel downloads that are allowed"),
- 1, &GNUNET_getopt_configure_set_uint, ¶llelism},
+ 1, &GNUNET_GETOPT_set_uint, ¶llelism},
{'R', "recursive", NULL,
gettext_noop ("download a GNUnet directory recursively"),
- 0, &GNUNET_getopt_configure_set_one, &do_recursive},
-#endif
+ 0, &GNUNET_GETOPT_set_one, &do_recursive},
{'V', "verbose", NULL,
gettext_noop ("be verbose (print progress information)"),
0, &GNUNET_GETOPT_set_one, &verbose},
*/
static struct GNUNET_CONTAINER_MetaData *adv_metadata;
-/**
- * -n option.
- */
-static int no_advertising;
-
/**
* -p option.
*/
*/
static struct GNUNET_FS_Namespace *ns;
+/**
+ * Our configuration.
+ */
+static const struct GNUNET_CONFIGURATION_Handle *cfg;
static int ret;
}
+static int
+pseudo_printer (void *cls,
+ const GNUNET_HashCode *
+ pseudonym,
+ const struct
+ GNUNET_CONTAINER_MetaData * md,
+ int rating)
+{
+ char *id;
+
+ id = GNUNET_PSEUDONYM_id_to_name (cfg,
+ pseudonym);
+ if (id == NULL)
+ {
+ GNUNET_break (0);
+ return GNUNET_OK;
+ }
+ fprintf (stdout,
+ "%s (%d):\n",
+ id,
+ rating);
+ GNUNET_CONTAINER_meta_data_iterate (md,
+ &EXTRACTOR_meta_data_print,
+ stdout);
+ fprintf (stdout, "\n");
+ GNUNET_free (id);
+ return GNUNET_OK;
+}
+
+
static void
post_advertising (void *cls,
const struct GNUNET_FS_Uri *uri,
const char *emsg)
{
+ GNUNET_HashCode nsid;
+ char *set;
+ int delta;
+
if (emsg != NULL)
{
fprintf (stderr, "%s", emsg);
}
if (NULL != rating_change)
{
- GNUNET_break (0); // FIXME: not implemented
+ set = rating_change;
+ while ((*set != '\0') && (*set != ':'))
+ set++;
+ if (*set != ':')
+ {
+ GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
+ _("Invalid argument `%s'\n"),
+ rating_change);
+ }
+ else
+ {
+ *set = '\0';
+ delta = strtol (&set[1], NULL, /* no error handling yet */
+ 10);
+ if (GNUNET_OK ==
+ GNUNET_PSEUDONYM_name_to_id (cfg,
+ rating_change,
+ &nsid))
+ {
+ GNUNET_PSEUDONYM_rank (cfg,
+ &nsid,
+ delta);
+
+ }
+ else
+ {
+ GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
+ _("Namespace `%s' unknown.\n"),
+ rating_change);
+ }
+ }
+ GNUNET_free (rating_change);
+ rating_change = NULL;
}
if (0 != print_local_only)
{
}
else if (0 == no_remote_printing)
{
- GNUNET_break (0); // FIXME: not implemented
+ GNUNET_PSEUDONYM_list_all (cfg,
+ &pseudo_printer,
+ NULL);
}
- /* FIXME: is this OK here, or do we need
- for completion of previous requests? */
GNUNET_FS_stop (h);
}
* @param sched the scheduler to use
* @param args remaining command-line arguments
* @param cfgfile name of the configuration file used (for saving, can be NULL!)
- * @param cfg configuration
+ * @param c configuration
*/
static void
run (void *cls,
struct GNUNET_SCHEDULER_Handle *sched,
char *const *args,
const char *cfgfile,
- const struct GNUNET_CONFIGURATION_Handle *cfg)
+ const struct GNUNET_CONFIGURATION_Handle *c)
{
struct GNUNET_FS_Uri *ns_uri;
struct GNUNET_TIME_Absolute expiration;
+ char *emsg;
+ cfg = c;
h = GNUNET_FS_start (sched,
cfg,
"gnunet-pseudonym",
}
else
{
- if (0 == no_advertising)
+ if (NULL != root_identifier)
{
- GNUNET_break (0); // FIXME: not implemented
- ns_uri = NULL; // FIXME!!
+ emsg = NULL;
+ ns_uri = GNUNET_FS_uri_sks_create (ns, root_identifier, &emsg);
+ GNUNET_assert (emsg == NULL);
expiration = GNUNET_TIME_relative_to_absolute (GNUNET_TIME_UNIT_YEARS);
+ if (ksk_uri == NULL)
+ {
+ emsg = NULL;
+ ksk_uri = GNUNET_FS_uri_parse ("gnunet://fs/ksk/namespace", &emsg);
+ GNUNET_assert (NULL == emsg);
+ }
GNUNET_FS_publish_ksk (h,
ksk_uri,
adv_metadata,
{'m', "meta", "TYPE:VALUE",
gettext_noop ("set the meta-data for the given TYPE to the given VALUE"),
1, &GNUNET_FS_getopt_set_metadata, &adv_metadata},
- {'n', "no-advertisement", NULL,
- gettext_noop ("do not create an advertisement"),
- 0, &GNUNET_GETOPT_set_one, &no_advertising},
{'p', "priority", "PRIORITY",
gettext_noop ("use the given PRIORITY for the advertisments"),
1, &GNUNET_GETOPT_set_uint, &priority},
* @author Krista Bennett
* @author James Blackwell
* @author Igor Wronsky
- *
- * TODO:
- * - support for some options is still missing (uri argument)
*/
#include "platform.h"
#include "gnunet_fs_service.h"
}
+static void
+uri_ksk_continuation (void *cls,
+ const struct GNUNET_FS_Uri *uri,
+ const char *emsg)
+{
+ if (emsg != NULL)
+ {
+ fprintf (stderr,
+ "%s\n",
+ emsg);
+ ret = 1;
+ }
+ GNUNET_FS_stop (ctx);
+}
+
+
/**
* Main function that will be run by the scheduler.
*
struct stat sbuf;
char *ex;
char *emsg;
+ struct GNUNET_FS_Uri *uri;
sched = s;
/* check arguments */
}
}
if (NULL != uri_string)
- {
- // FIXME -- implement!
+ {
+ emsg = NULL;
+ uri = GNUNET_FS_uri_parse (uri_string,
+ &emsg);
+ if (uri == NULL)
+ {
+ fprintf (stderr,
+ _("Failed to parse URI: %s\n"),
+ emsg);
+ GNUNET_free (emsg);
+ GNUNET_FS_stop (ctx);
+ ret = 1;
+ return;
+ }
+ GNUNET_FS_publish_ksk (ctx,
+ topKeywords,
+ meta,
+ uri,
+ GNUNET_TIME_relative_to_absolute (DEFAULT_EXPIRATION),
+ anonymity,
+ priority,
+ GNUNET_FS_PUBLISH_OPTION_NONE,
+ &uri_ksk_continuation,
+ NULL);
return;
}
-
l = NULL;
if (! disable_extractor)
{
* @author Krista Bennett
* @author James Blackwell
* @author Igor Wronsky
- *
- * TODO:
- * - add many options (timeout, namespace search, etc.)
*/
#include "platform.h"
#include "gnunet_fs_service.h"
static struct GNUNET_FS_SearchContext *sc;
+static char *output_filename;
+
+static struct GNUNET_FS_DirectoryBuilder *db;
+
static unsigned int anonymity = 1;
static int verbose;
return GNUNET_OK;
}
+
static void
clean_task (void *cls,
const struct GNUNET_SCHEDULER_TaskContext *tc)
{
+ size_t dsize;
+ void *ddata;
+
GNUNET_FS_stop (ctx);
ctx = NULL;
+ if (output_filename == NULL)
+ return;
+ if (GNUNET_OK !=
+ GNUNET_FS_directory_builder_finish (db,
+ &dsize,
+ &ddata))
+ {
+ GNUNET_break (0);
+ GNUNET_free (output_filename);
+ return;
+ }
+ if (dsize !=
+ GNUNET_DISK_fn_write (output_filename,
+ ddata,
+ dsize,
+ GNUNET_DISK_PERM_USER_READ | GNUNET_DISK_PERM_USER_WRITE))
+ {
+ fprintf (stderr,
+ _("Failed to write directory with search results to `%s'\n"),
+ output_filename);
+ }
+ GNUNET_free_non_null (ddata);
+ GNUNET_free (output_filename);
}
case GNUNET_FS_STATUS_SEARCH_START:
break;
case GNUNET_FS_STATUS_SEARCH_RESULT:
+ if (db != NULL)
+ GNUNET_FS_directory_builder_add (db,
+ info->value.search.specifics.result.uri,
+ info->value.search.specifics.result.meta,
+ NULL);
uri = GNUNET_FS_uri_to_string (info->value.search.specifics.result.uri);
printf ("%s:\n", uri);
filename =
GNUNET_SCHEDULER_shutdown (sched);
break;
case GNUNET_FS_STATUS_SEARCH_STOPPED:
- sc = NULL;
GNUNET_SCHEDULER_add_continuation (sched,
&clean_task,
NULL,
ret = 1;
return;
}
+ if (output_filename != NULL)
+ db = GNUNET_FS_directory_builder_create (NULL);
sc = GNUNET_FS_search_start (ctx,
uri,
anonymity,
{'a', "anonymity", "LEVEL",
gettext_noop ("set the desired LEVEL of receiver-anonymity"),
1, &GNUNET_GETOPT_set_uint, &anonymity},
- // FIXME: options!
+ {'o', "output", "PREFIX",
+ gettext_noop
+ ("write search results to file starting with PREFIX"),
+ 1, &GNUNET_GETOPT_set_string, &output_filename},
GNUNET_GETOPT_OPTION_END
};
GNUNET_FS_uri_test_sks (const struct GNUNET_FS_Uri *uri);
+/**
+ * Handle to one of our namespaces.
+ */
+struct GNUNET_FS_Namespace;
+
+
+/**
+ * Create an SKS URI from a namespace and an identifier.
+ *
+ * @param ns namespace
+ * @param id identifier
+ * @param emsg where to store an error message
+ * @return an FS URI for the given namespace and identifier
+ */
+struct GNUNET_FS_Uri *
+GNUNET_FS_uri_sks_create (struct GNUNET_FS_Namespace *ns,
+ const char *id,
+ char **emsg);
+
+
/**
* Get the ID of a namespace from the given
* namespace URI.
};
-/**
- * Handle to one of our namespaces.
- */
-struct GNUNET_FS_Namespace;
-
-
/**
* Handle for controlling an upload.
*/