GNUnet  0.10.x
Functions | Variables
gnunet-search.c File Reference

searching for files on GNUnet More...

#include "platform.h"
#include "gnunet_fs_service.h"
Include dependency graph for gnunet-search.c:

Go to the source code of this file.

Functions

static int item_printer (void *cls, const char *plugin_name, enum EXTRACTOR_MetaType type, enum EXTRACTOR_MetaFormat format, const char *data_mime_type, const char *data, size_t data_size)
 Type of a function that libextractor calls for each meta data item found. More...
 
static void clean_task (void *cls)
 
static void * progress_cb (void *cls, const struct GNUNET_FS_ProgressInfo *info)
 Called by FS client to give information about the progress of an operation. More...
 
static void shutdown_task (void *cls)
 
static void timeout_task (void *cls)
 
static void run (void *cls, char *const *args, const char *cfgfile, const struct GNUNET_CONFIGURATION_Handle *c)
 Main function that will be run by the scheduler. More...
 
int main (int argc, char *const *argv)
 The main function to search GNUnet. More...
 

Variables

static int ret
 
static const struct GNUNET_CONFIGURATION_Handlecfg
 
static struct GNUNET_FS_Handlectx
 
static struct GNUNET_FS_SearchContextsc
 
static char * output_filename
 
static struct GNUNET_FS_DirectoryBuilderdb
 
static unsigned int anonymity = 1
 
static struct GNUNET_TIME_Relative timeout
 Timeout for the search, 0 means to wait for CTRL-C. More...
 
static unsigned int results_limit
 
static unsigned int results
 
static unsigned int verbose
 
static int local_only
 
static struct GNUNET_SCHEDULER_Tasktt
 

Detailed Description

searching for files on GNUnet

Author
Christian Grothoff
Krista Bennett
James Blackwell
Igor Wronsky

Definition in file gnunet-search.c.

Function Documentation

◆ item_printer()

static int item_printer ( void *  cls,
const char *  plugin_name,
enum EXTRACTOR_MetaType  type,
enum EXTRACTOR_MetaFormat  format,
const char *  data_mime_type,
const char *  data,
size_t  data_size 
)
static

Type of a function that libextractor calls for each meta data item found.

Parameters
clsclosure (user-defined, unused)
plugin_namename of the plugin that produced this value; special values can be used (i.e. '<zlib>' for zlib being used in the main libextractor library and yielding meta data).
typelibextractor-type describing the meta data
formatbasic format information about data
data_mime_typemime-type of data (not of the original file); can be NULL (if mime-type is not known)
dataactual meta-data found
data_sizenumber of bytes in data
Returns
0 to continue extracting, 1 to abort

Definition at line 79 of file gnunet-search.c.

References dgettext, EXTRACTOR_METAFORMAT_C_STRING, EXTRACTOR_METAFORMAT_UTF8, EXTRACTOR_METATYPE_GNUNET_ORIGINAL_FILENAME, and LIBEXTRACTOR_GETTEXT_DOMAIN.

Referenced by progress_cb().

86 {
87  if ((format != EXTRACTOR_METAFORMAT_UTF8) &&
89  return 0;
91  return 0;
92 #if HAVE_LIBEXTRACTOR
93  printf ("\t%20s: %s\n",
95  EXTRACTOR_metatype_to_string (type)), data);
96 #else
97  printf ("\t%20d: %s\n",
98  type,
99  data);
100 #endif
101  return 0;
102 }
0-terminated, UTF-8 encoded string.
#define dgettext(Domainname, Msgid)
Definition: gettext.h:46
#define LIBEXTRACTOR_GETTEXT_DOMAIN
Definition: platform.h:209
enum GNUNET_TESTBED_UnderlayLinkModelType type
the type of this model
uint32_t data
The data value.
Here is the caller graph for this function:

◆ clean_task()

static void clean_task ( void *  cls)
static

Definition at line 106 of file gnunet-search.c.

