GNUnet  0.10.x
fs_api.h
Go to the documentation of this file.
1 /*
2  This file is part of GNUnet.
3  Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009 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  */
20 
26 #ifndef FS_API_H
27 #define FS_API_H
28 
29 #include "gnunet_constants.h"
31 #include "gnunet_dht_service.h"
32 #include "gnunet_fs_service.h"
33 #include "gnunet_block_lib.h"
34 #include "block_fs.h"
35 #include "fs.h"
36 
43 #define CHK_PER_INODE 256
44 
49 #define MAX_INLINE_SIZE 65536
50 
54 #define GNUNET_FS_SYNC_PATH_MASTER_SEARCH "search"
55 
59 #define GNUNET_FS_SYNC_PATH_CHILD_SEARCH "search-child"
60 
65 #define GNUNET_FS_SYNC_PATH_MASTER_DOWNLOAD "download"
66 
71 #define GNUNET_FS_SYNC_PATH_CHILD_DOWNLOAD "download-child"
72 
76 #define GNUNET_FS_SYNC_PATH_MASTER_PUBLISH "publish"
77 
81 #define GNUNET_FS_SYNC_PATH_FILE_INFO "publish-file"
82 
86 #define GNUNET_FS_SYNC_PATH_MASTER_UNINDEX "unindex"
87 
88 
97  uint64_t file_length;
98 
103 };
104 
105 
110 struct Location {
114  struct FileIdentifier fi;
115 
120 
124  struct GNUNET_TIME_Absolute expirationTime;
125 
130  struct GNUNET_CRYPTO_EddsaSignature contentSignature;
131 };
132 
141 
146 
151 
156 };
157 
158 
167 
168  union {
169  struct {
179  char **keywords;
180 
184  unsigned int keywordCount;
185  } ksk;
186 
187  struct {
192 
197  char *identifier;
198  } sks;
199 
204  struct FileIdentifier chk;
205 
210  struct Location loc;
211  } data;
212 };
213 
214 
224 
230 
235 
239  void *client_info;
240 
245 
250 
256 
262 
267 
272 
279 
284 
288  char *emsg;
289 
293  char *filename;
294 
298  union {
302  struct {
307 
311  void *reader_cls;
312 
318  struct GNUNET_HashCode file_id;
319 
323  uint64_t file_size;
324 
328  int do_index;
329 
335 
341  } file;
342 
346  struct {
351 
356  size_t dir_size;
357 
362  void *dir_data;
363 
368 
372  uint64_t contents_size;
373  } dir;
374  } data;
375 
380 
385 };
386 
387 
396 
401 };
402 
403 
412 
417 
422 
427 
431  void *cls;
432 
437 
442 
446  struct GNUNET_TIME_Absolute queue_time;
447 
452 
457  struct GNUNET_TIME_Relative run_time;
458 
462  unsigned int blocks;
463 
467  enum GNUNET_FS_QueuePriority priority;
468 
472  unsigned int start_times;
473 
477  int active;
478 };
479 
480 
489 
494 
499 
505 
510 
515 
519  void *client_info;
520 
526 
532 
538 
543 
547  uint8_t *keyword_bitmap;
548 
553 
560 
564  struct GNUNET_TIME_Absolute probe_active_time;
565 
569  struct GNUNET_TIME_Relative remaining_probe_time;
570 
574  uint32_t anonymity;
575 
582 
588 
593 
599 };
600 
601 
613 struct GNUNET_FS_QueueEntry *
617  void *cls,
618  unsigned int blocks,
620 
621 
627 void
629 
630 
647 size_t
649  uint64_t offset,
650  size_t max,
651  void *buf,
652  char **emsg);
653 
654 
661 void *
663 
664 
665 
682 size_t
684  uint64_t offset,
685  size_t max,
686  void *buf,
687  char **emsg);
688 
689 
705 void *
707  const struct GNUNET_FS_ProgressInfo *info);
708 
709 
715 void
717 
718 
726 void
728  const struct GNUNET_HashCode *file_id);
729 
730 
736 void
738 
739 
745 void
747 
748 
759 void *
762  const struct GNUNET_FS_FileInformation *p,
763  uint64_t offset);
764 
765 
773 void
775  struct GNUNET_FS_DownloadContext *dc);
776 
777 
784 void
786 
787 
788 
797 void
800  uint64_t offset);
801 
811 void *
813  struct GNUNET_FS_Handle *h,
814  struct GNUNET_FS_SearchContext *sc);
815 
816 
822 void
824 
832 int
834 
840 void
842 
843 
849 void
851 
852 
860 void
862  const char *ext,
863  const char *ent);
864 
865 
873 void
875  const char *ext,
876  const char *uni);
877 
878 
887 void
889 
890 
899 void
901 
902 
911 void
913 
914 
923 void
925 
926 
935 void
937 
938 
947 void
949 
950 
957 void
959 
960 
967 void
969 
970 
977 void
979 
980 
987 void
989 
990 
998 typedef void (*SuspendSignalFunction) (void *cls);
999 
1009 
1014 
1019 
1023  void *ssf_cls;
1024 };
1025 
1026 
1035 struct TopLevelActivity *
1038  void *ssf_cls);
1039 
1040 
1047 void
1049  struct TopLevelActivity *top);
1050 
1051 
1052 
1061 
1066 
1071 
1075  void *upcb_cls;
1076 
1081 
1086 
1091 
1096 
1101 
1106 
1111 
1116 
1122 
1128 
1133  struct GNUNET_TIME_Relative avg_block_latency;
1134 
1138  unsigned int active_downloads;
1139 
1143  unsigned int active_blocks;
1144 
1148  enum GNUNET_FS_Flags flags;
1149 
1154 
1159 };
1160 
1161 
1170 
1175 
1180 
1185 
1189  char *nid;
1190 
1194  char *nuid;
1195 
1201 
1207 
1212 
1217 
1222 
1227 
1233 
1239 
1245 
1249  uint64_t reserve_space;
1250 
1256 
1261 
1266  int rid;
1267 
1273 
1278 
1285 };
1286 
1287 
1296 
1302 
1307 
1312 
1318 
1323 
1328 };
1329 
1330 
1339  struct ContentHashKey chk;
1340 
1345 
1350 
1355 
1360 
1364  uint32_t ksk_offset;
1365 
1369  char *filename;
1370 
1375 
1381 
1387 
1392 
1397 
1402 
1408 
1412  struct GNUNET_HashCode ukey;
1413 
1417  struct GNUNET_HashCode uquery;
1418 
1422  char *emsg;
1423 
1428 
1432  uint64_t file_size;
1433 
1438 
1442  struct GNUNET_HashCode file_id;
1443 
1448 };
1449 
1450 
1458  struct GNUNET_HashCode uquery;
1459 
1464 
1469  char *keyword;
1470 
1480 
1486 };
1487 
1488 
1497 
1502 
1507 
1513 
1518 
1523 
1528 
1532  char *emsg;
1533 
1541 
1547 
1552 
1556  struct GNUNET_TIME_Relative reconnect_backoff;
1557 
1565 
1569  uint32_t anonymity;
1570 
1575 
1580 };
1581 
1582 
1594 
1602 
1610 
1618 
1627 
1636 
1642 
1649 };
1650 
1651 
1660 
1665 
1670  struct ContentHashKey chk;
1671 
1677  uint64_t offset;
1678 
1682  unsigned int num_children;
1683 
1687  unsigned int depth;
1688 
1692  unsigned int chk_idx;
1693 
1698 };
1699 
1700 
1706 void
1708 
1709 
1715 void
1717 
1718 
1727 
1732 
1737 
1743 
1749 
1754 
1759 
1764 
1769 
1774 
1779 
1784 
1788  char *emsg;
1789 
1795 
1800  char *filename;
1801 
1808 
1813 
1818 
1824 
1830 
1835 
1840  struct GNUNET_PeerIdentity target;
1841 
1851 
1856  uint64_t offset;
1857 
1862  uint64_t length;
1863 
1868  uint64_t completed;
1869 
1876  uint64_t old_file_size;
1877 
1882 
1886  struct GNUNET_TIME_Relative reconnect_backoff;
1887 
1891  uint32_t anonymity;
1892 
1896  unsigned int treedepth;
1897 
1902 
1909 
1914 };
1915 
1916 
1917 #endif
1918 
1919 /* end of fs_api.h */
void * client_info
Client info for this search result.
Definition: fs_api.h:519
uint32_t optional_support
Number of optional keywords under which this result was also found.
Definition: fs_api.h:587
struct GNUNET_FS_FileInformation * entries
Linked list of entries in the directory.
Definition: fs_api.h:350
This is a probe (low priority).
Definition: fs_api.h:395
void * reader_cls
Closure for reader.
Definition: fs_api.h:311
char * nid
ID of the content in the namespace, NULL if we have no namespace.
Definition: fs_api.h:1189
Context for an ECRS-based file encoder that computes the Merkle-ish-CHK tree.
Definition: fs_tree.c:35
char * serialization
Short name under which we are serializing the state of this operation.
Definition: fs_api.h:1374
void * GNUNET_FS_search_probe_progress_(void *cls, const struct GNUNET_FS_ProgressInfo *info)
Notification of FS that a search probe has made progress.
Definition: fs_search.c:278
static char * dir
Set to the directory where runtime files are stored.
Definition: gnunet-arm.c:84
void GNUNET_FS_remove_sync_dir_(struct GNUNET_FS_Handle *h, const char *ext, const char *uni)
Remove serialization/deserialization directory from disk.
Definition: fs_api.c:802
static struct GNUNET_DATASTORE_QueueEntry * qe
Current operation.
struct GNUNET_SCHEDULER_Task * upload_task
ID of the task performing the upload.
Definition: fs_api.h:1244
struct ContentHashKey chk
Query and key of the top GNUNET_EC_IBlock.
Definition: fs_api.h:102
struct GNUNET_SCHEDULER_Task * task
ID of a task that is using this struct and that must be cancelled when the search is being stopped (i...
Definition: fs_api.h:1564
struct GNUNET_FS_FileInformation * dir
If this is a file in a directory, "dir" refers to the directory; otherwise NULL.
Definition: fs_api.h:229
Context for controlling a download.
Definition: fs_api.h:1722
uint32_t mandatory_count
Number of mandatory keywords in this query.
Definition: fs_api.h:1574
struct GNUNET_FS_DownloadContext * download
ID of an associated download based on this search result (or NULL for none).
Definition: fs_api.h:531
int rid
Space reservation ID with datastore service for this upload.
Definition: fs_api.h:1266
GNUNET_FS_Flags
General (global) option flags for file-sharing.
struct GNUNET_CONTAINER_MetaData * meta
Metadata to use for the file.
Definition: fs_api.h:244
struct GNUNET_FS_SearchResult * psearch_result
For update-searches, link to the search result that triggered the update search; otherwise NULL...
Definition: fs_api.h:1512
struct TopLevelActivity * prev
This is a doubly-linked list.
Definition: fs_api.h:1013
void GNUNET_FS_download_sync_(struct GNUNET_FS_DownloadContext *dc)
Synchronize this download struct with its mirror on disk.
Definition: fs_api.c:1971
struct GNUNET_FS_Handle * h
Global FS context.
Definition: fs_api.h:1726
struct GNUNET_GETOPT_CommandLineOption options[]
Definition: 002.c:5
Context for the SKS publication.
Definition: fs_namespace.c:332
content hash key
Definition: fs.h:53
void * client_info
Pointer kept for the client.
Definition: fs_api.h:239
struct DownloadRequest ** children
Array (!) of child-requests, or NULL for the bottom of the tree.
Definition: fs_api.h:1664
struct GNUNET_FS_TreeEncoder * tc
Merkle-ish tree encoder context.
Definition: fs_api.h:1396
uint32_t ksk_offset
Current offset in KSK removal.
Definition: fs_api.h:1364
void GNUNET_FS_file_information_sync_(struct GNUNET_FS_FileInformation *f)
Synchronize this file-information struct with its mirror on disk.
Definition: fs_api.c:1311
char * emsg
Error message (non-NULL if this operation failed).
Definition: fs_api.h:288
struct GNUNET_SCHEDULER_Task * queue_job
Task that processes the jobs in the running and pending queues (and moves jobs around as needed)...
Definition: fs_api.h:1121
char * serialization
Under what filename is this struct serialized (for operational persistence).
Definition: fs_api.h:278
struct GNUNET_FS_DownloadContext * child_head
Head of list of child downloads.
Definition: fs_api.h:1753
Master context for most FS operations.
Definition: fs_api.h:1056
We&#39;re done.
Definition: fs_api.h:1322
GNUNET_FS_DataReader reader
Function that can be used to read the data for the file.
Definition: fs_api.h:306
static int start
Set if we are to start default services (including ARM).
Definition: gnunet-arm.c:39
struct TopLevelActivity * top
Our top-level activity entry (if we are top-level, otherwise NULL).
Definition: fs_api.h:1501
char * emsg
Error message (non-NULL if this operation failed).
Definition: fs_api.h:1532
void GNUNET_FS_unindex_do_remove_(struct GNUNET_FS_UnindexContext *uc)
Connect to the datastore and remove the blocks.
Definition: fs_unindex.c:647
struct GNUNET_FS_SearchContext * sc
Search context this result belongs to; can be NULL for probes that come from a directory result...
Definition: fs_api.h:504
uint8_t * keyword_bitmap
Bitmap that specifies precisely which keywords have been matched already.
Definition: fs_api.h:547
int mandatory
Is this keyword a mandatory keyword (started with &#39;+&#39;)?
Definition: fs_api.h:1485
struct GNUNET_FS_QueueEntry * pending_head
Head of DLL of pending jobs.
Definition: fs_api.h:1100
void GNUNET_FS_download_make_status_(struct GNUNET_FS_ProgressInfo *pi, struct GNUNET_FS_DownloadContext *dc)
Fill in all of the generic fields for a download event and call the callback.
Definition: fs_download.c:103
struct DownloadRequest * top_request
Top-level download request.
Definition: fs_api.h:1834
struct GNUNET_FS_DownloadContext * parent
Parent download (used when downloading files in directories).
Definition: fs_api.h:1742
GNUNET_FS_SearchOptions
Options for searching.
struct GNUNET_ATS_TEST_Topology * top
Definition: ats-testing.c:52
static struct GNUNET_FS_UnindexContext * uc
definitions for the entire fs module
uint64_t offset
Offset of the corresponding block.
Definition: fs_api.h:1677
Keyword search key (query with keywords).
Definition: fs_api.h:150
uint64_t reserve_space
Storage space to reserve for the operation.
Definition: fs_api.h:1249
char * filename
Name of the file or directory (must be an absolute path).
Definition: fs_api.h:293
struct GNUNET_FS_Uri * uri
URI to which this search result refers to.
Definition: fs_api.h:509
unsigned int active_blocks
How many blocks do the active downloads have?
Definition: fs_api.h:1143
char * filename
Where are we writing the data (name of the file, can be NULL!).
Definition: fs_api.h:1800
struct GNUNET_CRYPTO_FileHashContext * fhc
Non-null if we are currently hashing a file.
Definition: fs_api.h:1216
struct GNUNET_DATASTORE_Handle * dsh
Connection to the datastore service.
Definition: fs_api.h:1221
struct GNUNET_FS_Handle * h
Handle to the global fs context.
Definition: fs_api.h:1169
An opaque structure a pointer to which is returned to the caller to be used to control the scanner...
char * serialization
Filename used for serializing information about this operation (should be determined using &#39;mktemp&#39;)...
Definition: fs_api.h:1200
GNUNET_FS_UriType
Types of URIs.
Definition: fs_api.h:136
Private ECC key encoded for transmission.
Information for a file or directory that is about to be published.
Definition: fs_api.h:219
struct GNUNET_FS_DownloadContext * probe_ctx
ID of a job that is currently probing this results&#39; availability (NULL if we are not currently probin...
Definition: fs_api.h:525
struct GNUNET_FS_Handle * h
Handle to the master context.
Definition: fs_api.h:234
We&#39;ve calculated the CHK bottom-up based on what we have on disk, which may not be what the desired C...
Definition: fs_api.h:1617
static struct GNUNET_PEERINFO_Handle * pi
Handle to peerinfo service.
unsigned int num_children
Number of entries in children array.
Definition: fs_api.h:1682
struct GNUNET_FS_QueueEntry * running_head
Head of DLL of running jobs.
Definition: fs_api.h:1090
char * temp_filename
Where are we writing the data temporarily (name of the file, can be NULL!); used if we do not have a ...
Definition: fs_api.h:1807
Handle for controlling an unindexing operation.
Definition: fs_api.h:1334
struct GNUNET_DATASTORE_Handle * dsh
Connection to the datastore service, only valid during the UNINDEX_STATE_DS_NOTIFY phase...
Definition: fs_api.h:1386
void * dir_data
Pointer to the data for the directory (or NULL if not available).
Definition: fs_api.h:362
char * identifier
Human-readable identifier chosen for this entry in the namespace.
Definition: fs_api.h:197
unsigned int max_parallel_requests
Maximum number of parallel requests.
Definition: fs_api.h:1158
int index_start_confirmed
Has the service confirmed our INDEX_START request? GNUNET_YES if this step has been completed...
Definition: fs_api.h:340
Internal representation of the hash map.
size_t GNUNET_FS_data_reader_copy_(void *cls, uint64_t offset, size_t max, void *buf, char **emsg)
Function that provides data by copying from a buffer.
Definition: fs_api.c:560
void * client_info
Context kept for the client.
Definition: fs_api.h:1773
struct GNUNET_CRYPTO_FileHashContext * fhc
Context for hashing of the file.
Definition: fs_api.h:1427
struct SearchRequestEntry * requests
Per-keyword information for a keyword search.
Definition: fs_api.h:1546
struct GNUNET_MQ_Handle * mq
Message queue handle, or NULL if job is not running.
Definition: fs_api.h:441
static struct GNUNET_ARM_Handle * h
Connection with ARM.
Definition: gnunet-arm.c:94
Find out which keywords apply.
Definition: fs_api.h:1306
void(* GNUNET_SCHEDULER_TaskCallback)(void *cls)
Signature of the main function of a task.
struct GNUNET_FS_Uri * uri
List of keywords that we&#39;re looking for.
Definition: fs_api.h:1506
We&#39;re notifying the FS service about the unindexing.
Definition: fs_api.h:1317
void * GNUNET_FS_publish_make_status_(struct GNUNET_FS_ProgressInfo *pi, struct GNUNET_FS_PublishContext *pc, const struct GNUNET_FS_FileInformation *p, uint64_t offset)
Fill in all of the generic fields for a publish event and call the callback.
Definition: fs_publish.c:47
Initial state, block has only been allocated (since it is relevant to the overall download request)...
Definition: fs_api.h:1593
uint64_t old_file_size
What was the size of the file on disk that we&#39;re downloading before we started? Used to detect if the...
Definition: fs_api.h:1876
struct GNUNET_FS_SearchContext * update_search
If this search result triggered an update search, this field links to the update search.
Definition: fs_api.h:537
struct TopLevelActivity * top_tail
Tail of DLL of top-level activities.
Definition: fs_api.h:1085
uint32_t anonymity
Anonymity level for the search.
Definition: fs_api.h:1569
uint64_t length
How many bytes starting from offset are desired? This is NOT the overall length of the file! ...
Definition: fs_api.h:1862
void GNUNET_FS_search_signal_suspend_(void *cls)
Create SUSPEND event for the given search operation and then clean up our state (without stop signal)...
Definition: fs_search.c:1559
Meta data to associate with a file, directory or namespace.
struct GNUNET_FS_TreeEncoder * te
Encoder being used to publish this file.
Definition: fs_api.h:283
char ** keywords
Keywords start with a &#39;+&#39; if they are mandatory (in which case the &#39;+&#39; is NOT part of the keyword) an...
Definition: fs_api.h:179
void GNUNET_FS_search_start_probe_(struct GNUNET_FS_SearchResult *sr)
Start download probes for the given search result.
Definition: fs_search.c:435
void GNUNET_FS_end_top(struct GNUNET_FS_Handle *h, struct TopLevelActivity *top)
Destroy a top-level activity entry.
Definition: fs_api.c:412
struct TopLevelActivity * top
Our top-level activity entry.
Definition: fs_api.h:1349
struct GNUNET_FS_DownloadContext * next
Next download belonging to the same parent.
Definition: fs_api.h:1768
char * serialization
Name of the file on disk we use for persistence.
Definition: fs_api.h:1527
Entry in our priority queue.
Definition: datastore_api.c:96
int active
GNUNET_YES if the job is active now.
Definition: fs_api.h:477
void GNUNET_FS_download_signal_suspend_(void *cls)
Create SUSPEND event for the given download operation and then clean up our state (without stop signa...
Definition: fs_download.c:1968
enum State state
current state of profiling
struct GNUNET_DISK_FileHandle * fh
Handle used to read the file.
Definition: fs_api.h:1401
static struct GNUNET_OS_Process * p
Helper process we started.
Definition: gnunet-qr.c:59
char * serialization
Random portion of filename we use for syncing state of this download.
Definition: fs_api.h:1794
uint32_t availability_trials
Number of availability trials that we have performed for this search result.
Definition: fs_api.h:598
unsigned int chk_idx
Offset of the CHK for this block in the parent block.
Definition: fs_api.h:1692
int GNUNET_FS_search_start_searching_(struct GNUNET_FS_SearchContext *sc)
Build the request and actually initiate the search using the GNUnet FS service.
Definition: fs_search.c:1400
enum GNUNET_FS_QueuePriority priority
How important is this download?
Definition: fs_api.h:467
void GNUNET_FS_unindex_do_remove_kblocks_(struct GNUNET_FS_UnindexContext *uc)
If necessary, connect to the datastore and remove the KBlocks.
Definition: fs_unindex.c:578
struct GNUNET_CONTAINER_MultiHashMap * master_result_map
Map that contains a struct GNUNET_FS_SearchResult for each result that was found in the search...
Definition: fs_api.h:1540
Information we store for each search result.
Definition: fs_api.h:484
struct GNUNET_FS_Handle * h
File-sharing context this result belongs to.
Definition: fs_api.h:488
void *(* GNUNET_FS_ProgressCallback)(void *cls, const struct GNUNET_FS_ProgressInfo *info)
Notification of FS to a client about the progress of an operation.
void GNUNET_FS_publish_sync_(struct GNUNET_FS_PublishContext *pc)
Synchronize this publishing struct with its mirror on disk.
Definition: fs_api.c:1705
char * nuid
ID for future updates, NULL if we have no namespace or no updates.
Definition: fs_api.h:1194
int is_directory
Is this struct for a file or directory?
Definition: fs_api.h:379
uint32_t availability_success
Number of availability tests that have succeeded for this result.
Definition: fs_api.h:592
We&#39;re telling the datastore to remove KBlocks.
Definition: fs_api.h:1311
UnindexState
Phases of unindex processing (state machine).
Definition: fs_api.h:1291
We&#39;ve checked the block on the path down the tree, and the content on disk did match the desired CHK...
Definition: fs_api.h:1601
void GNUNET_FS_dequeue_(struct GNUNET_FS_QueueEntry *qe)
Dequeue a job from the queue.
Definition: fs_api.c:366
static char buf[2048]
static char * filename
void GNUNET_FS_publish_main_(void *cls)
Main function that performs the upload.
Definition: fs_publish.c:1050
complete information needed to download a file.
Definition: fs_api.h:93
char * client_name
Name of our client.
Definition: fs_api.h:1065
struct GNUNET_CONTAINER_MultiHashMap * results
Map that contains a "struct GNUNET_FS_SearchResult" for each result that was found under this keyword...
Definition: fs_api.h:1479
int issue_requests
Are we ready to issue requests (reconstructions are finished)?
Definition: fs_api.h:1913
struct TopLevelActivity * top_head
Head of DLL of top-level activities.
Definition: fs_api.h:1080
struct GNUNET_FS_FileInformation * fi_pos
Current position in the file-tree for the upload.
Definition: fs_api.h:1211
GNUNET_FS_PublishOptions
Options for publishing.
struct GNUNET_CONTAINER_MultiHashMap * active
Map of active requests (those waiting for a response).
Definition: fs_api.h:1829
Context for the KSK publication.
void GNUNET_FS_search_result_sync_(struct GNUNET_FS_SearchResult *sr)
Synchronize this search result with its mirror on disk.
Definition: fs_api.c:2075
We&#39;ve encountered a fatal error.
Definition: fs_api.h:1327
struct GNUNET_FS_Uri * chk_uri
CHK for this file or directory.
Definition: fs_api.h:255
struct GNUNET_FS_TreeEncoder * te
Tree encoder used for the reconstruction.
Definition: fs_api.h:1817
struct GNUNET_FS_QueueEntry * GNUNET_FS_queue_(struct GNUNET_FS_Handle *h, GNUNET_SCHEDULER_TaskCallback start, GNUNET_SCHEDULER_TaskCallback stop, void *cls, unsigned int blocks, enum GNUNET_FS_QueuePriority priority)
Add a job to the queue.
Definition: fs_api.c:331
struct GNUNET_FS_SearchResult * prev
Kept in a DLL while probing.
Definition: fs_api.h:498
We&#39;ve calculated the CHK bottom-up based on the meta data.
Definition: fs_api.h:1609
uint64_t offset
What is the first offset that we&#39;re interested in?
Definition: fs_api.h:1856
struct TopLevelActivity * top
Our top-level activity entry (if we are top-level, otherwise NULL).
Definition: fs_api.h:1731
struct GNUNET_FS_PublishKskContext * ksk_pc
Context for KSK publishing operation that is part of this publishing operation (NULL if not active)...
Definition: fs_api.h:1238
uint32_t anonymity
Anonymity level to use for probes using this search result.
Definition: fs_api.h:574
Handle for controlling a publication process.
Definition: fs_api.h:1165
void GNUNET_FS_download_start_task_(void *cls)
Task that creates the initial (top-level) download request for the file.
Definition: fs_download.c:1809
void * GNUNET_FS_search_make_status_(struct GNUNET_FS_ProgressInfo *pi, struct GNUNET_FS_Handle *h, struct GNUNET_FS_SearchContext *sc)
Fill in all of the generic fields for a search event and call the callback.
Definition: fs_search.c:48
struct GNUNET_FS_Uri * ksk_uri
Keywords found (telling us which KBlocks to remove).
Definition: fs_api.h:1359
A 512-bit hashcode.
char * filename
Name of the file that we are unindexing.
Definition: fs_api.h:1369
We&#39;ve successfully downloaded this block, but the children still need to be either downloaded or veri...
Definition: fs_api.h:1635
GNUNET_SCHEDULER_TaskCallback start
Function to call when the job is started.
Definition: fs_api.h:421
struct GNUNET_SCHEDULER_Task * task
ID of a task that is using this struct and that must be cancelled when the download is being stopped ...
Definition: fs_api.h:1850
struct TopLevelActivity * GNUNET_FS_make_top(struct GNUNET_FS_Handle *h, SuspendSignalFunction ssf, void *ssf_cls)
Create a top-level activity entry.
Definition: fs_api.c:391
unsigned int keywordCount
Size of the keywords array.
Definition: fs_api.h:184
struct GNUNET_DISK_FileHandle * rfh
File handle for reading data from an existing file (to pass to tree encoder).
Definition: fs_api.h:1823
struct GNUNET_DATASTORE_QueueEntry * dqe
Handle to datastore &#39;get_key&#39; operation issued for obtaining KBlocks.
Definition: fs_api.h:1407
This block and all of its children have been downloaded successfully (full completion propagates up)...
Definition: fs_api.h:1641
static struct GNUNET_TIME_Absolute start_time
Start time of the current round; used to determine how long one iteration takes (which influences how...
struct GNUNET_FS_QueueEntry * running_tail
Tail of DLL of running jobs.
Definition: fs_api.h:1095
uint64_t contents_size
Sum of all of the sizes of all of the files in the directory.
Definition: fs_api.h:372
void * ssf_cls
Closure for &#39;ssf&#39; (some struct GNUNET_FS_XXXHandle*)
Definition: fs_api.h:1023
struct GNUNET_FS_Handle * h
Handle to FS primary context.
Definition: fs_api.h:436
unsigned int active_downloads
How many actual downloads do we have running right now?
Definition: fs_api.h:1138
Content-hash-key (simple file).
Definition: fs_api.h:140
int have_hash
Is "file_id" already valid? Set to GNUNET_YES once the hash has been calculated.
Definition: fs_api.h:334
uint32_t reserve_entries
Overall number of entries to reserve for the publish operation.
Definition: fs_api.h:1255
struct GNUNET_FS_SearchResult * search
Associated search (used when downloading files based on search results), or NULL for none...
Definition: fs_api.h:1748
struct GNUNET_MQ_Handle * mq
Connection to the FS service, only valid during the UNINDEX_STATE_FS_NOTIFY phase.
Definition: fs_api.h:1380
struct GNUNET_TESTBED_Peer * peer
The peer associated with this model.
struct GNUNET_HashCode key
The key used in the DHT.
struct GNUNET_DATASTORE_QueueEntry * qre
Queue entry for reservation/unreservation.
Definition: fs_api.h:1226
char * emsg
Error message, NULL if we&#39;re doing OK.
Definition: fs_api.h:1788
GNUNET_FS_DownloadOptions
Options for downloading.
int has_finished
Flag set upon transitive completion (includes child downloads).
Definition: fs_api.h:1908
int all_done
Set to GNUNET_YES if all processing has completed.
Definition: fs_api.h:1277
Settings for publishing a block (which may of course also apply to an entire directory or file)...
static struct GNUNET_FS_SearchContext * sc
Definition: gnunet-search.c:37
struct GNUNET_FS_PublishSksContext * sks_pc
Context for SKS publishing operation that is part of this publishing operation (NULL if not active)...
Definition: fs_api.h:1232
struct GNUNET_CONTAINER_MetaData * meta
Metadata for the search result.
Definition: fs_api.h:514
static struct GNUNET_NAMESTORE_Handle * ns
Handle to the namestore.
struct GNUNET_FS_FileInformation * next
Files in a directory are kept as a linked list.
Definition: fs_api.h:223
Context used when hashing a file.
struct GNUNET_MQ_Handle * mq
Our own message queue for the FS service; only briefly used when we start to index a file...
Definition: fs_api.h:1206
void GNUNET_FS_unindex_make_status_(struct GNUNET_FS_ProgressInfo *pi, struct GNUNET_FS_UnindexContext *uc, uint64_t offset)
Fill in all of the generic fields for an unindex event and call the callback.
Definition: fs_unindex.c:84
void GNUNET_FS_unindex_signal_suspend_(void *cls)
Create SUSPEND event for the given unindex operation and then clean up our state (without stop signal...
Definition: fs_unindex.c:725
an ECC signature using EdDSA.
We got a block back that matched the query but did not hash to the key (malicious publisher or hash c...
Definition: fs_api.h:1648
BlockRequestState
FSM for possible states a block can go through.
Definition: fs_api.h:1588
Handle to a message queue.
Definition: mq.c:84
int do_index
Should the file be indexed or inserted?
Definition: fs_api.h:328
Signed key space (file in namespace).
Definition: fs_api.h:145
struct TopLevelActivity * top
Our top-level activity entry (if we are top-level, otherwise NULL).
Definition: fs_api.h:1174
size_t(* GNUNET_FS_DataReader)(void *cls, uint64_t offset, size_t max, void *buf, char **emsg)
Function that provides data.
struct GNUNET_FS_DownloadContext * child_tail
Tail of list of child downloads.
Definition: fs_api.h:1758
static struct GNUNET_FS_PublishContext * pc
Handle to FS-publishing operation.
The identity of the host (wraps the signing key of the peer).
uint32_t mandatory_missing
Number of mandatory keywords for which we have NOT yet found the search result; when this value hits ...
Definition: fs_api.h:581
struct GNUNET_FS_FileInformation * fi
File-structure that is being shared.
Definition: fs_api.h:1179
GNUNET_FS_ProgressCallback upcb
Function to call with updates on our progress.
Definition: fs_api.h:1070
unsigned int blocks
How many blocks do the active downloads have?
Definition: fs_api.h:462
struct GNUNET_FS_SearchResult * next
Kept in a DLL while probing.
Definition: fs_api.h:493
void(* SuspendSignalFunction)(void *cls)
Function signature of the functions that can be called to trigger suspend signals and clean-up for to...
Definition: fs_api.h:998
We&#39;re currently hashing the file.
Definition: fs_api.h:1295
void GNUNET_FS_publish_signal_suspend_(void *cls)
Create SUSPEND event for the given publish operation and then clean up our state (without stop signal...
Definition: fs_publish.c:1340
struct GNUNET_FS_QueueEntry * next
This is a linked list.
Definition: fs_api.h:411
configuration data
Definition: configuration.c:83
We&#39;re telling the datastore to delete the respective DBlocks and IBlocks.
Definition: fs_api.h:1301
struct GNUNET_CRYPTO_EcdsaPrivateKey * ns
Namespace that we are publishing in, NULL if we have no namespace.
Definition: fs_api.h:1184
A Universal Resource Identifier (URI), opaque.
Definition: fs_api.h:162
Handle to the datastore service.
struct GNUNET_FS_DownloadContext * prev
Previous download belonging to the same parent.
Definition: fs_api.h:1763
Handle for controlling a search.
Definition: fs_api.h:1492
uint64_t file_length
Total size of the file in bytes.
Definition: fs_api.h:97
struct GNUNET_SCHEDULER_Task * probe_ping_task
Task we use to report periodically to the application that certain search probes (from probes_head) a...
Definition: fs_api.h:1127
Public ECC key (always for Curve25519) encoded in a format suitable for network transmission and ECDS...
struct GNUNET_FS_DirScanner * dscan
Directory scanner to find keywords (KBlock removal).
Definition: fs_api.h:1354
void GNUNET_FS_unindex_do_extract_keywords_(struct GNUNET_FS_UnindexContext *uc)
Extract the keywords for KBlock removal.
Definition: fs_unindex.c:406
void * upcb_cls
Closure for upcb.
Definition: fs_api.h:1075
struct GNUNET_FS_Uri * keywords
Keywords to use for KBlocks.
Definition: fs_api.h:249
Entry in list of pending tasks.
Definition: scheduler.c:131
struct GNUNET_MQ_Handle * mq
Connection to the FS service.
Definition: fs_api.h:1517
uint32_t anonymity
Desired level of anonymity.
Definition: fs_api.h:1891
struct GNUNET_FS_Handle * h
Handle to the global FS context.
Definition: fs_api.h:1496
GNUNET_SCHEDULER_TaskCallback stop
Function to call when the job needs to stop (or is done / dequeued).
Definition: fs_api.h:426
unsigned int treedepth
The depth of the file-tree.
Definition: fs_api.h:1896
struct GNUNET_FS_SearchResult * probes_head
Head of active probes.
Definition: fs_api.h:1110
struct GNUNET_FS_QueueEntry * prev
This is a linked list.
Definition: fs_api.h:416
struct GNUNET_MQ_Handle * mq
Connection to the FS service.
Definition: fs_api.h:1736
struct GNUNET_CONTAINER_MetaData * meta
Known meta-data for the file (can be NULL).
Definition: fs_api.h:1783
void GNUNET_FS_remove_sync_file_(struct GNUNET_FS_Handle *h, const char *ext, const char *ent)
Remove serialization/deserialization file from disk.
Definition: fs_api.c:743
Location (chk with identity of hosting peer).
Definition: fs_api.h:155
struct GNUNET_FS_QueueEntry * pending_tail
Tail of DLL of pending jobs.
Definition: fs_api.h:1105
uint64_t contents_completed
How much of the directory have we published (relative to contents_size).
Definition: fs_api.h:367
enum GNUNET_TESTBED_UnderlayLinkModelType type
the type of this model
char * emsg
Error message, NULL on success.
Definition: fs_api.h:1422
Time for absolute times used by GNUnet, in microseconds.
void * cls
Closure for start and stop.
Definition: fs_api.h:431
void * GNUNET_FS_make_file_reader_context_(const char *filename)
Create the closure for the GNUNET_FS_data_reader_file_() callback.
Definition: fs_api.c:524
size_t GNUNET_FS_data_reader_file_(void *cls, uint64_t offset, size_t max, void *buf, char **emsg)
Function that provides data by reading from a file.
Definition: fs_api.c:456
char * serialization
Name under which this search result is stored on disk.
Definition: fs_api.h:542
uint64_t completed
How many bytes have we already received within the specified range (DBlocks only).
Definition: fs_api.h:1868
struct GNUNET_FS_Uri * uri
URI that identifies the file that we are downloading.
Definition: fs_api.h:1778
int is_published
Are we done publishing this file?
Definition: fs_api.h:384
void * client_info
Pointer kept for the client.
Definition: fs_api.h:1391
We track all of the top-level activities of FS so that we can signal &#39;suspend&#39; on shutdown...
Definition: fs_api.h:1004
struct TopLevelActivity * next
This is a doubly-linked list.
Definition: fs_api.h:1008
Information we keep for each keyword in a keyword search.
Definition: fs_api.h:1454
void GNUNET_FS_unindex_sync_(struct GNUNET_FS_UnindexContext *uc)
Synchronize this unindex struct with its mirror on disk.
Definition: fs_api.c:1777
struct GNUNET_FS_SearchResult * probes_tail
Tail of active probes.
Definition: fs_api.h:1115
void GNUNET_FS_free_download_request_(struct DownloadRequest *dr)
(recursively) free download request structure
Definition: fs_download.c:996
struct GNUNET_FS_Handle * h
Global FS context.
Definition: fs_api.h:1344
uint32_t data
The data value.
unsigned int max_parallel_downloads
Maximum number of parallel downloads.
Definition: fs_api.h:1153
void GNUNET_FS_search_sync_(struct GNUNET_FS_SearchContext *sc)
Synchronize this search struct with its mirror on disk.
Definition: fs_api.c:2166
void GNUNET_FS_unindex_process_hash_(void *cls, const struct GNUNET_HashCode *file_id)
Function called once the hash of the file that is being unindexed has been computed.
Definition: fs_unindex.c:692
struct DownloadRequest * parent
Parent in the CHK-tree.
Definition: fs_api.h:1659
int any_done
Set to GNUNET_YES if we were able to publish any block.
Definition: fs_api.h:1272
Entry in the job queue.
Definition: fs_api.h:407
void * client_info
Pointer we keep for the client.
Definition: fs_api.h:1522
uint64_t file_size
Size of the file (in bytes).
Definition: fs_api.h:323
int skip_next_fi_callback
Flag set to GNUNET_YES if the next callback from GNUNET_FS_file_information_inspect should be skipped...
Definition: fs_api.h:1284
Information about an active download request.
Definition: fs_api.h:1655
Handle used to access files (and pipes).
char * keyword
The original keyword, used to derive the key (for decrypting the UBlock).
Definition: fs_api.h:1469
size_t dir_size
Size of the directory itself (in bytes); 0 if the size has not yet been calculated.
Definition: fs_api.h:356
struct GNUNET_FS_Uri * sks_uri
SKS URI for this file or directory.
Definition: fs_api.h:261
unsigned int depth
Depth of the corresponding block in the tree.
Definition: fs_api.h:1687
We&#39;ve determined the real, desired CHK for this block (full tree reconstruction failed), request is now pending.
Definition: fs_api.h:1626
void GNUNET_FS_download_start_downloading_(struct GNUNET_FS_DownloadContext *dc)
Start the downloading process (by entering the queue).
Definition: fs_download.c:2263
GNUNET_FS_QueuePriority
Priorities for the queue.
Definition: fs_api.h:391
static struct GNUNET_FS_DownloadContext * dc
SuspendSignalFunction ssf
Function to call for suspend-signalling and clean up.
Definition: fs_api.h:1018
Default priority.
Definition: fs_api.h:400
static struct GNUNET_FS_BlockOptions bo
Options we set for published blocks.
unsigned int start_times
How often have we (re)started this download?
Definition: fs_api.h:472
void GNUNET_FS_stop_probe_ping_task_(struct GNUNET_FS_SearchResult *sr)
Stop the ping task for this search result.
Definition: fs_search.c:414
Argument given to the progress callback with information about what is going on.
Time for relative time used by GNUnet, in microseconds.
struct GNUNET_FS_QueueEntry * job_queue
Our entry in the job queue.
Definition: fs_api.h:1812
struct GNUNET_SCHEDULER_Task * probe_cancel_task
ID of the task that will clean up the probe_ctx should it not complete on time (and that will need to...
Definition: fs_api.h:559
uint64_t file_size
Overall size of the file.
Definition: fs_api.h:1432
Information about a file and its location (peer claiming to share the file).
Definition: fs_api.h:110
const struct GNUNET_CONFIGURATION_Handle * cfg
Configuration to use.
Definition: fs_api.h:1060