aboutsummaryrefslogtreecommitdiff
path: root/src/fs/gnunet-search.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/fs/gnunet-search.c')
-rw-r--r--src/fs/gnunet-search.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/fs/gnunet-search.c b/src/fs/gnunet-search.c
index 64955a3ee..0226a340e 100644
--- a/src/fs/gnunet-search.c
+++ b/src/fs/gnunet-search.c
@@ -46,6 +46,8 @@ static unsigned int anonymity = 1;
46 46
47static int verbose; 47static int verbose;
48 48
49static int local_only;
50
49/** 51/**
50 * Type of a function that libextractor calls for each 52 * Type of a function that libextractor calls for each
51 * meta data item found. 53 * meta data item found.
@@ -231,6 +233,7 @@ run (void *cls,
231{ 233{
232 struct GNUNET_FS_Uri *uri; 234 struct GNUNET_FS_Uri *uri;
233 unsigned int argc; 235 unsigned int argc;
236 enum GNUNET_FS_SearchOptions options;
234 237
235 sched = s; 238 sched = s;
236 argc = 0; 239 argc = 0;
@@ -266,9 +269,13 @@ run (void *cls,
266 } 269 }
267 if (output_filename != NULL) 270 if (output_filename != NULL)
268 db = GNUNET_FS_directory_builder_create (NULL); 271 db = GNUNET_FS_directory_builder_create (NULL);
272 options = GNUNET_FS_SEARCH_OPTION_NONE;
273 if (local_only)
274 options |= GNUNET_FS_SEARCH_OPTION_LOOPBACK_ONLY;
269 sc = GNUNET_FS_search_start (ctx, 275 sc = GNUNET_FS_search_start (ctx,
270 uri, 276 uri,
271 anonymity, 277 anonymity,
278 options,
272 NULL); 279 NULL);
273 GNUNET_FS_uri_destroy (uri); 280 GNUNET_FS_uri_destroy (uri);
274 if (NULL == sc) 281 if (NULL == sc)
@@ -293,6 +300,9 @@ static struct GNUNET_GETOPT_CommandLineOption options[] = {
293 {'a', "anonymity", "LEVEL", 300 {'a', "anonymity", "LEVEL",
294 gettext_noop ("set the desired LEVEL of receiver-anonymity"), 301 gettext_noop ("set the desired LEVEL of receiver-anonymity"),
295 1, &GNUNET_GETOPT_set_uint, &anonymity}, 302 1, &GNUNET_GETOPT_set_uint, &anonymity},
303 {'n', "no-network", NULL,
304 gettext_noop ("only search the local peer (no P2P network search)"),
305 1, &GNUNET_GETOPT_set_uint, &local_only},
296 {'o', "output", "PREFIX", 306 {'o', "output", "PREFIX",
297 gettext_noop 307 gettext_noop
298 ("write search results to file starting with PREFIX"), 308 ("write search results to file starting with PREFIX"),