References _, FPRINTF, GNUNET_break, GNUNET_DISK_fn_write(), GNUNET_DISK_PERM_USER_READ, GNUNET_DISK_PERM_USER_WRITE, GNUNET_free, GNUNET_free_non_null, GNUNET_FS_directory_builder_finish(), GNUNET_FS_stop(), GNUNET_OK, and output_filename.

Referenced by progress_cb().

107 {
108  size_t dsize;
109  void *ddata;
110 
112  ctx = NULL;
113  if (output_filename == NULL)
114  return;
115  if (GNUNET_OK != GNUNET_FS_directory_builder_finish (db, &dsize, &ddata))
116  {
117  GNUNET_break (0);
119  return;
120  }
121  if (dsize !=
122  GNUNET_DISK_fn_write (output_filename, ddata, dsize,
125  {
126  FPRINTF (stderr,
127  _("Failed to write directory with search results to `%s'\n"),
129  }
130  GNUNET_free_non_null (ddata);
132 }
int GNUNET_FS_directory_builder_finish(struct GNUNET_FS_DirectoryBuilder *bld, size_t *rsize, void **rdata)
Finish building the directory.
Definition: fs_directory.c:574
#define FPRINTF
Definition: plibc.h:683
#define GNUNET_OK
Named constants for return values.
Definition: gnunet_common.h:78
#define GNUNET_free_non_null(ptr)
Free the memory pointed to by ptr if ptr is not NULL.
void GNUNET_FS_stop(struct GNUNET_FS_Handle *h)
Close our connection with the file-sharing service.
Definition: fs_api.c:3163
ssize_t GNUNET_DISK_fn_write(const char *fn, const void *buffer, size_t n, enum GNUNET_DISK_AccessPermissions mode)
Write a buffer to a file.
Definition: disk.c:1203
#define GNUNET_break(cond)
Use this for internal assertion violations that are not fatal (can be handled) but should not occur...
#define _(String)
GNU gettext support macro.
Definition: platform.h:208
static char * output_filename
Definition: gnunet-search.c:39
static struct GNUNET_FS_DirectoryBuilder * db
Definition: gnunet-search.c:41
static struct GNUNET_FS_Handle * ctx
Definition: gnunet-search.c:35
#define GNUNET_free(ptr)
Wrapper around free.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ progress_cb()

static void* progress_cb ( void *  cls,
const struct GNUNET_FS_ProgressInfo info 
)
static

Called by FS client to give information about the progress of an operation.

Parameters
clsclosure
infodetails about the event, specifying the event type and various bits about the event
Returns
client-context (for the next progress call for this operation; should be set to NULL for SUSPEND and STOPPED events). The value returned will be passed to future callbacks in the respective field in the GNUNET_FS_ProgressInfo struct.

Definition at line 149 of file gnunet-search.c.

References _, clean_task(), EXTRACTOR_METATYPE_GNUNET_ORIGINAL_FILENAME, filename, FPRINTF, GNUNET_CONTAINER_meta_data_get_by_type(), GNUNET_CONTAINER_meta_data_iterate(), GNUNET_DISK_filename_canonicalize(), GNUNET_free, GNUNET_free_non_null, GNUNET_FS_directory_builder_add(), GNUNET_FS_DIRECTORY_EXT, GNUNET_FS_meta_data_test_for_directory(), GNUNET_FS_STATUS_SEARCH_ERROR, GNUNET_FS_STATUS_SEARCH_RESULT, GNUNET_FS_STATUS_SEARCH_RESULT_STOPPED, GNUNET_FS_STATUS_SEARCH_START, GNUNET_FS_STATUS_SEARCH_STOPPED, GNUNET_FS_STATUS_SEARCH_UPDATE, GNUNET_FS_uri_to_string(), GNUNET_SCHEDULER_add_now(), GNUNET_SCHEDULER_shutdown(), GNUNET_YES, item_printer(), result, results, results_limit, GNUNET_FS_ProgressInfo::search, GNUNET_FS_ProgressInfo::status, uri, GNUNET_FS_ProgressInfo::value, and verbose.

Referenced by run().

150 {
151  static unsigned int cnt;
152  int is_directory;
153  char *uri;
154  char *filename;
155 
156  switch (info->status)
157  {
159  break;
161  if (db != NULL)
163  info->value.search.specifics.result.uri,
164  info->value.search.specifics.result.meta,
165  NULL);
166  uri = GNUNET_FS_uri_to_string (info->value.search.specifics.result.uri);
167  printf ("#%u:\n", ++cnt);
168  filename =
170  specifics.result.meta,
172  is_directory =
174  specifics.result.meta);
175  if (NULL != filename)
176  {
177  while ( (filename[0] != '\0') &&
178  ('/' == filename[strlen(filename)-1]) )
179  filename[strlen(filename)-1] = '\0';
181  if (GNUNET_YES == is_directory)
182  printf ("gnunet-download -o \"%s%s\" -R %s\n", filename, GNUNET_FS_DIRECTORY_EXT, uri);
183  else
184  printf ("gnunet-download -o \"%s\" %s\n", filename, uri);
185  }
186  else if (GNUNET_YES == is_directory)
187  printf ("gnunet-download -o \"collection%s\" -R %s\n", GNUNET_FS_DIRECTORY_EXT, uri);
188  else
189  printf ("gnunet-download %s\n", uri);
190  if (verbose)
192  result.meta, &item_printer, NULL);
193  printf ("\n");
194  fflush (stdout);
195  GNUNET_free_non_null (filename);
196  GNUNET_free (uri);
197  results++;
198  if ((results_limit > 0) && (results >= results_limit))
200  break;
202  break;
204  /* ignore */
205  break;
207  FPRINTF (stderr, _("Error searching: %s.\n"),
208  info->value.search.specifics.error.message);
210  break;
213  break;
214  default:
215  FPRINTF (stderr, _("Unexpected status: %d\n"), info->status);
216  break;
217  }
218  return NULL;
219 }
struct GNUNET_FS_ProgressInfo::@28::@31 search
Values for all "GNUNET_FS_STATUS_SEARCH_*" events.
This search has yielded a result.
Last message from a search; this signals that there will be no further events associated with this se...
static void clean_task(void *cls)
Event generated for each search result when the respective search is stopped.
#define FPRINTF
Definition: plibc.h:683
First event generated when a client requests a search to begin or when a namespace result automatical...
#define GNUNET_free_non_null(ptr)
Free the memory pointed to by ptr if ptr is not NULL.
char * GNUNET_CONTAINER_meta_data_get_by_type(const struct GNUNET_CONTAINER_MetaData *md, enum EXTRACTOR_MetaType type)
Get the first MD entry of the given type.
void GNUNET_SCHEDULER_shutdown(void)
Request the shutdown of a scheduler.
Definition: scheduler.c:524
static unsigned int verbose
Definition: gnunet-search.c:54
#define _(String)
GNU gettext support macro.
Definition: platform.h:208
char * GNUNET_FS_uri_to_string(const struct GNUNET_FS_Uri *uri)
Convert a URI to a UTF-8 String.
Definition: fs_uri.c:1988
static struct GNUNET_FS_Uri * uri
Value of URI provided on command-line (when not publishing a file but just creating UBlocks to refer ...
void GNUNET_FS_directory_builder_add(struct GNUNET_FS_DirectoryBuilder *bld, const struct GNUNET_FS_Uri *uri, const struct GNUNET_CONTAINER_MetaData *md, const void *data)
Add an entry to a directory.
Definition: fs_directory.c:388
union GNUNET_FS_ProgressInfo::@28 value
Values that depend on the event type.
#define GNUNET_FS_DIRECTORY_EXT
static int item_printer(void *cls, const char *plugin_name, enum EXTRACTOR_MetaType type, enum EXTRACTOR_MetaFormat format, const char *data_mime_type, const char *data, size_t data_size)
Type of a function that libextractor calls for each meta data item found.
Definition: gnunet-search.c:79
struct GNUNET_SCHEDULER_Task * GNUNET_SCHEDULER_add_now(GNUNET_SCHEDULER_TaskCallback task, void *task_cls)
Schedule a new task to be run as soon as possible.
Definition: scheduler.c:1273
enum GNUNET_FS_Status status
Specific status code (determines the event type).
static char * filename
static int result
Global testing status.
int GNUNET_FS_meta_data_test_for_directory(const struct GNUNET_CONTAINER_MetaData *md)
Does the meta-data claim that this is a directory? Checks if the mime-type is that of a GNUnet direct...
Definition: fs_directory.c:54
static struct GNUNET_FS_DirectoryBuilder * db
Definition: gnunet-search.c:41
int GNUNET_CONTAINER_meta_data_iterate(const struct GNUNET_CONTAINER_MetaData *md, EXTRACTOR_MetaDataProcessor iter, void *iter_cls)
Iterate over MD entries.
static unsigned int results
Definition: gnunet-search.c:52
Signals a problem with this search.
We have additional data about the quality or availability of a search result.
#define GNUNET_YES
Definition: gnunet_common.h:80
static unsigned int results_limit
Definition: gnunet-search.c:50
void GNUNET_DISK_filename_canonicalize(char *fn)
Removes special characters as &#39;:&#39; from a filename.
Definition: disk.c:1497
#define GNUNET_free(ptr)
Wrapper around free.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ shutdown_task()

static void shutdown_task ( void *  cls)
static

Definition at line 223 of file gnunet-search.c.

References GNUNET_FS_search_stop().

Referenced by run().

224 {
225  if (sc != NULL)
226  {
228  sc = NULL;
229  }
230 }
static struct GNUNET_FS_SearchContext * sc
Definition: gnunet-search.c:37
void GNUNET_FS_search_stop(struct GNUNET_FS_SearchContext *sc)
Stop search for content.
Definition: fs_search.c:1757
Here is the call graph for this function:
Here is the caller graph for this function:

◆ timeout_task()

static void timeout_task ( void *  cls)
static

Definition at line 234 of file gnunet-search.c.

References GNUNET_SCHEDULER_shutdown().

Referenced by run().

235 {
236  tt = NULL;
238 }
static struct GNUNET_SCHEDULER_Task * tt
Definition: gnunet-search.c:58
void GNUNET_SCHEDULER_shutdown(void)
Request the shutdown of a scheduler.
Definition: scheduler.c:524
Here is the call graph for this function:
Here is the caller graph for this function:

◆ run()

static void run ( void *  cls,
char *const *  args,
const char *  cfgfile,
const struct GNUNET_CONFIGURATION_Handle c 
)
static

Main function that will be run by the scheduler.

Parameters
clsclosure
argsremaining command-line arguments
cfgfilename of the configuration file used (for saving, can be NULL!)
cconfiguration

Definition at line 250 of file gnunet-search.c.

References _, anonymity, FPRINTF, GNUNET_FS_directory_builder_create(), GNUNET_FS_FLAGS_NONE, GNUNET_FS_OPTIONS_END, GNUNET_FS_SEARCH_OPTION_LOOPBACK_ONLY, GNUNET_FS_SEARCH_OPTION_NONE, GNUNET_FS_search_start(), GNUNET_FS_start(), GNUNET_FS_stop(), GNUNET_FS_uri_destroy(), GNUNET_FS_uri_ksk_create_from_args(), GNUNET_SCHEDULER_add_delayed(), GNUNET_SCHEDULER_add_shutdown(), local_only, options, output_filename, progress_cb(), GNUNET_TIME_Relative::rel_value_us, ret, shutdown_task(), timeout, timeout_task(), and uri.

Referenced by main().

252 {
253  struct GNUNET_FS_Uri *uri;
254  unsigned int argc;
256 
257  argc = 0;
258  while (NULL != args[argc])
259  argc++;
260  uri = GNUNET_FS_uri_ksk_create_from_args (argc, (const char **) args);
261  if (NULL == uri)
262  {
263  FPRINTF (stderr, "%s", _("Could not create keyword URI from arguments.\n"));
264  ret = 1;
265  return;
266  }
267  cfg = c;
268  ctx =
269  GNUNET_FS_start (cfg, "gnunet-search", &progress_cb, NULL,
271  if (NULL == ctx)
272  {
273  FPRINTF (stderr, _("Could not initialize `%s' subsystem.\n"), "FS");
274  GNUNET_FS_uri_destroy (uri);
275  ret = 1;
276  return;
277  }
278  if (output_filename != NULL)
281  if (local_only)
283  sc = GNUNET_FS_search_start (ctx, uri, anonymity, options, NULL);
284  GNUNET_FS_uri_destroy (uri);
285  if (NULL == sc)
286  {
287  FPRINTF (stderr, "%s", _("Could not start searching.\n"));
289  ret = 1;
290  return;
291  }
292  if (0 != timeout.rel_value_us)
294  &timeout_task,
295  NULL);
297  NULL);
298 }
No options (use defaults for everything).
uint64_t rel_value_us
The actual value.
struct GNUNET_FS_Uri * GNUNET_FS_uri_ksk_create_from_args(unsigned int argc, const char **argv)
Create an FS URI from a user-supplied command line of keywords.
Definition: fs_uri.c:1146
struct GNUNET_GETOPT_CommandLineOption options[]
Definition: 002.c:5
#define FPRINTF
Definition: plibc.h:683
struct GNUNET_SCHEDULER_Task * GNUNET_SCHEDULER_add_shutdown(GNUNET_SCHEDULER_TaskCallback task, void *task_cls)
Schedule a new task to be run on shutdown, that is when a CTRL-C signal is received, or when GNUNET_SCHEDULER_shutdown() is being invoked.
Definition: scheduler.c:1293
static void shutdown_task(void *cls)
GNUNET_FS_SearchOptions
Options for searching.
Last option in the VARARG list.
static struct GNUNET_SCHEDULER_Task * tt
Definition: gnunet-search.c:58
void GNUNET_FS_stop(struct GNUNET_FS_Handle *h)
Close our connection with the file-sharing service.
Definition: fs_api.c:3163
static int ret
Definition: gnunet-search.c:31
struct GNUNET_FS_Handle * GNUNET_FS_start(const struct GNUNET_CONFIGURATION_Handle *cfg, const char *client_name, GNUNET_FS_ProgressCallback upcb, void *upcb_cls, enum GNUNET_FS_Flags flags,...)
Setup a connection to the file-sharing service.
Definition: fs_api.c:3097
No special flags set.
#define _(String)
GNU gettext support macro.
Definition: platform.h:208
static struct GNUNET_FS_Uri * uri
Value of URI provided on command-line (when not publishing a file but just creating UBlocks to refer ...
struct GNUNET_SCHEDULER_Task * GNUNET_SCHEDULER_add_delayed(struct GNUNET_TIME_Relative delay, GNUNET_SCHEDULER_TaskCallback task, void *task_cls)
Schedule a new task to be run with a specified delay.
Definition: scheduler.c:1246
static void * progress_cb(void *cls, const struct GNUNET_FS_ProgressInfo *info)
Called by FS client to give information about the progress of an operation.
static const struct GNUNET_CONFIGURATION_Handle * cfg
Definition: gnunet-search.c:33
struct GNUNET_FS_SearchContext * GNUNET_FS_search_start(struct GNUNET_FS_Handle *h, const struct GNUNET_FS_Uri *uri, uint32_t anonymity, enum GNUNET_FS_SearchOptions options, void *cctx)
Start search for content.
Definition: fs_search.c:1598
static struct GNUNET_TIME_Relative timeout
Timeout for the search, 0 means to wait for CTRL-C.
Definition: gnunet-search.c:48
static char * output_filename
Definition: gnunet-search.c:39
static int local_only
Definition: gnunet-search.c:56
static unsigned int anonymity
Definition: gnunet-search.c:43
static void timeout_task(void *cls)
void GNUNET_FS_uri_destroy(struct GNUNET_FS_Uri *uri)
Free URI.
Definition: fs_uri.c:670
static struct GNUNET_FS_SearchContext * sc
Definition: gnunet-search.c:37
static struct GNUNET_FS_DirectoryBuilder * db
Definition: gnunet-search.c:41
static struct GNUNET_FS_Handle * ctx
Definition: gnunet-search.c:35
A Universal Resource Identifier (URI), opaque.
Definition: fs_api.h:168
Only search the local host, do not search remote systems (no P2P)
struct GNUNET_FS_DirectoryBuilder * GNUNET_FS_directory_builder_create(const struct GNUNET_CONTAINER_MetaData *mdir)
Create a directory builder.
Definition: fs_directory.c:362
Here is the call graph for this function:
Here is the caller graph for this function:

◆ main()

int main ( int  argc,
char *const *  argv 
)

The main function to search GNUnet.

Parameters
argcnumber of arguments from the command line
argvcommand line arguments
Returns
0 ok, 1 on error

Definition at line 309 of file gnunet-search.c.

References anonymity, gettext_noop, GNUNET_free, GNUNET_GETOPT_OPTION_END, GNUNET_GETOPT_option_flag(), GNUNET_GETOPT_option_relative_time(), GNUNET_GETOPT_option_string(), GNUNET_GETOPT_option_uint(), GNUNET_GETOPT_option_verbose(), GNUNET_OK, GNUNET_PROGRAM_run(), GNUNET_STRINGS_get_utf8_args(), local_only, output_filename, results_limit, ret, run(), timeout, and verbose.

310 {
313  "anonymity",
314  "LEVEL",
315  gettext_noop ("set the desired LEVEL of receiver-anonymity"),
316  &anonymity),
318  "no-network",
319  gettext_noop ("only search the local peer (no P2P network search)"),
320  &local_only),
322  "output",
323  "PREFIX",
324  gettext_noop ("write search results to file starting with PREFIX"),
325  &output_filename),
327  "timeout",
328  "DELAY",
329  gettext_noop ("automatically terminate search after DELAY"),
330  &timeout),
333  "results",
334  "VALUE",
335  gettext_noop ("automatically terminate search "
336  "after VALUE results are found"),
337  &results_limit),
339  };
340 
341  if (GNUNET_OK !=
342  GNUNET_STRINGS_get_utf8_args (argc, argv,
343  &argc, &argv))
344  return 2;
345 
346  ret = (GNUNET_OK ==
347  GNUNET_PROGRAM_run (argc,
348  argv,
349  "gnunet-search [OPTIONS] KEYWORD",
351  ("Search GNUnet for files that were published on GNUnet"),
352  options, &run, NULL)) ? ret : 1;
353  GNUNET_free ((void*) argv);
354  return ret;
355 }
struct GNUNET_GETOPT_CommandLineOption GNUNET_GETOPT_option_relative_time(char shortName, const char *name, const char *argumentHelp, const char *description, struct GNUNET_TIME_Relative *val)
Allow user to specify a struct GNUNET_TIME_Relative (using human-readable "fancy" time)...
struct GNUNET_GETOPT_CommandLineOption options[]
Definition: 002.c:5
struct GNUNET_GETOPT_CommandLineOption GNUNET_GETOPT_option_verbose(unsigned int *level)
Define the &#39;-V&#39; verbosity option.
int GNUNET_STRINGS_get_utf8_args(int argc, char *const *argv, int *u8argc, char *const **u8argv)
Returns utf-8 encoded arguments.
Definition: strings.c:1521
static void run(void *cls, char *const *args, const char *cfgfile, const struct GNUNET_CONFIGURATION_Handle *c)
Main function that will be run by the scheduler.
#define GNUNET_OK
Named constants for return values.
Definition: gnunet_common.h:78
Definition of a command line option.
static unsigned int verbose
Definition: gnunet-search.c:54
struct GNUNET_GETOPT_CommandLineOption GNUNET_GETOPT_OPTION_END
Definition: 002.c:13
static int ret
Definition: gnunet-search.c:31
struct GNUNET_GETOPT_CommandLineOption GNUNET_GETOPT_option_string(char shortName, const char *name, const char *argumentHelp, const char *description, char **str)
Allow user to specify a string.
static struct GNUNET_TIME_Relative timeout
Timeout for the search, 0 means to wait for CTRL-C.
Definition: gnunet-search.c:48
static char * output_filename
Definition: gnunet-search.c:39
static int local_only
Definition: gnunet-search.c:56
static unsigned int anonymity
Definition: gnunet-search.c:43
struct GNUNET_GETOPT_CommandLineOption GNUNET_GETOPT_option_flag(char shortName, const char *name, const char *description, int *val)
Allow user to specify a flag (which internally means setting an integer to 1/GNUNET_YES/GNUNET_OK.
int GNUNET_PROGRAM_run(int argc, char *const *argv, const char *binaryName, const char *binaryHelp, const struct GNUNET_GETOPT_CommandLineOption *options, GNUNET_PROGRAM_Main task, void *task_cls)
Run a standard GNUnet command startup sequence (initialize loggers and configuration, parse options).
Definition: program.c:361
static unsigned int results_limit
Definition: gnunet-search.c:50
struct GNUNET_GETOPT_CommandLineOption GNUNET_GETOPT_option_uint(char shortName, const char *name, const char *argumentHelp, const char *description, unsigned int *val)
Allow user to specify an unsigned int.
#define GNUNET_free(ptr)
Wrapper around free.
#define gettext_noop(String)
Definition: gettext.h:69
Here is the call graph for this function:

Variable Documentation

◆ ret

int ret
static

Definition at line 31 of file gnunet-search.c.

Referenced by main(), and run().

◆ cfg

const struct GNUNET_CONFIGURATION_Handle* cfg
static

Definition at line 33 of file gnunet-search.c.

◆ ctx

struct GNUNET_FS_Handle* ctx
static

Definition at line 35 of file gnunet-search.c.

◆ sc

struct GNUNET_FS_SearchContext* sc
static

◆ output_filename

char* output_filename
static

Definition at line 39 of file gnunet-search.c.

Referenced by clean_task(), main(), and run().

◆ db

struct GNUNET_FS_DirectoryBuilder* db
static

Definition at line 41 of file gnunet-search.c.

Referenced by publish_content().

◆ anonymity

unsigned int anonymity = 1
static

Definition at line 43 of file gnunet-search.c.

Referenced by main(), and run().

◆ timeout

struct GNUNET_TIME_Relative timeout
static

Timeout for the search, 0 means to wait for CTRL-C.

Definition at line 48 of file gnunet-search.c.

Referenced by main(), and run().

◆ results_limit

unsigned int results_limit
static

Definition at line 50 of file gnunet-search.c.

Referenced by main(), and progress_cb().

◆ results

unsigned int results
static

Definition at line 52 of file gnunet-search.c.

Referenced by GNUNET_OS_network_interfaces_list(), ListNICs(), and progress_cb().

◆ verbose

unsigned int verbose
static

Definition at line 54 of file gnunet-search.c.

Referenced by main(), and progress_cb().

◆ local_only

int local_only
static

Definition at line 56 of file gnunet-search.c.

Referenced by main(), and run().

◆ tt

struct GNUNET_SCHEDULER_Task* tt
static

Definition at line 58 of file gnunet-search.c.