GNUnet  0.17.6
gnunet_fs_service.h
Go to the documentation of this file.
1 /*
2  This file is part of GNUnet
3  Copyright (C) 2004--2013 GNUnet e.V.
4 
5  GNUnet is free software: you can redistribute it and/or modify it
6  under the terms of the GNU Affero General Public License as published
7  by the Free Software Foundation, either version 3 of the License,
8  or (at your option) any later version.
9 
10  GNUnet is distributed in the hope that it will be useful, but
11  WITHOUT ANY WARRANTY; without even the implied warranty of
12  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13  Affero General Public License for more details.
14 
15  You should have received a copy of the GNU Affero General Public License
16  along with this program. If not, see <http://www.gnu.org/licenses/>.
17 
18  SPDX-License-Identifier: AGPL3.0-or-later
19  */
36 #ifndef GNUNET_FS_LIB_H
37 #define GNUNET_FS_LIB_H
38 
39 #include "gnunet_util_lib.h"
40 
41 #ifdef __cplusplus
42 extern "C"
43 {
44 #if 0 /* keep Emacsens' auto-indent happy */
45 }
46 #endif
47 #endif
48 
70 #define GNUNET_FS_VERSION 0x00090300
71 
72 
73 /* ******************** URI API *********************** */
74 
75 #define GNUNET_FS_URI_PREFIX "gnunet://fs/"
76 #define GNUNET_FS_URI_KSK_INFIX "ksk/"
77 #define GNUNET_FS_URI_SKS_INFIX "sks/"
78 #define GNUNET_FS_URI_CHK_INFIX "chk/"
79 #define GNUNET_FS_URI_LOC_INFIX "loc/"
80 
81 
86 #define GNUNET_FS_PROBE_UPDATE_FREQUENCY GNUNET_TIME_relative_multiply ( \
87  GNUNET_TIME_UNIT_MILLISECONDS, 250)
88 
92 struct GNUNET_FS_Uri;
93 
94 
103 typedef int
104 (*GNUNET_FS_KeywordIterator) (void *cls,
105  const char *keyword,
106  int is_mandatory);
107 
108 
117 int
118 GNUNET_FS_uri_to_key (const struct GNUNET_FS_Uri *uri,
119  struct GNUNET_HashCode *key);
120 
121 
128 char *
130 
131 
139 char *
141 
142 
151 void
153  const char *keyword,
154  int is_mandatory);
155 
156 
164 void
166  const char *keyword);
167 
168 
176 struct GNUNET_FS_Uri *
177 GNUNET_FS_uri_parse (const char *uri,
178  char **emsg);
179 
180 
186 void
188 
189 
196 unsigned int
198 
199 
209 int
212  void *iterator_cls);
213 
214 
222 int
224  struct GNUNET_PeerIdentity *peer);
225 
226 
233 struct GNUNET_FS_Uri *
235 
236 
245 
246 
259 struct GNUNET_FS_Uri *
260 GNUNET_FS_uri_loc_create (const struct GNUNET_FS_Uri *base_uri,
261  const struct GNUNET_CRYPTO_EddsaPrivateKey *sign_key,
262  struct GNUNET_TIME_Absolute expiration_time);
263 
264 
272 struct GNUNET_FS_Uri *
273 GNUNET_FS_uri_ksk_merge (const struct GNUNET_FS_Uri *u1,
274  const struct GNUNET_FS_Uri *u2);
275 
276 
283 struct GNUNET_FS_Uri *
284 GNUNET_FS_uri_dup (const struct GNUNET_FS_Uri *uri);
285 
286 
304 struct GNUNET_FS_Uri *
306  char **emsg);
307 
308 
326 struct GNUNET_FS_Uri *
327 GNUNET_FS_uri_ksk_create_from_args (unsigned int argc,
328  const char **argv);
329 
330 
338 int
339 GNUNET_FS_uri_test_equal (const struct GNUNET_FS_Uri *u1,
340  const struct GNUNET_FS_Uri *u2);
341 
342 
349 int
351 
352 
360 struct GNUNET_FS_Uri *
362  const char *id);
363 
364 
373 int
376 
377 
384 char *
386 
387 
394 int
396 
397 
404 int
406 
407 
415 uint64_t
417 
418 
425 int
427 
428 
437 struct GNUNET_FS_Uri *
439  *md);
440 
441 
442 /* ******************** command-line option parsing API *********************** */
443 
455  const char *name,
456  const char *argumentHelp,
457  const char *description,
458  struct GNUNET_FS_Uri **topKeywords);
459 
471  const char *name,
472  const char *argumentHelp,
473  const char *description,
475 
488 int
491  void *scls,
492  const char *option,
493  const char *value);
494 
495 
496 /* ************************* sharing API ***************** */
497 
498 
511 {
516 
521 
526 
531 
538 
545 
552 
557 
562 
567 
572 
577 
584 
590 
596 
602 
610 
617 
624 
630 
637 
642 
647 
653 
658 
663 
668 
674 
680 
687 
692 
697 
702 
707 
713 
719 
725 
730 };
731 
732 
737 
738 
743 
744 
749 
750 
757 
758 
763 
764 
771 
772 
778 {
782  union
783  {
787  struct GNUNET_FS_PublishStatusEvent
788  {
793 
798 
803  void *cctx;
804 
809  void *pctx;
810 
814  const char *filename;
815 
822  uint64_t size;
823 
829  struct GNUNET_TIME_Relative eta;
830 
836 
840  uint64_t completed;
841 
845  uint32_t anonymity;
846 
850  union
851  {
856  struct GNUNET_FS_PublishProgressEvent
857  {
861  const void *data;
862 
866  uint64_t offset;
867 
871  uint64_t data_len;
872 
877  unsigned int depth;
879 
884  struct GNUNET_FS_PublishProgressDirectoryEvent
885  {
889  uint64_t completed;
890 
894  uint64_t total;
895 
902  struct GNUNET_TIME_Relative eta;
904 
909  struct GNUNET_FS_PublishResumeEvent
910  {
914  const char *message;
915 
919  const struct GNUNET_FS_Uri *chk_uri;
920 
924  const struct GNUNET_FS_Uri *sks_uri;
926 
931  struct GNUNET_FS_PublishCompletedEvent
932  {
936  const struct GNUNET_FS_Uri *chk_uri;
937 
941  const struct GNUNET_FS_Uri *sks_uri;
943 
948  struct GNUNET_FS_PublishErrorEvent
949  {
953  const char *message;
954  } error;
957 
958 
962  struct GNUNET_FS_DownloadStatusEvent
963  {
968 
974  void *cctx;
975 
980  void *pctx;
981 
988  void *sctx;
989 
993  const struct GNUNET_FS_Uri *uri;
994 
998  const char *filename;
999 
1005  uint64_t size;
1006 
1012  struct GNUNET_TIME_Relative eta;
1013 
1018 
1022  uint64_t completed;
1023 
1027  uint32_t anonymity;
1028 
1033 
1037  union
1038  {
1043  struct GNUNET_FS_DownloadProgressEvent
1044  {
1051  const void *data;
1052 
1056  uint64_t offset;
1057 
1061  uint64_t data_len;
1062 
1068 
1073  unsigned int depth;
1074 
1082 
1091 
1096  struct GNUNET_FS_DownloadStartEvent
1097  {
1103 
1108  struct GNUNET_FS_DownloadResumeEvent
1109  {
1113  const struct GNUNET_CONTAINER_MetaData *meta;
1114 
1118  const char *message;
1120 
1125  struct GNUNET_FS_DownloadErrorEvent
1126  {
1130  const char *message;
1134 
1138  struct GNUNET_FS_SearchStatusEvent
1139  {
1147 
1155  void *cctx;
1156 
1164  void *pctx;
1165 
1170  const struct GNUNET_FS_Uri *query;
1171 
1178 
1182  uint32_t anonymity;
1183 
1187  union
1188  {
1193  struct GNUNET_FS_SearchResultEvent
1194  {
1198  const struct GNUNET_CONTAINER_MetaData *meta;
1199 
1203  const struct GNUNET_FS_Uri *uri;
1204 
1209 
1216 
1221  struct GNUNET_FS_SearchResumeResultEvent
1222  {
1226  const struct GNUNET_CONTAINER_MetaData *meta;
1227 
1231  const struct GNUNET_FS_Uri *uri;
1232 
1237 
1243 
1249 
1255  uint32_t applicability_rank;
1257 
1262  struct GNUNET_FS_SearchUpdateEvent
1263  {
1268  void *cctx;
1269 
1273  const struct GNUNET_CONTAINER_MetaData *meta;
1274 
1278  const struct GNUNET_FS_Uri *uri;
1279 
1284  int32_t availability_rank;
1285 
1290  uint32_t availability_certainty;
1291 
1298 
1304 
1314  struct GNUNET_FS_SearchSuspendResultEvent
1315  {
1320  void *cctx;
1321 
1325  const struct GNUNET_CONTAINER_MetaData *meta;
1326 
1330  const struct GNUNET_FS_Uri *uri;
1332 
1342  struct GNUNET_FS_SearchStoppedResultEvent
1343  {
1348  void *cctx;
1349 
1353  const struct GNUNET_CONTAINER_MetaData *meta;
1354 
1358  const struct GNUNET_FS_Uri *uri;
1360 
1365  struct GNUNET_GS_SearchResumeEvent
1366  {
1370  const char *message;
1371 
1377 
1382  struct GNUNET_FS_SearchErrorEvent
1383  {
1387  const char *message;
1389 
1393  struct GNUNET_GS_SearchResultNamespaceEvent
1394  {
1398  const char *name;
1399 
1403  const char *root;
1404 
1409 
1414  } ns;
1417 
1421  struct GNUNET_FS_UnindexEvent
1422  {
1427 
1433  void *cctx;
1434 
1438  const char *filename;
1439 
1443  uint64_t size;
1444 
1450  struct GNUNET_TIME_Relative eta;
1451 
1457 
1461  uint64_t completed;
1462 
1466  union
1467  {
1472  struct GNUNET_FS_UnindexProgressEvent
1473  {
1477  const void *data;
1478 
1482  uint64_t offset;
1483 
1487  uint64_t data_len;
1488 
1493  unsigned int depth;
1495 
1500  struct GNUNET_FS_UnindexResumeEvent
1501  {
1505  const char *message;
1507 
1512  struct GNUNET_FS_UnindexErrorEvent
1513  {
1517  const char *message;
1522 
1526  enum GNUNET_FS_Status status;
1527 
1532 };
1533 
1534 
1550 typedef void *
1551 (*GNUNET_FS_ProgressCallback) (void *cls,
1552  const struct GNUNET_FS_ProgressInfo *info);
1553 
1554 
1559 {
1564 
1570 
1577 };
1578 
1579 
1584 {
1589 
1596 
1604 };
1605 
1606 
1612 {
1621 
1627 
1634 
1647 };
1648 
1649 
1653 struct GNUNET_FS_Handle;
1654 
1655 
1667 struct GNUNET_FS_Handle *
1669  const char *client_name,
1671  void *upcb_cls,
1672  enum GNUNET_FS_Flags flags,
1673  ...);
1674 
1675 
1685 void
1687 
1688 
1704 typedef int
1706  struct GNUNET_FS_FileInformation *fi,
1707  uint64_t length,
1709  struct GNUNET_FS_Uri **uri,
1710  struct GNUNET_FS_BlockOptions *bo,
1711  int *do_index,
1712  void **client_info);
1713 
1714 
1724 const char *
1726 
1727 
1734 const char *
1736 
1737 
1746 void
1748  const char *filename);
1749 
1750 
1767  void *client_info,
1768  const char *filename,
1769  const struct
1771  const struct
1773  int do_index,
1774  const struct
1776 
1777 
1796  void *client_info,
1797  uint64_t length,
1798  void *data,
1799  const struct
1801  const struct
1803  int do_index,
1804  const struct
1806 
1807 
1828 typedef size_t
1829 (*GNUNET_FS_DataReader) (void *cls,
1830  uint64_t offset,
1831  size_t max,
1832  void *buf,
1833  char **emsg);
1834 
1835 
1854  void *client_info,
1855  uint64_t length,
1857  void *reader_cls,
1858  const struct GNUNET_FS_Uri
1859  *keywords,
1860  const struct
1862  int do_index,
1863  const struct
1865 
1866 
1881  void *client_info,
1882  const struct GNUNET_FS_Uri
1883  *keywords,
1884  const struct
1886  *meta,
1887  const struct
1889  const char *filename);
1890 
1891 
1898 int
1900  *ent);
1901 
1902 
1914 int
1916  struct GNUNET_FS_FileInformation *ent);
1917 
1918 
1933 void
1936  void *proc_cls);
1937 
1938 
1949 void
1952  void *cleaner_cls);
1953 
1954 
1960 {
1965 
1971 };
1972 
1973 
1987 struct GNUNET_FS_PublishContext *
1989  struct GNUNET_FS_FileInformation *fi,
1990  const struct GNUNET_CRYPTO_EcdsaPrivateKey *ns,
1991  const char *nid,
1992  const char *nuid,
1994 
1995 
2004 void
2006 
2007 
2016 typedef void
2017 (*GNUNET_FS_PublishContinuation) (void *cls,
2018  const struct GNUNET_FS_Uri *uri,
2019  const char *emsg);
2020 
2021 
2026 
2027 
2043  const struct GNUNET_FS_Uri *ksk_uri,
2044  const struct GNUNET_CONTAINER_MetaData *meta,
2045  const struct GNUNET_FS_Uri *uri,
2046  const struct GNUNET_FS_BlockOptions *bo,
2049 
2050 
2056 void
2058 
2059 
2064 
2065 
2083  const struct GNUNET_CRYPTO_EcdsaPrivateKey *ns,
2084  const char *identifier,
2085  const char *update,
2086  const struct GNUNET_CONTAINER_MetaData *meta,
2087  const struct GNUNET_FS_Uri *uri,
2088  const struct GNUNET_FS_BlockOptions *bo,
2091 
2092 
2098 void
2100 
2101 
2110 typedef int
2111 (*GNUNET_FS_IndexedFileProcessor) (void *cls,
2112  const char *filename,
2113  const struct GNUNET_HashCode *file_id);
2114 
2115 
2120 
2121 
2133  void *iterator_cls);
2134 
2135 
2141 void
2143 
2144 
2153 struct GNUNET_FS_UnindexContext *
2155  const char *filename,
2156  void *cctx);
2157 
2158 
2164 void
2166 
2167 
2177 typedef void (*GNUNET_FS_IdentifierProcessor) (void *cls,
2178  const char *last_id,
2179  const struct
2180  GNUNET_FS_Uri *last_uri,
2181  const struct
2183  last_meta,
2184  const char *next_id);
2185 
2186 
2208 void
2210  const struct
2212  const char *next_id,
2214  void *ip_cls);
2215 
2216 
2222 {
2227 
2232 };
2233 
2234 
2246 struct GNUNET_FS_SearchContext *
2248  const struct GNUNET_FS_Uri *uri, uint32_t anonymity,
2249  enum GNUNET_FS_SearchOptions options, void *cctx);
2250 
2251 
2257 void
2259 
2260 
2266 void
2268 
2269 
2275 void
2277 
2278 
2289 struct GNUNET_FS_SearchResult *
2291  const struct GNUNET_FS_Uri *uri,
2292  const struct GNUNET_CONTAINER_MetaData *meta,
2293  void *client_info,
2294  uint32_t anonymity);
2295 
2296 
2304 void *
2306 
2307 
2313 {
2318 
2323 
2329 
2335 
2343  GNUNET_FS_DOWNLOAD_IS_PROBE = (1 << 31)
2344 };
2345 
2346 
2379  const struct GNUNET_FS_Uri *uri,
2380  const struct GNUNET_CONTAINER_MetaData *meta,
2381  const char *filename, const char *tempname,
2382  uint64_t offset, uint64_t length, uint32_t anonymity,
2383  enum GNUNET_FS_DownloadOptions options, void *cctx,
2385 
2386 
2423  struct GNUNET_FS_SearchResult *sr,
2424  const char *filename,
2425  const char *tempname, uint64_t offset,
2426  uint64_t length, uint32_t anonymity,
2428  void *cctx);
2429 
2430 
2437 void
2438 GNUNET_FS_download_stop (struct GNUNET_FS_DownloadContext *dc, int do_delete);
2439 
2440 
2446 void
2448 
2449 
2455 void
2457 
2458 
2459 /* ******************** Directory API *********************** */
2460 
2461 
2462 #define GNUNET_FS_DIRECTORY_MIME "application/gnunet-directory"
2463 #define GNUNET_FS_DIRECTORY_MAGIC "\211GND\r\n\032\n"
2464 #define GNUNET_FS_DIRECTORY_EXT ".gnd"
2465 
2473 int
2475  *md);
2476 
2477 
2484 void
2486 
2487 
2494 char *
2497 
2498 
2514 typedef void (*GNUNET_FS_DirectoryEntryProcessor) (void *cls,
2515  const char *filename,
2516  const struct GNUNET_FS_Uri *
2517  uri,
2518  const struct
2520  meta, size_t length,
2521  const void *data);
2522 
2523 
2543 int
2544 GNUNET_FS_directory_list_contents (size_t size, const void *data,
2545  uint64_t offset,
2547  void *dep_cls);
2548 
2549 
2554 
2555 
2563  *mdir);
2564 
2565 
2576 void
2578  const struct GNUNET_FS_Uri *uri,
2579  const struct GNUNET_CONTAINER_MetaData *md,
2580  const void *data);
2581 
2582 
2593 int
2595  size_t *rsize, void **rdata);
2596 
2597 
2598 /* ******************** DirScanner API *********************** */
2599 
2604 {
2609 
2615 
2620 
2625 
2631 
2636 };
2637 
2638 
2650 typedef void (*GNUNET_FS_DirScannerProgressCallback) (void *cls,
2651  const char *filename,
2652  int is_directory,
2653  enum
2655  reason);
2656 
2657 
2662 {
2667 
2672 
2678 
2684 
2690 
2695 
2700 
2704  char *filename;
2705 
2710 
2715 };
2716 
2717 
2721 struct GNUNET_FS_DirScanner;
2722 
2723 
2735 struct GNUNET_FS_DirScanner *
2737  int disable_extractor,
2738  const char *ex,
2740  void *cb_cls);
2741 
2742 
2749 void
2751 
2752 
2761 struct GNUNET_FS_ShareTreeItem *
2763 
2764 
2771 void
2773 
2774 
2780 void
2782 
2783 
2784 #if 0 /* keep Emacsens' auto-indent happy */
2785 {
2786 #endif
2787 #ifdef __cplusplus
2788 }
2789 #endif
2790 
2791 #endif
2792  /* end of group */
2794  /* end of group addition */
struct GNUNET_GETOPT_CommandLineOption options[]
Definition: 002.c:5
static const struct GNUNET_CONFIGURATION_Handle * cfg
Configuration we are using.
Definition: gnunet-abd.c:36
static struct GNUNET_NAMESTORE_Handle * ns
Handle to the namestore.
Definition: gnunet-abd.c:41
static struct GNUNET_ARM_Handle * h
Connection with ARM.
Definition: gnunet-arm.c:99
static char * dir
Set to the directory where runtime files are stored.
Definition: gnunet-arm.c:89
static int disable_extractor
Disable extractor option to use for publishing.
struct GNUNET_HashCode key
The key used in the DHT.
static unsigned int anonymity
static struct GNUNET_FS_DownloadContext * dc
static char * filename
uint32_t data
The data value.
static char * value
Value of the record to add/remove.
static struct GNUNET_FS_Uri * uri
Value of URI provided on command-line (when not publishing a file but just creating UBlocks to refer ...
static struct GNUNET_FS_DirScanner * ds
Handle to the directory scanner (for recursive insertions).
static char * pseudonym
Command-line option identifying the pseudonym to use for the publication.
static struct GNUNET_FS_BlockOptions bo
Options we set for published blocks.
static char * next_id
Command-line option for namespace publishing: identifier for updates to this publication.
static struct GNUNET_CONTAINER_MetaData * meta
Meta-data provided via command-line option.
static struct GNUNET_FS_PublishContext * pc
Handle to FS-publishing operation.
static struct GNUNET_FS_Uri * topKeywords
Keywords provided via command-line option.
#define info
static struct GNUNET_FS_SearchContext * sc
Definition: gnunet-search.c:84
static char buf[2048]
static struct GNUNET_FS_UnindexContext * uc
static struct GNUNET_DNSSTUB_Context * ctx
Context for DNS resolution.
GNUNET_FS_Flags
General (global) option flags for file-sharing.
GNUNET_FS_SearchOptions
Options for searching.
char * GNUNET_FS_uri_ksk_to_string_fancy(const struct GNUNET_FS_Uri *uri)
Convert keyword URI to a human readable format (i.e.
Definition: fs_uri.c:155
void GNUNET_FS_share_tree_free(struct GNUNET_FS_ShareTreeItem *toplevel)
Release memory of a share item tree.
Definition: fs_sharetree.c:436
struct GNUNET_TIME_Absolute GNUNET_FS_uri_loc_get_expiration(const struct GNUNET_FS_Uri *uri)
Obtain the expiration of the LOC URI.
Definition: fs_uri.c:845
char * GNUNET_FS_uri_sks_get_content_id(const struct GNUNET_FS_Uri *uri)
Get the content identifier of an SKS URI.
Definition: fs_uri.c:1322
int(* GNUNET_FS_KeywordIterator)(void *cls, const char *keyword, int is_mandatory)
Iterator over keywords.
struct GNUNET_FS_Uri * GNUNET_FS_uri_parse(const char *uri, char **emsg)
Convert a UTF-8 String to a URI.
Definition: fs_uri.c:644
GNUNET_FS_DownloadOptions
Options for downloading.
int GNUNET_FS_directory_list_contents(size_t size, const void *data, uint64_t offset, GNUNET_FS_DirectoryEntryProcessor dep, void *dep_cls)
Iterate over all entries in a directory.
Definition: fs_directory.c:181
void *(* GNUNET_FS_ProgressCallback)(void *cls, const struct GNUNET_FS_ProgressInfo *info)
Notification of FS to a client about the progress of an operation.
int GNUNET_FS_directory_builder_finish(struct GNUNET_FS_DirectoryBuilder *bld, size_t *rsize, void **rdata)
Finish building the directory.
Definition: fs_directory.c:577
struct GNUNET_FS_SearchResult * GNUNET_FS_probe(struct GNUNET_FS_Handle *h, const struct GNUNET_FS_Uri *uri, const struct GNUNET_CONTAINER_MetaData *meta, void *client_info, uint32_t anonymity)
Start download probes for the given search result.
Definition: fs_search.c:488
void GNUNET_FS_uri_ksk_remove_keyword(struct GNUNET_FS_Uri *uri, const char *keyword)
Remove the given keyword from the set of keywords represented by the URI.
Definition: fs_uri.c:796
void GNUNET_FS_publish_ksk_cancel(struct GNUNET_FS_PublishKskContext *pkc)
Abort the KSK publishing operation.
struct GNUNET_FS_Uri * GNUNET_FS_uri_ksk_create_from_meta_data(const struct GNUNET_CONTAINER_MetaData *md)
Construct a keyword-URI from meta-data (take all entries in the meta-data and construct one large key...
Definition: fs_uri.c:1787
void GNUNET_FS_search_continue(struct GNUNET_FS_SearchContext *sc)
Continue paused search.
Definition: fs_search.c:1657
void GNUNET_FS_namespace_list_updateable(struct GNUNET_FS_Handle *h, const struct GNUNET_CRYPTO_EcdsaPrivateKey *ns, const char *next_id, GNUNET_FS_IdentifierProcessor ip, void *ip_cls)
List all of the identifiers in the namespace for which we could produce an update.
Definition: fs_namespace.c:681
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
uint64_t GNUNET_FS_uri_chk_get_file_size(const struct GNUNET_FS_Uri *uri)
What is the size of the file that this URI refers to?
Definition: fs_uri.c:1376
int GNUNET_FS_uri_test_ksk(const struct GNUNET_FS_Uri *uri)
Is this a keyword URI?
Definition: fs_uri.c:1340
void * GNUNET_FS_probe_stop(struct GNUNET_FS_SearchResult *sr)
Stop probe activity.
Definition: fs_search.c:539
GNUNET_FS_OPTIONS
Options specified in the VARARGs portion of GNUNET_FS_start.
GNUNET_FS_Status
Possible status codes used in the callback for the various file-sharing operations.
struct GNUNET_FS_DownloadContext * GNUNET_FS_download_start(struct GNUNET_FS_Handle *h, const struct GNUNET_FS_Uri *uri, const struct GNUNET_CONTAINER_MetaData *meta, const char *filename, const char *tempname, uint64_t offset, uint64_t length, uint32_t anonymity, enum GNUNET_FS_DownloadOptions options, void *cctx, struct GNUNET_FS_DownloadContext *parent)
Download parts of a file.
Definition: fs_download.c:2130
struct GNUNET_FS_FileInformation * GNUNET_FS_file_information_create_from_file(struct GNUNET_FS_Handle *h, void *client_info, const char *filename, const struct GNUNET_FS_Uri *keywords, const struct GNUNET_CONTAINER_MetaData *meta, int do_index, const struct GNUNET_FS_BlockOptions *bo)
Create an entry for a file in a publish-structure.
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:391
size_t(* GNUNET_FS_DataReader)(void *cls, uint64_t offset, size_t max, void *buf, char **emsg)
Function that provides data.
void GNUNET_FS_get_indexed_files_cancel(struct GNUNET_FS_GetIndexedContext *gic)
Cancel iteration over all indexed files.
struct GNUNET_FS_PublishKskContext * GNUNET_FS_publish_ksk(struct GNUNET_FS_Handle *h, const struct GNUNET_FS_Uri *ksk_uri, const struct GNUNET_CONTAINER_MetaData *meta, const struct GNUNET_FS_Uri *uri, const struct GNUNET_FS_BlockOptions *bo, enum GNUNET_FS_PublishOptions options, GNUNET_FS_PublishContinuation cont, void *cont_cls)
Publish a KBlock on GNUnet.
int(* GNUNET_FS_IndexedFileProcessor)(void *cls, const char *filename, const struct GNUNET_HashCode *file_id)
Type of a function called by GNUNET_FS_get_indexed_files.
int GNUNET_FS_file_information_add(struct GNUNET_FS_FileInformation *dir, struct GNUNET_FS_FileInformation *ent)
Add an entry to a directory in a publish-structure.
struct GNUNET_FS_Uri * GNUNET_FS_uri_loc_create(const struct GNUNET_FS_Uri *base_uri, const struct GNUNET_CRYPTO_EddsaPrivateKey *sign_key, struct GNUNET_TIME_Absolute expiration_time)
Construct a location URI (this peer will be used for the location).
Definition: fs_uri.c:885
int GNUNET_FS_uri_test_equal(const struct GNUNET_FS_Uri *u1, const struct GNUNET_FS_Uri *u2)
Test if two URIs are equal.
Definition: fs_uri.c:1217
void GNUNET_FS_file_information_inspect(struct GNUNET_FS_FileInformation *dir, GNUNET_FS_FileInformationProcessor proc, void *proc_cls)
Inspect a file or directory in a publish-structure.
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:1160
void GNUNET_FS_unindex_stop(struct GNUNET_FS_UnindexContext *uc)
Clean up after completion of an unindex operation.
Definition: fs_unindex.c:837
int GNUNET_FS_uri_test_loc(const struct GNUNET_FS_Uri *uri)
Is this a location URI?
Definition: fs_uri.c:1400
GNUNET_FS_PublishOptions
Options for publishing.
void GNUNET_FS_download_resume(struct GNUNET_FS_DownloadContext *dc)
Resume a suspended download.
Definition: fs_download.c:2291
struct GNUNET_FS_Uri * GNUNET_FS_uri_ksk_create(const char *keywords, char **emsg)
Create an FS URI from a single user-supplied string of keywords.
Definition: fs_uri.c:1065
char * GNUNET_FS_uri_to_string(const struct GNUNET_FS_Uri *uri)
Convert a URI to a UTF-8 String.
Definition: fs_uri.c:2033
void GNUNET_FS_search_stop(struct GNUNET_FS_SearchContext *sc)
Stop search for content.
Definition: fs_search.c:1765
const char * GNUNET_FS_file_information_get_id(struct GNUNET_FS_FileInformation *s)
Obtain the name under which this file information structure is stored on disk.
int GNUNET_FS_uri_ksk_get_keywords(const struct GNUNET_FS_Uri *uri, GNUNET_FS_KeywordIterator iterator, void *iterator_cls)
Iterate over all keywords in this keyword URI.
Definition: fs_uri.c:736
struct GNUNET_FS_PublishContext * GNUNET_FS_publish_start(struct GNUNET_FS_Handle *h, struct GNUNET_FS_FileInformation *fi, const struct GNUNET_CRYPTO_EcdsaPrivateKey *ns, const char *nid, const char *nuid, enum GNUNET_FS_PublishOptions options)
Publish a file or directory.
Definition: fs_publish.c:1442
void GNUNET_FS_uri_destroy(struct GNUNET_FS_Uri *uri)
Free URI.
Definition: fs_uri.c:684
struct GNUNET_FS_PublishSksContext * GNUNET_FS_publish_sks(struct GNUNET_FS_Handle *h, const struct GNUNET_CRYPTO_EcdsaPrivateKey *ns, const char *identifier, const char *update, const struct GNUNET_CONTAINER_MetaData *meta, const struct GNUNET_FS_Uri *uri, const struct GNUNET_FS_BlockOptions *bo, enum GNUNET_FS_PublishOptions options, GNUNET_FS_PublishContinuation cont, void *cont_cls)
Publish an SBlock on GNUnet.
Definition: fs_namespace.c:442
int GNUNET_FS_uri_sks_get_namespace(const struct GNUNET_FS_Uri *uri, struct GNUNET_CRYPTO_EcdsaPublicKey *pseudonym)
Get the public key of a namespace from the given namespace URI.
Definition: fs_uri.c:1302
int GNUNET_FS_uri_test_sks(const struct GNUNET_FS_Uri *uri)
Is this a namespace URI?
Definition: fs_uri.c:1287
const char * GNUNET_FS_file_information_get_filename(const struct GNUNET_FS_FileInformation *s)
Obtain the filename from the file information structure.
struct GNUNET_FS_Uri * GNUNET_FS_uri_dup(const struct GNUNET_FS_Uri *uri)
Duplicate URI.
Definition: fs_uri.c:1003
void GNUNET_FS_file_information_set_filename(struct GNUNET_FS_FileInformation *s, const char *filename)
Set the filename in the file information structure.
int GNUNET_FS_getopt_set_metadata(struct GNUNET_GETOPT_CommandLineProcessorContext *ctx, void *scls, const char *option, const char *value)
Command-line option parser function that allows the user to specify one or more '-m' options with met...
void GNUNET_FS_meta_data_make_directory(struct GNUNET_CONTAINER_MetaData *md)
Set the MIMETYPE information for the given metadata to "application/gnunet-directory".
Definition: fs_directory.c:80
struct GNUNET_GETOPT_CommandLineOption GNUNET_FS_GETOPT_METADATA(char shortName, const char *name, const char *argumentHelp, const char *description, struct GNUNET_CONTAINER_MetaData **meta)
Allow user to specify metadata.
Definition: fs_getopt.c:254
struct GNUNET_FS_FileInformation * GNUNET_FS_file_information_create_empty_directory(struct GNUNET_FS_Handle *h, void *client_info, const struct GNUNET_FS_Uri *keywords, const struct GNUNET_CONTAINER_MetaData *meta, const struct GNUNET_FS_BlockOptions *bo, const char *filename)
Create an entry for an empty directory in a publish-structure.
void GNUNET_FS_download_stop(struct GNUNET_FS_DownloadContext *dc, int do_delete)
Stop a download (aborts if download is incomplete).
Definition: fs_download.c:2318
GNUNET_FS_DirScannerProgressUpdateReason
Progress reasons of the directory scanner.
struct GNUNET_FS_Uri * GNUNET_FS_uri_ksk_merge(const struct GNUNET_FS_Uri *u1, const struct GNUNET_FS_Uri *u2)
Merge the sets of keywords from two KSK URIs.
Definition: fs_uri.c:947
char * GNUNET_FS_meta_data_suggest_filename(const struct GNUNET_CONTAINER_MetaData *md)
Suggest a filename based on given metadata.
Definition: fs_misc.c:38
struct GNUNET_FS_FileInformation * GNUNET_FS_file_information_create_from_data(struct GNUNET_FS_Handle *h, void *client_info, uint64_t length, void *data, const struct GNUNET_FS_Uri *keywords, const struct GNUNET_CONTAINER_MetaData *meta, int do_index, const struct GNUNET_FS_BlockOptions *bo)
Create an entry for a file in a publish-structure.
struct GNUNET_FS_DirectoryBuilder * GNUNET_FS_directory_builder_create(const struct GNUNET_CONTAINER_MetaData *mdir)
Create a directory builder.
Definition: fs_directory.c:365
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:3246
struct GNUNET_FS_Uri * GNUNET_FS_uri_sks_create(const struct GNUNET_CRYPTO_EcdsaPublicKey *ns, const char *id)
Create an SKS URI from a namespace ID and an identifier.
Definition: fs_uri.c:924
void(* GNUNET_FS_IdentifierProcessor)(void *cls, const char *last_id, const struct GNUNET_FS_Uri *last_uri, const struct GNUNET_CONTAINER_MetaData *last_meta, const char *next_id)
Function called on updateable identifiers.
int(* GNUNET_FS_FileInformationProcessor)(void *cls, struct GNUNET_FS_FileInformation *fi, uint64_t length, struct GNUNET_CONTAINER_MetaData *meta, struct GNUNET_FS_Uri **uri, struct GNUNET_FS_BlockOptions *bo, int *do_index, void **client_info)
Function called on entries in a struct GNUNET_FS_FileInformation iteration.
void(* GNUNET_FS_PublishContinuation)(void *cls, const struct GNUNET_FS_Uri *uri, const char *emsg)
Signature of a function called as the continuation of a KBlock or SBlock publication.
int GNUNET_FS_uri_test_chk(const struct GNUNET_FS_Uri *uri)
Is this a file (or directory) URI?
Definition: fs_uri.c:1362
void GNUNET_FS_stop(struct GNUNET_FS_Handle *h)
Close our connection with the file-sharing service.
Definition: fs_api.c:3321
struct GNUNET_FS_Uri * GNUNET_FS_uri_loc_get_uri(const struct GNUNET_FS_Uri *uri)
Obtain the URI of the content itself.
Definition: fs_uri.c:859
unsigned int GNUNET_FS_uri_ksk_get_keyword_count(const struct GNUNET_FS_Uri *uri)
How many keywords are ANDed in this keyword URI?
Definition: fs_uri.c:718
struct GNUNET_FS_FileInformation * GNUNET_FS_file_information_create_from_reader(struct GNUNET_FS_Handle *h, void *client_info, uint64_t length, GNUNET_FS_DataReader reader, void *reader_cls, const struct GNUNET_FS_Uri *keywords, const struct GNUNET_CONTAINER_MetaData *meta, int do_index, const struct GNUNET_FS_BlockOptions *bo)
Create an entry for a file in a publish-structure.
int GNUNET_FS_file_information_is_directory(const struct GNUNET_FS_FileInformation *ent)
Test if a given entry represents a directory.
struct GNUNET_FS_DownloadContext * GNUNET_FS_download_start_from_search(struct GNUNET_FS_Handle *h, struct GNUNET_FS_SearchResult *sr, const char *filename, const char *tempname, uint64_t offset, uint64_t length, uint32_t anonymity, enum GNUNET_FS_DownloadOptions options, void *cctx)
Download parts of a file based on a search result.
Definition: fs_download.c:2201
struct GNUNET_FS_GetIndexedContext * GNUNET_FS_get_indexed_files(struct GNUNET_FS_Handle *h, GNUNET_FS_IndexedFileProcessor iterator, void *iterator_cls)
Iterate over all indexed files.
struct GNUNET_FS_UnindexContext * GNUNET_FS_unindex_start(struct GNUNET_FS_Handle *h, const char *filename, void *cctx)
Unindex a file.
Definition: fs_unindex.c:795
void GNUNET_FS_publish_stop(struct GNUNET_FS_PublishContext *pc)
Stop a publication.
Definition: fs_publish.c:1570
void GNUNET_FS_search_pause(struct GNUNET_FS_SearchContext *sc)
Pause search.
Definition: fs_search.c:1626
int GNUNET_FS_uri_to_key(const struct GNUNET_FS_Uri *uri, struct GNUNET_HashCode *key)
Get a unique key from a URI.
Definition: fs_uri.c:103
void GNUNET_FS_directory_scan_abort(struct GNUNET_FS_DirScanner *ds)
Abort the scan.
struct GNUNET_FS_ShareTreeItem * GNUNET_FS_directory_scan_get_result(struct GNUNET_FS_DirScanner *ds)
Obtain the result of the scan after the scan has signalled completion.
void GNUNET_FS_file_information_destroy(struct GNUNET_FS_FileInformation *fi, GNUNET_FS_FileInformationProcessor cleaner, void *cleaner_cls)
Destroy publish-structure.
void GNUNET_FS_download_suspend(struct GNUNET_FS_DownloadContext *dc)
Suspend a download.
Definition: fs_download.c:2279
void GNUNET_FS_share_tree_trim(struct GNUNET_FS_ShareTreeItem *toplevel)
Process a share item tree, moving frequent keywords up and copying frequent metadata up.
Definition: fs_sharetree.c:416
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:1606
struct GNUNET_GETOPT_CommandLineOption GNUNET_FS_GETOPT_KEYWORDS(char shortName, const char *name, const char *argumentHelp, const char *description, struct GNUNET_FS_Uri **topKeywords)
Allow user to specify keywords.
Definition: fs_getopt.c:129
int GNUNET_FS_uri_loc_get_peer_identity(const struct GNUNET_FS_Uri *uri, struct GNUNET_PeerIdentity *peer)
Obtain the identity of the peer offering the data.
Definition: fs_uri.c:828
void GNUNET_FS_publish_sks_cancel(struct GNUNET_FS_PublishSksContext *psc)
Abort the SKS publishing operation.
Definition: fs_namespace.c:505
void(* GNUNET_FS_DirScannerProgressCallback)(void *cls, const char *filename, int is_directory, enum GNUNET_FS_DirScannerProgressUpdateReason reason)
Function called over time as the directory scanner makes progress on the job at hand.
struct GNUNET_FS_DirScanner * GNUNET_FS_directory_scan_start(const char *filename, int disable_extractor, const char *ex, GNUNET_FS_DirScannerProgressCallback cb, void *cb_cls)
Start a directory scanner.
void(* GNUNET_FS_DirectoryEntryProcessor)(void *cls, const char *filename, const struct GNUNET_FS_Uri *uri, const struct GNUNET_CONTAINER_MetaData *meta, size_t length, const void *data)
Function used to process entries in a directory.
void GNUNET_FS_uri_ksk_add_keyword(struct GNUNET_FS_Uri *uri, const char *keyword, int is_mandatory)
Add the given keyword to the set of keywords represented by the URI.
Definition: fs_uri.c:768
@ GNUNET_FS_FLAGS_PERSISTENCE
Is persistence of operations desired? (will create SUSPEND/RESUME events).
@ GNUNET_FS_FLAGS_DO_PROBES
Should we automatically trigger probes for search results to determine availability?...
@ GNUNET_FS_FLAGS_NONE
No special flags set.
@ GNUNET_FS_SEARCH_OPTION_LOOPBACK_ONLY
Only search the local host, do not search remote systems (no P2P)
@ GNUNET_FS_SEARCH_OPTION_NONE
No options (use defaults for everything).
@ GNUNET_FS_DOWNLOAD_OPTION_NONE
No options (use defaults for everything).
@ GNUNET_FS_DOWNLOAD_IS_PROBE
Internal option used to flag this download as a 'probe' for a search result.
@ GNUNET_FS_DOWNLOAD_OPTION_RECURSIVE
Do a recursive download (that is, automatically trigger the download of files in directories).
@ GNUNET_FS_DOWNLOAD_OPTION_LOOPBACK_ONLY
Only download from the local host, do not access remote systems (no P2P)
@ GNUNET_FS_DOWNLOAD_NO_TEMPORARIES
Do not append temporary data to the target file (for the IBlocks).
@ GNUNET_FS_OPTIONS_DOWNLOAD_PARALLELISM
Select the desired amount of parallelism (this option should be followed by an "unsigned int" giving ...
@ GNUNET_FS_OPTIONS_END
Last option in the VARARG list.
@ GNUNET_FS_OPTIONS_REQUEST_PARALLELISM
Maximum number of requests that should be pending at a given point in time (invidivual downloads may ...
@ GNUNET_FS_STATUS_UNINDEX_PROGRESS
Notification that we made progress unindexing a file.
@ GNUNET_FS_STATUS_SEARCH_UPDATE
We have additional data about the quality or availability of a search result.
@ GNUNET_FS_STATUS_DOWNLOAD_INACTIVE
Notification that this download is no longer actively being pursued (back in the queue).
@ GNUNET_FS_STATUS_SEARCH_RESULT_NAMESPACE
We have discovered a new namespace.
@ GNUNET_FS_STATUS_UNINDEX_RESUME
Notification that we resumed unindexing of a file.
@ GNUNET_FS_STATUS_DOWNLOAD_ERROR
Notification that this download encountered an error.
@ GNUNET_FS_STATUS_SEARCH_ERROR
Signals a problem with this search.
@ GNUNET_FS_STATUS_DOWNLOAD_COMPLETED
Notification that this download completed.
@ GNUNET_FS_STATUS_DOWNLOAD_RESUME
Notification that this download is being resumed.
@ GNUNET_FS_STATUS_SEARCH_RESULT_STOPPED
Event generated for each search result when the respective search is stopped.
@ GNUNET_FS_STATUS_UNINDEX_START
Notification that we started to unindex a file.
@ GNUNET_FS_STATUS_SEARCH_SUSPEND
Last event when a search is being suspended; note that "GNUNET_FS_SEARCH_STOPPED" will not be generat...
@ GNUNET_FS_STATUS_SEARCH_RESUME
Last event when a search is being resumed; note that "GNUNET_FS_SEARCH_START" will not be generated i...
@ GNUNET_FS_STATUS_SEARCH_RESUME_RESULT
Event generated for each search result when the respective search is resumed.
@ GNUNET_FS_STATUS_PUBLISH_STOPPED
Notification that we have stopped the process of uploading a file structure; no further events will b...
@ GNUNET_FS_STATUS_PUBLISH_ERROR
Notification that an error was encountered sharing a file structure.
@ GNUNET_FS_STATUS_UNINDEX_STOPPED
Notification that the unindexing of this file was stopped (final event for this action).
@ GNUNET_FS_STATUS_DOWNLOAD_SUSPEND
Notification that this download was suspended.
@ GNUNET_FS_STATUS_SEARCH_RESULT
This search has yielded a result.
@ GNUNET_FS_STATUS_PUBLISH_SUSPEND
Notification that we have suspended sharing a file structure.
@ GNUNET_FS_STATUS_SEARCH_CONTINUED
Signals that this search was continued (unpaused).
@ GNUNET_FS_STATUS_PUBLISH_PROGRESS
Notification that we are making progress sharing a file structure.
@ GNUNET_FS_STATUS_DOWNLOAD_START
Notification that we have started this download.
@ GNUNET_FS_STATUS_UNINDEX_COMPLETED
Notification that the unindexing of this file was completed.
@ GNUNET_FS_STATUS_SEARCH_PAUSED
Signals that this search was paused.
@ GNUNET_FS_STATUS_DOWNLOAD_PROGRESS
Notification about progress with this download.
@ GNUNET_FS_STATUS_DOWNLOAD_LOST_PARENT
Notification that this download is no longer part of a recursive download or search but now a 'stand-...
@ GNUNET_FS_STATUS_UNINDEX_SUSPEND
Notification that we suspended unindexing a file.
@ GNUNET_FS_STATUS_UNINDEX_ERROR
Notification that we encountered an error unindexing a file.
@ GNUNET_FS_STATUS_PUBLISH_PROGRESS_DIRECTORY
Notification that we are making progress sharing a directory.
@ GNUNET_FS_STATUS_PUBLISH_START
Notification that we have started to publish a file structure.
@ GNUNET_FS_STATUS_PUBLISH_COMPLETED
Notification that we completed sharing a file structure.
@ GNUNET_FS_STATUS_PUBLISH_RESUME
Notification that we have resumed sharing a file structure.
@ GNUNET_FS_STATUS_SEARCH_START
First event generated when a client requests a search to begin or when a namespace result automatical...
@ GNUNET_FS_STATUS_SEARCH_RESULT_SUSPEND
Event generated for each search result when the respective search is suspended.
@ GNUNET_FS_STATUS_DOWNLOAD_ACTIVE
Notification that this download is now actively being pursued (as opposed to waiting in the queue).
@ GNUNET_FS_STATUS_DOWNLOAD_STOPPED
Notification that this download was stopped (final event with respect to this action).
@ GNUNET_FS_STATUS_SEARCH_STOPPED
Last message from a search; this signals that there will be no further events associated with this se...
@ GNUNET_FS_PUBLISH_OPTION_SIMULATE_ONLY
Simulate publishing.
@ GNUNET_FS_PUBLISH_OPTION_NONE
No options (use defaults for everything).
@ GNUNET_FS_DIRSCANNER_INTERNAL_ERROR
There was an internal error.
@ GNUNET_FS_DIRSCANNER_FILE_IGNORED
We're having trouble accessing a file (soft-error); it will be ignored.
@ GNUNET_FS_DIRSCANNER_FINISHED
Last call to the progress function: we have finished scanning the directory.
@ GNUNET_FS_DIRSCANNER_EXTRACT_FINISHED
We've finished extracting meta data from a file.
@ GNUNET_FS_DIRSCANNER_ALL_COUNTED
We've found all files (in the pre-pass).
@ GNUNET_FS_DIRSCANNER_FILE_START
We've started processing a file or directory.
static int iterator(void *cls, const struct GNUNET_PeerIdentity *key, void *value)
Iterator over hash map entries.
#define max(x, y)
static unsigned int size
Size of the "table".
Definition: peer.c:67
const char * name
Meta data to associate with a file, directory or namespace.
Private ECC key encoded for transmission.
Public ECC key (always for Curve25519) encoded in a format suitable for network transmission and ECDS...
Private ECC key encoded for transmission.
Settings for publishing a block (which may of course also apply to an entire directory or file).
uint32_t anonymity_level
At which anonymity level should the block be shared? (0: no anonymity, 1: normal GAP,...
uint32_t content_priority
How important is it for us to store the block? If we run out of space, the highest-priority,...
uint32_t replication_level
How often should we try to migrate the block to other peers? Only used if "CONTENT_PUSHING" is set to...
struct GNUNET_TIME_Absolute expiration_time
At what time should the block expire? Data blocks (DBLOCKS and IBLOCKS) may still be used even if the...
An opaque structure a pointer to which is returned to the caller to be used to control the scanner.
Internal state of a directory builder.
Definition: fs_directory.c:341
Context for controlling a download.
Definition: fs_api.h:1743
uint64_t offset
What is the first offset that we're interested in?
Definition: fs_api.h:1877
uint64_t length
How many bytes starting from offset are desired? This is NOT the overall length of the file!
Definition: fs_api.h:1883
struct GNUNET_FS_DownloadContext * parent
Parent download (used when downloading files in directories).
Definition: fs_api.h:1763
Information for a file or directory that is about to be published.
Definition: fs_api.h:227
struct GNUNET_FS_Uri * keywords
Keywords to use for KBlocks.
Definition: fs_api.h:257
GNUNET_FS_DataReader reader
Function that can be used to read the data for the file.
Definition: fs_api.h:316
char * emsg
Error message (non-NULL if this operation failed).
Definition: fs_api.h:296
void * client_info
Pointer kept for the client.
Definition: fs_api.h:247
int do_index
Should the file be indexed or inserted?
Definition: fs_api.h:338
void * reader_cls
Closure for reader.
Definition: fs_api.h:321
Context for GNUNET_FS_get_indexed_files().
void * iterator_cls
Closure for iterator.
Master context for most FS operations.
Definition: fs_api.h:1069
enum GNUNET_FS_Flags flags
General flags.
Definition: fs_api.h:1161
char * client_name
Name of our client.
Definition: fs_api.h:1078
void * upcb_cls
Closure for upcb.
Definition: fs_api.h:1088
GNUNET_FS_ProgressCallback upcb
Function to call with updates on our progress.
Definition: fs_api.h:1083
Argument given to the progress callback with information about what is going on.
union GNUNET_FS_ProgressInfo::@25::GNUNET_FS_PublishStatusEvent::@26 specifics
Additional values for specific events.
struct GNUNET_FS_PublishContext * pc
Context for controlling the upload.
const char * root
Root identifier for the namespace, can be NULL.
void * cctx
Client context pointer (set the last time by the client for this operation; initially NULL on START/R...
struct GNUNET_FS_ProgressInfo::@25::GNUNET_FS_DownloadStatusEvent download
struct GNUNET_FS_ProgressInfo::@25::GNUNET_FS_PublishStatusEvent::@26::GNUNET_FS_PublishResumeEvent resume
unsigned int depth
Depth of the given block in the tree; 0 would be the lowest level (DBLOCKs).
struct GNUNET_FS_ProgressInfo::@25::GNUNET_FS_SearchStatusEvent::@28::GNUNET_GS_SearchResultNamespaceEvent ns
union GNUNET_FS_ProgressInfo::@25 value
Values that depend on the event type.
struct GNUNET_FS_ProgressInfo::@25::GNUNET_FS_PublishStatusEvent::@26::GNUNET_FS_PublishProgressDirectoryEvent progress_directory
int is_paused
Is this search currently paused?
struct GNUNET_FS_ProgressInfo::@25::GNUNET_FS_SearchStatusEvent::@28::GNUNET_FS_SearchUpdateEvent update
struct GNUNET_FS_ProgressInfo::@25::GNUNET_FS_SearchStatusEvent search
struct GNUNET_FS_ProgressInfo::@25::GNUNET_FS_SearchStatusEvent::@28::GNUNET_FS_SearchResumeResultEvent resume_result
struct GNUNET_FS_Handle * fsh
File-sharing handle that generated the event.
enum GNUNET_FS_Status status
Specific status code (determines the event type).
struct GNUNET_FS_ProgressInfo::@25::GNUNET_FS_PublishStatusEvent publish
struct GNUNET_CRYPTO_EcdsaPublicKey pseudonym
Public key of the namespace.
struct GNUNET_TIME_Relative duration
How long has this upload been actively running (excludes times where the upload was suspended).
const void * data
Data block we just published.
struct GNUNET_FS_ProgressInfo::@25::GNUNET_FS_PublishStatusEvent::@26::GNUNET_FS_PublishProgressEvent progress
void * sctx
Client context pointer for the associated search operation (specifically, context pointer for the spe...
void * pctx
Client context pointer for the parent operation (if this is a file in a directory or a subdirectory).
struct GNUNET_TIME_Relative eta
At what time do we expect to finish the upload? (will be a value in the past for completed uploads).
uint32_t anonymity
What anonymity level is used for this upload?
int32_t availability_rank
Current availability rank (negative: unavailable, positive: available)
uint32_t availability_certainty
On how many total queries is the given availability_rank based?
const char * filename
Name of the file being published; can be NULL.
uint64_t size
How large is the file overall? For directories, this is only the size of the directory itself,...
const struct GNUNET_CONTAINER_MetaData * meta
Known metadata for the download.
struct GNUNET_FS_ProgressInfo::@25::GNUNET_FS_SearchStatusEvent::@28::GNUNET_FS_SearchSuspendResultEvent result_suspend
uint32_t num_transmissions
How often did we transmit the request? (estimate, because we might have the same request pending for ...
const struct GNUNET_FS_Uri * uri
URI used for this download.
const char * name
Short, human-readable name of the namespace.
struct GNUNET_FS_ProgressInfo::@25::GNUNET_FS_DownloadStatusEvent::@27::GNUNET_FS_DownloadStartEvent start
uint64_t offset
At what offset in the file is "data"?
struct GNUNET_FS_DownloadContext * dc
Context for controlling the download.
struct GNUNET_FS_SearchContext * sc
Context for controlling the search, NULL for searches that were not explicitly triggered by the clien...
const struct GNUNET_FS_Uri * query
What query is used for this search (list of keywords or SKS identifier).
const char * message
Error message, NULL if no error was encountered so far.
struct GNUNET_TIME_Relative block_download_duration
How much time passed between us asking for this block and actually getting it? GNUNET_TIME_UNIT_FOREV...
int is_active
Is the download currently active.
struct GNUNET_FS_ProgressInfo::@25::GNUNET_FS_UnindexEvent unindex
uint64_t data_len
Length of the data block.
uint32_t applicability_rank
Applicability rank (the larger, the better the result fits the search criteria).
uint64_t completed
How many bytes have we completed?
struct GNUNET_TIME_Relative current_probe_time
How long has the current probe been active?
const struct GNUNET_FS_FileInformation * fi
Information about the file that is being published.
struct GNUNET_FS_ProgressInfo::@25::GNUNET_FS_PublishStatusEvent::@26::GNUNET_FS_PublishErrorEvent error
struct GNUNET_FS_ProgressInfo::@25::GNUNET_FS_SearchStatusEvent::@28::GNUNET_FS_SearchStoppedResultEvent result_stopped
uint64_t total
How big do we estimate the entire directory to be?
struct GNUNET_FS_UnindexContext * uc
Context for controlling the unindexing.
const struct GNUNET_FS_Uri * chk_uri
URI of the file (if the download had been completed)
struct GNUNET_FS_SearchResult * result
Handle to the result (for starting downloads).
const struct GNUNET_FS_Uri * sks_uri
SKS URI of the file (if the download had been completed)
uint32_t respect_offered
How much respect did we offer for downloading this block? (estimate, because we might have the same r...
Handle for controlling a publication process.
Definition: fs_api.h:1179
char * nuid
ID for future updates, NULL if we have no namespace or no updates.
Definition: fs_api.h:1208
struct GNUNET_FS_FileInformation * fi
File-structure that is being shared.
Definition: fs_api.h:1193
char * nid
ID of the content in the namespace, NULL if we have no namespace.
Definition: fs_api.h:1203
Context for the KSK publication.
struct GNUNET_FS_Uri * ksk_uri
Keywords to use.
void * cont_cls
Closure for cont.
GNUNET_FS_PublishContinuation cont
Function to call once we're done.
Context for the SKS publication.
Definition: fs_namespace.c:344
GNUNET_FS_PublishContinuation cont
Function to call once we're done.
Definition: fs_namespace.c:374
void * cont_cls
Closure for cont.
Definition: fs_namespace.c:379
Handle for controlling a search.
Definition: fs_api.h:1510
Information we store for each search result.
Definition: fs_api.h:498
void * client_info
Client info for this search result.
Definition: fs_api.h:533
A node of a directory tree (produced by dirscanner)
int is_directory
GNUNET_YES if this is a directory
struct GNUNET_FS_ShareTreeItem * parent
This is a doubly-linked tree NULL for top-level entries.
struct GNUNET_FS_ShareTreeItem * prev
This is a doubly-linked list.
struct GNUNET_FS_Uri * ksk_uri
Keywords for this file or directory (derived from metadata).
char * short_filename
Base name of the file/directory.
struct GNUNET_FS_ShareTreeItem * next
This is a doubly-linked list.
struct GNUNET_FS_ShareTreeItem * children_head
This is a doubly-linked tree NULL for files and empty directories.
char * filename
Name of the file/directory.
struct GNUNET_FS_ShareTreeItem * children_tail
This is a doubly-linked tree NULL for files and empty directories.
struct GNUNET_CONTAINER_MetaData * meta
Metadata for this file or directory.
Handle for controlling an unindexing operation.
Definition: fs_api.h:1350
A Universal Resource Identifier (URI), opaque.
Definition: fs_api.h:166
char ** keywords
Keywords start with a '+' if they are mandatory (in which case the '+' is NOT part of the keyword) an...
Definition: fs_api.h:185
Definition of a command line option.
const char * description
Help text for the option (description)
const char * argumentHelp
Name of the argument for the user in help text.
const char shortName
Short name of the option.
General context for command line processors.
A 512-bit hashcode.
The identity of the host (wraps the signing key of the peer).
Time for absolute times used by GNUnet, in microseconds.
Time for relative time used by GNUnet, in microseconds.
struct GNUNET_TESTBED_Peer * peer
The peer associated with this model.