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 
94 {
95 
99  uint64_t file_length;
100 
105 
106 };
107 
108 
113 struct Location
114 {
118  struct FileIdentifier fi;
119 
124 
128  struct GNUNET_TIME_Absolute expirationTime;
129 
134  struct GNUNET_CRYPTO_EddsaSignature contentSignature;
135 
136 };
137 
142 {
147 
152 
157 
162 };
163 
164 
169 {
174 
175  union
176  {
177  struct
178  {
188  char **keywords;
189 
193  unsigned int keywordCount;
194  } ksk;
195 
196  struct
197  {
202 
207  char *identifier;
208 
209  } sks;
210 
215  struct FileIdentifier chk;
216 
221  struct Location loc;
222  } data;
223 
224 };
225 
226 
232 {
233 
238 
244 
249 
253  void *client_info;
254 
259 
264 
270 
276 
281 
286 
293 
298 
302  char *emsg;
303 
307  char *filename;
308 
312  union
313  {
314 
318  struct
319  {
320 
325 
329  void *reader_cls;
330 
336  struct GNUNET_HashCode file_id;
337 
341  uint64_t file_size;
342 
346  int do_index;
347 
353 
359 
360  } file;
361 
365  struct
366  {
367 
372 
377  size_t dir_size;
378 
383  void *dir_data;
384 
389 
393  uint64_t contents_size;
394 
395  } dir;
396 
397  } data;
398 
403 
408 
409 };
410 
411 
416 {
421 
426 };
427 
428 
433 {
438 
443 
448 
453 
457  void *cls;
458 
463 
468 
472  struct GNUNET_TIME_Absolute queue_time;
473 
478 
483  struct GNUNET_TIME_Relative run_time;
484 
488  unsigned int blocks;
489 
493  enum GNUNET_FS_QueuePriority priority;
494 
498  unsigned int start_times;
499 
503  int active;
504 
505 };
506 
507 
512 {
513 
518 
523 
528 
534 
539 
544 
548  void *client_info;
549 
555 
561 
567 
572 
576  uint8_t *keyword_bitmap;
577 
582 
589 
593  struct GNUNET_TIME_Absolute probe_active_time;
594 
598  struct GNUNET_TIME_Relative remaining_probe_time;
599 
603  uint32_t anonymity;
604 
611 
617 
622 
628 
629 };
630 
631 
643 struct GNUNET_FS_QueueEntry *
647  void *cls,
648  unsigned int blocks,
650 
651 
657 void
659 
660 
677 size_t
679  uint64_t offset,
680  size_t max,
681  void *buf,
682  char **emsg);
683 
684 
691 void *
693 
694 
695 
712 size_t
714  uint64_t offset,
715  size_t max,
716  void *buf,
717  char **emsg);
718 
719 
735 void *
737  const struct GNUNET_FS_ProgressInfo *info);
738 
739 
745 void
747 
748 
756 void
758  const struct GNUNET_HashCode *file_id);
759 
760 
766 void
768 
769 
775 void
777 
778 
789 void *
792  const struct GNUNET_FS_FileInformation *p,
793  uint64_t offset);
794 
795 
803 void
805  struct GNUNET_FS_DownloadContext *dc);
806 
807 
814 void
816 
817 
818 
827 void
830  uint64_t offset);
831 
841 void *
843  struct GNUNET_FS_Handle *h,
844  struct GNUNET_FS_SearchContext *sc);
845 
846 
852 void
854 
862 int
864 
870 void
872 
873 
879 void
881 
882 
890 void
892  const char *ext,
893  const char *ent);
894 
895 
903 void
905  const char *ext,
906  const char *uni);
907 
908 
917 void
919 
920 
929 void
931 
932 
941 void
943 
944 
953 void
955 
956 
965 void
967 
968 
977 void
979 
980 
987 void
989 
990 
997 void
999 
1000 
1007 void
1009 
1010 
1017 void
1019 
1020 
1028 typedef void (*SuspendSignalFunction) (void *cls);
1029 
1035 {
1040 
1045 
1050 
1054  void *ssf_cls;
1055 };
1056 
1057 
1066 struct TopLevelActivity *
1069  void *ssf_cls);
1070 
1071 
1078 void
1080  struct TopLevelActivity *top);
1081 
1082 
1083 
1088 {
1093 
1098 
1103 
1107  void *upcb_cls;
1108 
1113 
1118 
1123 
1128 
1133 
1138 
1143 
1148 
1154 
1160 
1165  struct GNUNET_TIME_Relative avg_block_latency;
1166 
1170  unsigned int active_downloads;
1171 
1175  unsigned int active_blocks;
1176 
1180  enum GNUNET_FS_Flags flags;
1181 
1186 
1191 
1192 };
1193 
1194 
1199 {
1204 
1209 
1214 
1219 
1223  char *nid;
1224 
1228  char *nuid;
1229 
1235 
1241 
1246 
1251 
1256 
1261 
1267 
1273 
1279 
1283  uint64_t reserve_space;
1284 
1290 
1295 
1300  int rid;
1301 
1307 
1312 
1319 };
1320 
1321 
1326 {
1331 
1337 
1342 
1347 
1353 
1358 
1363 };
1364 
1365 
1370 {
1371 
1376  struct ContentHashKey chk;
1377 
1382 
1387 
1392 
1397 
1401  uint32_t ksk_offset;
1402 
1406  char *filename;
1407 
1412 
1418 
1424 
1429 
1434 
1439 
1445 
1449  struct GNUNET_HashCode ukey;
1450 
1454  struct GNUNET_HashCode uquery;
1455 
1459  char *emsg;
1460 
1465 
1469  uint64_t file_size;
1470 
1475 
1479  struct GNUNET_HashCode file_id;
1480 
1485 
1486 };
1487 
1488 
1493 {
1494 
1498  struct GNUNET_HashCode uquery;
1499 
1504 
1509  char *keyword;
1510 
1520 
1526 
1527 };
1528 
1529 
1534 {
1539 
1544 
1549 
1555 
1560 
1565 
1570 
1574  char *emsg;
1575 
1583 
1589 
1594 
1598  struct GNUNET_TIME_Relative reconnect_backoff;
1599 
1607 
1611  uint32_t anonymity;
1612 
1617 
1622 };
1623 
1624 
1631 {
1637 
1645 
1653 
1661 
1670 
1679 
1685 
1692 };
1693 
1694 
1699 {
1700 
1705 
1710 
1715  struct ContentHashKey chk;
1716 
1722  uint64_t offset;
1723 
1727  unsigned int num_children;
1728 
1732  unsigned int depth;
1733 
1737  unsigned int chk_idx;
1738 
1743 
1744 };
1745 
1746 
1752 void
1754 
1755 
1761 void
1763 
1764 
1769 {
1770 
1775 
1780 
1785 
1791 
1797 
1802 
1807 
1812 
1817 
1822 
1827 
1832 
1836  char *emsg;
1837 
1843 
1848  char *filename;
1849 
1856 
1861 
1866 
1872 
1878 
1883 
1888  struct GNUNET_PeerIdentity target;
1889 
1899 
1904  uint64_t offset;
1905 
1910  uint64_t length;
1911 
1916  uint64_t completed;
1917 
1924  uint64_t old_file_size;
1925 
1930 
1934  struct GNUNET_TIME_Relative reconnect_backoff;
1935 
1939  uint32_t anonymity;
1940 
1944  unsigned int treedepth;
1945 
1950 
1957 
1962 
1963 };
1964 
1965 
1966 #endif
1967 
1968 /* end of fs_api.h */
void * client_info
Client info for this search result.
Definition: fs_api.h:548
uint32_t optional_support
Number of optional keywords under which this result was also found.
Definition: fs_api.h:616
struct GNUNET_FS_FileInformation * entries
Linked list of entries in the directory.
Definition: fs_api.h:371
This is a probe (low priority).
Definition: fs_api.h:420
void * reader_cls
Closure for reader.
Definition: fs_api.h:329
char * nid
ID of the content in the namespace, NULL if we have no namespace.
Definition: fs_api.h:1223
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:1411
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:279
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:797
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:1278
struct ContentHashKey chk
Query and key of the top GNUNET_EC_IBlock.
Definition: fs_api.h:104
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:1606
struct GNUNET_FS_FileInformation * dir
If this is a file in a directory, "dir" refers to the directory; otherwise NULL.
Definition: fs_api.h:243
Context for controlling a download.
Definition: fs_api.h:1768
uint32_t mandatory_count
Number of mandatory keywords in this query.
Definition: fs_api.h:1616
struct GNUNET_FS_DownloadContext * download
ID of an associated download based on this search result (or NULL for none).
Definition: fs_api.h:560
int rid
Space reservation ID with datastore service for this upload.
Definition: fs_api.h:1300
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:258
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:1554
struct TopLevelActivity * prev
This is a doubly-linked list.
Definition: fs_api.h:1044
void GNUNET_FS_download_sync_(struct GNUNET_FS_DownloadContext *dc)
Synchronize this download struct with its mirror on disk.
Definition: fs_api.c:1944
struct GNUNET_FS_Handle * h
Global FS context.
Definition: fs_api.h:1774
struct GNUNET_GETOPT_CommandLineOption options[]
Definition: 002.c:5
Context for the SKS publication.
Definition: fs_namespace.c:336
content hash key
Definition: fs.h:53
void * client_info
Pointer kept for the client.
Definition: fs_api.h:253
struct DownloadRequest ** children
Array (!) of child-requests, or NULL for the bottom of the tree.
Definition: fs_api.h:1709
struct GNUNET_FS_TreeEncoder * tc
Merkle-ish tree encoder context.
Definition: fs_api.h:1433
uint32_t ksk_offset
Current offset in KSK removal.
Definition: fs_api.h:1401
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:1296
char * emsg
Error message (non-NULL if this operation failed).
Definition: fs_api.h:302
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:1153
char * serialization
Under what filename is this struct serialized (for operational persistence).
Definition: fs_api.h:292
struct GNUNET_FS_DownloadContext * child_head
Head of list of child downloads.
Definition: fs_api.h:1801
Master context for most FS operations.
Definition: fs_api.h:1087
We&#39;re done.
Definition: fs_api.h:1357
GNUNET_FS_DataReader reader
Function that can be used to read the data for the file.
Definition: fs_api.h:324
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:1543
char * emsg
Error message (non-NULL if this operation failed).
Definition: fs_api.h:1574
void GNUNET_FS_unindex_do_remove_(struct GNUNET_FS_UnindexContext *uc)
Connect to the datastore and remove the blocks.
Definition: fs_unindex.c:645
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:533
uint8_t * keyword_bitmap
Bitmap that specifies precisely which keywords have been matched already.
Definition: fs_api.h:576
int mandatory
Is this keyword a mandatory keyword (started with &#39;+&#39;)?
Definition: fs_api.h:1525
struct GNUNET_FS_QueueEntry * pending_head
Head of DLL of pending jobs.
Definition: fs_api.h:1132
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:106
struct DownloadRequest * top_request
Top-level download request.
Definition: fs_api.h:1882
struct GNUNET_FS_DownloadContext * parent
Parent download (used when downloading files in directories).
Definition: fs_api.h:1790
GNUNET_FS_SearchOptions
Options for searching.
struct GNUNET_ATS_TEST_Topology * top
Definition: ats-testing.c:53
static struct GNUNET_FS_UnindexContext * uc
definitions for the entire fs module
uint64_t offset
Offset of the corresponding block.
Definition: fs_api.h:1722
Keyword search key (query with keywords).
Definition: fs_api.h:156
uint64_t reserve_space
Storage space to reserve for the operation.
Definition: fs_api.h:1283
char * filename
Name of the file or directory (must be an absolute path).
Definition: fs_api.h:307
struct GNUNET_FS_Uri * uri
URI to which this search result refers to.
Definition: fs_api.h:538
unsigned int active_blocks
How many blocks do the active downloads have?
Definition: fs_api.h:1175
char * filename
Where are we writing the data (name of the file, can be NULL!).
Definition: fs_api.h:1848
struct GNUNET_CRYPTO_FileHashContext * fhc
Non-null if we are currently hashing a file.
Definition: fs_api.h:1250
struct GNUNET_DATASTORE_Handle * dsh
Connection to the datastore service.
Definition: fs_api.h:1255
struct GNUNET_FS_Handle * h
Handle to the global fs context.
Definition: fs_api.h:1203
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:1234
GNUNET_FS_UriType
Types of URIs.
Definition: fs_api.h:141
Private ECC key encoded for transmission.
Information for a file or directory that is about to be published.
Definition: fs_api.h:231
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:554
struct GNUNET_FS_Handle * h
Handle to the master context.
Definition: fs_api.h:248
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:1660
static struct GNUNET_PEERINFO_Handle * pi
Handle to peerinfo service.
unsigned int num_children
Number of entries in children array.
Definition: fs_api.h:1727
struct GNUNET_FS_QueueEntry * running_head
Head of DLL of running jobs.
Definition: fs_api.h:1122
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:1855
Handle for controlling an unindexing operation.
Definition: fs_api.h:1369
struct GNUNET_DATASTORE_Handle * dsh
Connection to the datastore service, only valid during the UNINDEX_STATE_DS_NOTIFY phase...
Definition: fs_api.h:1423
void * dir_data
Pointer to the data for the directory (or NULL if not available).
Definition: fs_api.h:383
char * identifier
Human-readable identifier chosen for this entry in the namespace.
Definition: fs_api.h:207
unsigned int max_parallel_requests
Maximum number of parallel requests.
Definition: fs_api.h:1190
int index_start_confirmed
Has the service confirmed our INDEX_START request? GNUNET_YES if this step has been completed...
Definition: fs_api.h:358
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:569
void * client_info
Context kept for the client.
Definition: fs_api.h:1821
struct GNUNET_CRYPTO_FileHashContext * fhc
Context for hashing of the file.
Definition: fs_api.h:1464
struct SearchRequestEntry * requests
Per-keyword information for a keyword search.
Definition: fs_api.h:1588
struct GNUNET_MQ_Handle * mq
Message queue handle, or NULL if job is not running.
Definition: fs_api.h:467
static struct GNUNET_ARM_Handle * h
Connection with ARM.
Definition: gnunet-arm.c:94
Find out which keywords apply.
Definition: fs_api.h:1341
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:1548
We&#39;re notifying the FS service about the unindexing.
Definition: fs_api.h:1352
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:1636
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:1924
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:566
struct TopLevelActivity * top_tail
Tail of DLL of top-level activities.
Definition: fs_api.h:1117
uint32_t anonymity
Anonymity level for the search.
Definition: fs_api.h:1611
uint64_t length
How many bytes starting from offset are desired? This is NOT the overall length of the file! ...
Definition: fs_api.h:1910
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:1546
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:297
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:188
void GNUNET_FS_search_start_probe_(struct GNUNET_FS_SearchResult *sr)
Start download probes for the given search result.
Definition: fs_search.c:427
void GNUNET_FS_end_top(struct GNUNET_FS_Handle *h, struct TopLevelActivity *top)
Destroy a top-level activity entry.
Definition: fs_api.c:416
struct TopLevelActivity * top
Our top-level activity entry.
Definition: fs_api.h:1386
struct GNUNET_FS_DownloadContext * next
Next download belonging to the same parent.
Definition: fs_api.h:1816
char * serialization
Name of the file on disk we use for persistence.
Definition: fs_api.h:1569
Entry in our priority queue.
int active
GNUNET_YES if the job is active now.
Definition: fs_api.h:503
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:1953
enum State state
current state of profiling
struct GNUNET_DISK_FileHandle * fh
Handle used to read the file.
Definition: fs_api.h:1438
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:1842
uint32_t availability_trials
Number of availability trials that we have performed for this search result.
Definition: fs_api.h:627
unsigned int chk_idx
Offset of the CHK for this block in the parent block.
Definition: fs_api.h:1737
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:1387
enum GNUNET_FS_QueuePriority priority
How important is this download?
Definition: fs_api.h:493
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:576
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:1582
Information we store for each search result.
Definition: fs_api.h:511
struct GNUNET_FS_Handle * h
File-sharing context this result belongs to.
Definition: fs_api.h:517
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:1685
char * nuid
ID for future updates, NULL if we have no namespace or no updates.
Definition: fs_api.h:1228
int is_directory
Is this struct for a file or directory?
Definition: fs_api.h:402
uint32_t availability_success
Number of availability tests that have succeeded for this result.
Definition: fs_api.h:621
We&#39;re telling the datastore to remove KBlocks.
Definition: fs_api.h:1346
UnindexState
Phases of unindex processing (state machine).
Definition: fs_api.h:1325
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:1644
void GNUNET_FS_dequeue_(struct GNUNET_FS_QueueEntry *qe)
Dequeue a job from the queue.
Definition: fs_api.c:363
static char buf[2048]
static char * filename
void GNUNET_FS_publish_main_(void *cls)
Main function that performs the upload.
Definition: fs_publish.c:1053
complete information needed to download a file.
Definition: fs_api.h:93
char * client_name
Name of our client.
Definition: fs_api.h:1097
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:1519
int issue_requests
Are we ready to issue requests (reconstructions are finished)?
Definition: fs_api.h:1961
struct TopLevelActivity * top_head
Head of DLL of top-level activities.
Definition: fs_api.h:1112
struct GNUNET_FS_FileInformation * fi_pos
Current position in the file-tree for the upload.
Definition: fs_api.h:1245
GNUNET_FS_PublishOptions
Options for publishing.
struct GNUNET_CONTAINER_MultiHashMap * active
Map of active requests (those waiting for a response).
Definition: fs_api.h:1877
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:2048
We&#39;ve encountered a fatal error.
Definition: fs_api.h:1362
struct GNUNET_FS_Uri * chk_uri
CHK for this file or directory.
Definition: fs_api.h:269
struct GNUNET_FS_TreeEncoder * te
Tree encoder used for the reconstruction.
Definition: fs_api.h:1865
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:328
struct GNUNET_FS_SearchResult * prev
Kept in a DLL while probing.
Definition: fs_api.h:527
We&#39;ve calculated the CHK bottom-up based on the meta data.
Definition: fs_api.h:1652
uint64_t offset
What is the first offset that we&#39;re interested in?
Definition: fs_api.h:1904
struct TopLevelActivity * top
Our top-level activity entry (if we are top-level, otherwise NULL).
Definition: fs_api.h:1779
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:1272
uint32_t anonymity
Anonymity level to use for probes using this search result.
Definition: fs_api.h:603
Handle for controlling a publication process.
Definition: fs_api.h:1198
void GNUNET_FS_download_start_task_(void *cls)
Task that creates the initial (top-level) download request for the file.
Definition: fs_download.c:1802
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:1396
A 512-bit hashcode.
char * filename
Name of the file that we are unindexing.
Definition: fs_api.h:1406
We&#39;ve successfully downloaded this block, but the children still need to be either downloaded or veri...
Definition: fs_api.h:1678
GNUNET_SCHEDULER_TaskCallback start
Function to call when the job is started.
Definition: fs_api.h:447
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:1898
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:393
unsigned int keywordCount
Size of the keywords array.
Definition: fs_api.h:193
struct GNUNET_DISK_FileHandle * rfh
File handle for reading data from an existing file (to pass to tree encoder).
Definition: fs_api.h:1871
struct GNUNET_DATASTORE_QueueEntry * dqe
Handle to datastore &#39;get_key&#39; operation issued for obtaining KBlocks.
Definition: fs_api.h:1444
This block and all of its children have been downloaded successfully (full completion propagates up)...
Definition: fs_api.h:1684
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:1127
uint64_t contents_size
Sum of all of the sizes of all of the files in the directory.
Definition: fs_api.h:393
void * ssf_cls
Closure for &#39;ssf&#39; (some struct GNUNET_FS_XXXHandle*)
Definition: fs_api.h:1054
struct GNUNET_FS_Handle * h
Handle to FS primary context.
Definition: fs_api.h:462
unsigned int active_downloads
How many actual downloads do we have running right now?
Definition: fs_api.h:1170
Content-hash-key (simple file).
Definition: fs_api.h:146
int have_hash
Is "file_id" already valid? Set to GNUNET_YES once the hash has been calculated.
Definition: fs_api.h:352
uint32_t reserve_entries
Overall number of entries to reserve for the publish operation.
Definition: fs_api.h:1289
struct GNUNET_FS_SearchResult * search
Associated search (used when downloading files based on search results), or NULL for none...
Definition: fs_api.h:1796
struct GNUNET_MQ_Handle * mq
Connection to the FS service, only valid during the UNINDEX_STATE_FS_NOTIFY phase.
Definition: fs_api.h:1417
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:1260
char * emsg
Error message, NULL if we&#39;re doing OK.
Definition: fs_api.h:1836
GNUNET_FS_DownloadOptions
Options for downloading.
int has_finished
Flag set upon transitive completion (includes child downloads).
Definition: fs_api.h:1956
int all_done
Set to GNUNET_YES if all processing has completed.
Definition: fs_api.h:1311
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:1266
struct GNUNET_CONTAINER_MetaData * meta
Metadata for the search result.
Definition: fs_api.h:543
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:237
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:1240
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:723
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:1691
BlockRequestState
FSM for possible states a block can go through.
Definition: fs_api.h:1630
Handle to a message queue.
Definition: mq.c:85
int do_index
Should the file be indexed or inserted?
Definition: fs_api.h:346
Signed key space (file in namespace).
Definition: fs_api.h:151
struct TopLevelActivity * top
Our top-level activity entry (if we are top-level, otherwise NULL).
Definition: fs_api.h:1208
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:1806
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:610
struct GNUNET_FS_FileInformation * fi
File-structure that is being shared.
Definition: fs_api.h:1213
GNUNET_FS_ProgressCallback upcb
Function to call with updates on our progress.
Definition: fs_api.h:1102
unsigned int blocks
How many blocks do the active downloads have?
Definition: fs_api.h:488
struct GNUNET_FS_SearchResult * next
Kept in a DLL while probing.
Definition: fs_api.h:522
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:1028
We&#39;re currently hashing the file.
Definition: fs_api.h:1330
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:1343
struct GNUNET_FS_QueueEntry * next
This is a linked list.
Definition: fs_api.h:437
configuration data
Definition: configuration.c:85
We&#39;re telling the datastore to delete the respective DBlocks and IBlocks.
Definition: fs_api.h:1336
struct GNUNET_CRYPTO_EcdsaPrivateKey * ns
Namespace that we are publishing in, NULL if we have no namespace.
Definition: fs_api.h:1218
A Universal Resource Identifier (URI), opaque.
Definition: fs_api.h:168
Handle to the datastore service.
struct GNUNET_FS_DownloadContext * prev
Previous download belonging to the same parent.
Definition: fs_api.h:1811
Handle for controlling a search.
Definition: fs_api.h:1533
uint64_t file_length
Total size of the file in bytes.
Definition: fs_api.h:99
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:1159
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:1391
void GNUNET_FS_unindex_do_extract_keywords_(struct GNUNET_FS_UnindexContext *uc)
Extract the keywords for KBlock removal.
Definition: fs_unindex.c:404
void * upcb_cls
Closure for upcb.
Definition: fs_api.h:1107
struct GNUNET_FS_Uri * keywords
Keywords to use for KBlocks.
Definition: fs_api.h:263
Entry in list of pending tasks.
Definition: scheduler.c:134
struct GNUNET_MQ_Handle * mq
Connection to the FS service.
Definition: fs_api.h:1559
uint32_t anonymity
Desired level of anonymity.
Definition: fs_api.h:1939
struct GNUNET_FS_Handle * h
Handle to the global FS context.
Definition: fs_api.h:1538
GNUNET_SCHEDULER_TaskCallback stop
Function to call when the job needs to stop (or is done / dequeued).
Definition: fs_api.h:452
unsigned int treedepth
The depth of the file-tree.
Definition: fs_api.h:1944
struct GNUNET_FS_SearchResult * probes_head
Head of active probes.
Definition: fs_api.h:1142
struct GNUNET_FS_QueueEntry * prev
This is a linked list.
Definition: fs_api.h:442
struct GNUNET_MQ_Handle * mq
Connection to the FS service.
Definition: fs_api.h:1784
struct GNUNET_CONTAINER_MetaData * meta
Known meta-data for the file (can be NULL).
Definition: fs_api.h:1831
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:738
Location (chk with identity of hosting peer).
Definition: fs_api.h:161
struct GNUNET_FS_QueueEntry * pending_tail
Tail of DLL of pending jobs.
Definition: fs_api.h:1137
uint64_t contents_completed
How much of the directory have we published (relative to contents_size).
Definition: fs_api.h:388
enum GNUNET_TESTBED_UnderlayLinkModelType type
the type of this model
char * emsg
Error message, NULL on success.
Definition: fs_api.h:1459
Time for absolute times used by GNUnet, in microseconds.
void * cls
Closure for start and stop.
Definition: fs_api.h:457
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:533
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:464
char * serialization
Name under which this search result is stored on disk.
Definition: fs_api.h:571
uint64_t completed
How many bytes have we already received within the specified range (DBlocks only).
Definition: fs_api.h:1916
struct GNUNET_FS_Uri * uri
URI that identifies the file that we are downloading.
Definition: fs_api.h:1826
int is_published
Are we done publishing this file?
Definition: fs_api.h:407
void * client_info
Pointer kept for the client.
Definition: fs_api.h:1428
We track all of the top-level activities of FS so that we can signal &#39;suspend&#39; on shutdown...
Definition: fs_api.h:1034
struct TopLevelActivity * next
This is a doubly-linked list.
Definition: fs_api.h:1039
Information we keep for each keyword in a keyword search.
Definition: fs_api.h:1492
void GNUNET_FS_unindex_sync_(struct GNUNET_FS_UnindexContext *uc)
Synchronize this unindex struct with its mirror on disk.
Definition: fs_api.c:1754
struct GNUNET_FS_SearchResult * probes_tail
Tail of active probes.
Definition: fs_api.h:1147
void GNUNET_FS_free_download_request_(struct DownloadRequest *dr)
(recursively) free download request structure
Definition: fs_download.c:992
struct GNUNET_FS_Handle * h
Global FS context.
Definition: fs_api.h:1381
uint32_t data
The data value.
unsigned int max_parallel_downloads
Maximum number of parallel downloads.
Definition: fs_api.h:1185
void GNUNET_FS_search_sync_(struct GNUNET_FS_SearchContext *sc)
Synchronize this search struct with its mirror on disk.
Definition: fs_api.c:2135
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:690
struct DownloadRequest * parent
Parent in the CHK-tree.
Definition: fs_api.h:1704
int any_done
Set to GNUNET_YES if we were able to publish any block.
Definition: fs_api.h:1306
Entry in the job queue.
Definition: fs_api.h:432
void * client_info
Pointer we keep for the client.
Definition: fs_api.h:1564
uint64_t file_size
Size of the file (in bytes).
Definition: fs_api.h:341
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:1318
Information about an active download request.
Definition: fs_api.h:1698
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:1509
size_t dir_size
Size of the directory itself (in bytes); 0 if the size has not yet been calculated.
Definition: fs_api.h:377
struct GNUNET_FS_Uri * sks_uri
SKS URI for this file or directory.
Definition: fs_api.h:275
unsigned int depth
Depth of the corresponding block in the tree.
Definition: fs_api.h:1732
We&#39;ve determined the real, desired CHK for this block (full tree reconstruction failed), request is now pending.
Definition: fs_api.h:1669
void GNUNET_FS_download_start_downloading_(struct GNUNET_FS_DownloadContext *dc)
Start the downloading process (by entering the queue).
Definition: fs_download.c:2244
GNUNET_FS_QueuePriority
Priorities for the queue.
Definition: fs_api.h:415
static struct GNUNET_FS_DownloadContext * dc
SuspendSignalFunction ssf
Function to call for suspend-signalling and clean up.
Definition: fs_api.h:1049
Default priority.
Definition: fs_api.h:425
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:498
void GNUNET_FS_stop_probe_ping_task_(struct GNUNET_FS_SearchResult *sr)
Stop the ping task for this search result.
Definition: fs_search.c:406
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:1860
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:588
uint64_t file_size
Overall size of the file.
Definition: fs_api.h:1469
Information about a file and its location (peer claiming to share the file).
Definition: fs_api.h:113
const struct GNUNET_CONFIGURATION_Handle * cfg
Configuration to use.
Definition: fs_api.h:1092