GNUnet  0.11.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 {
98  uint64_t file_length;
99 
104 };
105 
106 
111 struct Location
112 {
116  struct FileIdentifier fi;
117 
122 
126  struct GNUNET_TIME_Absolute expirationTime;
127 
132  struct GNUNET_CRYPTO_EddsaSignature contentSignature;
133 };
134 
139 {
144 
149 
154 
159 };
160 
161 
166 {
171 
172  union
173  {
174  struct
175  {
185  char **keywords;
186 
190  unsigned int keywordCount;
191  } ksk;
192 
193  struct
194  {
199 
204  char *identifier;
205  } sks;
206 
211  struct FileIdentifier chk;
212 
217  struct Location loc;
218  } data;
219 };
220 
221 
227 {
232 
238 
243 
247  void *client_info;
248 
253 
258 
264 
270 
275 
280 
287 
292 
296  char *emsg;
297 
301  char *filename;
302 
306  union
307  {
311  struct
312  {
317 
321  void *reader_cls;
322 
328  struct GNUNET_HashCode file_id;
329 
333  uint64_t file_size;
334 
338  int do_index;
339 
345 
351  } file;
352 
356  struct
357  {
362 
367  size_t dir_size;
368 
373  void *dir_data;
374 
379 
383  uint64_t contents_size;
384  } dir;
385  } data;
386 
391 
396 };
397 
398 
403 {
408 
413 };
414 
415 
420 {
425 
430 
435 
440 
444  void *cls;
445 
450 
455 
459  struct GNUNET_TIME_Absolute queue_time;
460 
465 
470  struct GNUNET_TIME_Relative run_time;
471 
475  unsigned int blocks;
476 
480  enum GNUNET_FS_QueuePriority priority;
481 
485  unsigned int start_times;
486 
490  int active;
491 };
492 
493 
498 {
503 
508 
513 
519 
524 
529 
533  void *client_info;
534 
540 
546 
552 
557 
561  uint8_t *keyword_bitmap;
562 
567 
574 
578  struct GNUNET_TIME_Absolute probe_active_time;
579 
583  struct GNUNET_TIME_Relative remaining_probe_time;
584 
588  uint32_t anonymity;
589 
596 
602 
607 
613 };
614 
615 
627 struct GNUNET_FS_QueueEntry *
631  void *cls,
632  unsigned int blocks,
634 
635 
641 void
643 
644 
661 size_t
663  uint64_t offset,
664  size_t max,
665  void *buf,
666  char **emsg);
667 
668 
675 void *
677 
678 
695 size_t
697  uint64_t offset,
698  size_t max,
699  void *buf,
700  char **emsg);
701 
702 
718 void *
720  const struct GNUNET_FS_ProgressInfo *info);
721 
722 
728 void
730 
731 
739 void
741  const struct GNUNET_HashCode *file_id);
742 
743 
749 void
751 
752 
758 void
760 
761 
772 void *
775  const struct GNUNET_FS_FileInformation *p,
776  uint64_t offset);
777 
778 
786 void
788  struct GNUNET_FS_DownloadContext *dc);
789 
790 
797 void
799 
800 
809 void
812  uint64_t offset);
813 
823 void *
825  struct GNUNET_FS_Handle *h,
826  struct GNUNET_FS_SearchContext *sc);
827 
828 
834 void
836 
844 int
846 
852 void
854 
855 
861 void
863 
864 
872 void
874  const char *ext,
875  const char *ent);
876 
877 
885 void
887  const char *ext,
888  const char *uni);
889 
890 
899 void
901 
902 
911 void
913 
914 
923 void
925 
926 
935 void
937 
938 
947 void
949 
950 
959 void
961 
962 
969 void
971 
972 
979 void
981 
982 
989 void
991 
992 
999 void
1001 
1002 
1010 typedef void (*SuspendSignalFunction) (void *cls);
1011 
1017 {
1022 
1027 
1032 
1036  void *ssf_cls;
1037 };
1038 
1039 
1048 struct TopLevelActivity *
1051  void *ssf_cls);
1052 
1053 
1060 void
1062  struct TopLevelActivity *top);
1063 
1064 
1069 {
1074 
1079 
1084 
1088  void *upcb_cls;
1089 
1094 
1099 
1104 
1109 
1114 
1119 
1124 
1129 
1135 
1141 
1146  struct GNUNET_TIME_Relative avg_block_latency;
1147 
1151  unsigned int active_downloads;
1152 
1156  unsigned int active_blocks;
1157 
1161  enum GNUNET_FS_Flags flags;
1162 
1167 
1172 };
1173 
1174 
1179 {
1184 
1189 
1194 
1199 
1203  char *nid;
1204 
1208  char *nuid;
1209 
1215 
1221 
1226 
1231 
1236 
1241 
1247 
1253 
1259 
1263  uint64_t reserve_space;
1264 
1270 
1275 
1280  int rid;
1281 
1287 
1292 
1299 };
1300 
1301 
1306 {
1311 
1317 
1322 
1327 
1333 
1338 
1343 };
1344 
1345 
1350 {
1355  struct ContentHashKey chk;
1356 
1361 
1366 
1371 
1376 
1380  uint32_t ksk_offset;
1381 
1385  char *filename;
1386 
1391 
1397 
1403 
1408 
1413 
1418 
1424 
1428  struct GNUNET_HashCode ukey;
1429 
1433  struct GNUNET_HashCode uquery;
1434 
1438  char *emsg;
1439 
1444 
1448  uint64_t file_size;
1449 
1454 
1458  struct GNUNET_HashCode file_id;
1459 
1464 };
1465 
1466 
1471 {
1475  struct GNUNET_HashCode uquery;
1476 
1481 
1486  char *keyword;
1487 
1497 
1503 };
1504 
1505 
1510 {
1515 
1520 
1525 
1531 
1536 
1541 
1546 
1550  char *emsg;
1551 
1559 
1565 
1570 
1574  struct GNUNET_TIME_Relative reconnect_backoff;
1575 
1583 
1587  uint32_t anonymity;
1588 
1593 
1598 };
1599 
1600 
1607 {
1613 
1621 
1629 
1637 
1646 
1655 
1661 
1668 };
1669 
1670 
1675 {
1680 
1685 
1690  struct ContentHashKey chk;
1691 
1697  uint64_t offset;
1698 
1702  unsigned int num_children;
1703 
1707  unsigned int depth;
1708 
1712  unsigned int chk_idx;
1713 
1718 };
1719 
1720 
1726 void
1728 
1729 
1735 void
1737 
1738 
1743 {
1748 
1753 
1758 
1764 
1770 
1775 
1780 
1785 
1790 
1795 
1800 
1805 
1809  char *emsg;
1810 
1816 
1821  char *filename;
1822 
1829 
1834 
1839 
1845 
1851 
1856 
1861  struct GNUNET_PeerIdentity target;
1862 
1872 
1877  uint64_t offset;
1878 
1883  uint64_t length;
1884 
1889  uint64_t completed;
1890 
1897  uint64_t old_file_size;
1898 
1903 
1907  struct GNUNET_TIME_Relative reconnect_backoff;
1908 
1912  uint32_t anonymity;
1913 
1917  unsigned int treedepth;
1918 
1923 
1930 
1935 };
1936 
1937 
1938 #endif
1939 
1940 /* end of fs_api.h */
void * client_info
Client info for this search result.
Definition: fs_api.h:533
uint32_t optional_support
Number of optional keywords under which this result was also found.
Definition: fs_api.h:601
struct GNUNET_FS_FileInformation * entries
Linked list of entries in the directory.
Definition: fs_api.h:361
This is a probe (low priority).
Definition: fs_api.h:407
void * reader_cls
Closure for reader.
Definition: fs_api.h:321
char * nid
ID of the content in the namespace, NULL if we have no namespace.
Definition: fs_api.h:1203
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:1390
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:280
static char * dir
Set to the directory where runtime files are stored.
Definition: gnunet-arm.c:89
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:803
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:1258
struct ContentHashKey chk
Query and key of the top GNUNET_EC_IBlock.
Definition: fs_api.h:103
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:1582
struct GNUNET_FS_FileInformation * dir
If this is a file in a directory, "dir" refers to the directory; otherwise NULL.
Definition: fs_api.h:237
Context for controlling a download.
Definition: fs_api.h:1742
uint32_t mandatory_count
Number of mandatory keywords in this query.
Definition: fs_api.h:1592
struct GNUNET_FS_DownloadContext * download
ID of an associated download based on this search result (or NULL for none).
Definition: fs_api.h:545
int rid
Space reservation ID with datastore service for this upload.
Definition: fs_api.h:1280
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:252
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:1530
struct TopLevelActivity * prev
This is a doubly-linked list.
Definition: fs_api.h:1026
void GNUNET_FS_download_sync_(struct GNUNET_FS_DownloadContext *dc)
Synchronize this download struct with its mirror on disk.
Definition: fs_api.c:1972
struct GNUNET_FS_Handle * h
Global FS context.
Definition: fs_api.h:1747
struct GNUNET_GETOPT_CommandLineOption options[]
Definition: 002.c:5
Context for the SKS publication.
Definition: fs_namespace.c:334
content hash key
Definition: fs.h:53
void * client_info
Pointer kept for the client.
Definition: fs_api.h:247
struct DownloadRequest ** children
Array (!) of child-requests, or NULL for the bottom of the tree.
Definition: fs_api.h:1684
struct GNUNET_FS_TreeEncoder * tc
Merkle-ish tree encoder context.
Definition: fs_api.h:1412
uint32_t ksk_offset
Current offset in KSK removal.
Definition: fs_api.h:1380
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:1312
char * emsg
Error message (non-NULL if this operation failed).
Definition: fs_api.h:296
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:1134
char * serialization
Under what filename is this struct serialized (for operational persistence).
Definition: fs_api.h:286
struct GNUNET_FS_DownloadContext * child_head
Head of list of child downloads.
Definition: fs_api.h:1774
Master context for most FS operations.
Definition: fs_api.h:1068
We&#39;re done.
Definition: fs_api.h:1337
GNUNET_FS_DataReader reader
Function that can be used to read the data for the file.
Definition: fs_api.h:316
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:1519
char * emsg
Error message (non-NULL if this operation failed).
Definition: fs_api.h:1550
void GNUNET_FS_unindex_do_remove_(struct GNUNET_FS_UnindexContext *uc)
Connect to the datastore and remove the blocks.
Definition: fs_unindex.c:649
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:518
uint8_t * keyword_bitmap
Bitmap that specifies precisely which keywords have been matched already.
Definition: fs_api.h:561
int mandatory
Is this keyword a mandatory keyword (started with &#39;+&#39;)?
Definition: fs_api.h:1502
struct GNUNET_FS_QueueEntry * pending_head
Head of DLL of pending jobs.
Definition: fs_api.h:1113
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:1855
struct GNUNET_FS_DownloadContext * parent
Parent download (used when downloading files in directories).
Definition: fs_api.h:1763
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:1697
Keyword search key (query with keywords).
Definition: fs_api.h:153
uint64_t reserve_space
Storage space to reserve for the operation.
Definition: fs_api.h:1263
char * filename
Name of the file or directory (must be an absolute path).
Definition: fs_api.h:301
struct GNUNET_FS_Uri * uri
URI to which this search result refers to.
Definition: fs_api.h:523
unsigned int active_blocks
How many blocks do the active downloads have?
Definition: fs_api.h:1156
char * filename
Where are we writing the data (name of the file, can be NULL!).
Definition: fs_api.h:1821
struct GNUNET_CRYPTO_FileHashContext * fhc
Non-null if we are currently hashing a file.
Definition: fs_api.h:1230
struct GNUNET_DATASTORE_Handle * dsh
Connection to the datastore service.
Definition: fs_api.h:1235
struct GNUNET_FS_Handle * h
Handle to the global fs context.
Definition: fs_api.h:1183
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:1214
GNUNET_FS_UriType
Types of URIs.
Definition: fs_api.h:138
Private ECC key encoded for transmission.
Information for a file or directory that is about to be published.
Definition: fs_api.h:226
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:539
struct GNUNET_FS_Handle * h
Handle to the master context.
Definition: fs_api.h:242
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:1636
static struct GNUNET_PEERINFO_Handle * pi
Handle to peerinfo service.
unsigned int num_children
Number of entries in children array.
Definition: fs_api.h:1702
struct GNUNET_FS_QueueEntry * running_head
Head of DLL of running jobs.
Definition: fs_api.h:1103
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:1828
Handle for controlling an unindexing operation.
Definition: fs_api.h:1349
struct GNUNET_DATASTORE_Handle * dsh
Connection to the datastore service, only valid during the UNINDEX_STATE_DS_NOTIFY phase...
Definition: fs_api.h:1402
void * dir_data
Pointer to the data for the directory (or NULL if not available).
Definition: fs_api.h:373
char * identifier
Human-readable identifier chosen for this entry in the namespace.
Definition: fs_api.h:204
unsigned int max_parallel_requests
Maximum number of parallel requests.
Definition: fs_api.h:1171
int index_start_confirmed
Has the service confirmed our INDEX_START request? GNUNET_YES if this step has been completed...
Definition: fs_api.h:350
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:561
void * client_info
Context kept for the client.
Definition: fs_api.h:1794
struct GNUNET_CRYPTO_FileHashContext * fhc
Context for hashing of the file.
Definition: fs_api.h:1443
struct SearchRequestEntry * requests
Per-keyword information for a keyword search.
Definition: fs_api.h:1564
struct GNUNET_MQ_Handle * mq
Message queue handle, or NULL if job is not running.
Definition: fs_api.h:454
static struct GNUNET_ARM_Handle * h
Connection with ARM.
Definition: gnunet-arm.c:99
Find out which keywords apply.
Definition: fs_api.h:1321
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:1524
We&#39;re notifying the FS service about the unindexing.
Definition: fs_api.h:1332
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:1612
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:1897
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:551
struct TopLevelActivity * top_tail
Tail of DLL of top-level activities.
Definition: fs_api.h:1098
uint32_t anonymity
Anonymity level for the search.
Definition: fs_api.h:1587
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
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:1567
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:291
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:185
void GNUNET_FS_search_start_probe_(struct GNUNET_FS_SearchResult *sr)
Start download probes for the given search result.
Definition: fs_search.c:430
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:1365
struct GNUNET_FS_DownloadContext * next
Next download belonging to the same parent.
Definition: fs_api.h:1789
char * serialization
Name of the file on disk we use for persistence.
Definition: fs_api.h:1545
Entry in our priority queue.
Definition: datastore_api.c:99
int active
GNUNET_YES if the job is active now.
Definition: fs_api.h:490
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:1417
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:1815
uint32_t availability_trials
Number of availability trials that we have performed for this search result.
Definition: fs_api.h:612
unsigned int chk_idx
Offset of the CHK for this block in the parent block.
Definition: fs_api.h:1712
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:1408
enum GNUNET_FS_QueuePriority priority
How important is this download?
Definition: fs_api.h:480
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:580
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:1558
Information we store for each search result.
Definition: fs_api.h:497
struct GNUNET_FS_Handle * h
File-sharing context this result belongs to.
Definition: fs_api.h:502
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:1706
char * nuid
ID for future updates, NULL if we have no namespace or no updates.
Definition: fs_api.h:1208
int is_directory
Is this struct for a file or directory?
Definition: fs_api.h:390
uint32_t availability_success
Number of availability tests that have succeeded for this result.
Definition: fs_api.h:606
We&#39;re telling the datastore to remove KBlocks.
Definition: fs_api.h:1326
UnindexState
Phases of unindex processing (state machine).
Definition: fs_api.h:1305
static struct GNUNET_NAMESTORE_Handle * ns
Handle to the namestore.
Definition: gnunet-abd.c:41
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:1620
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:1062
complete information needed to download a file.
Definition: fs_api.h:93
char * client_name
Name of our client.
Definition: fs_api.h:1078
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:1496
int issue_requests
Are we ready to issue requests (reconstructions are finished)?
Definition: fs_api.h:1934
struct TopLevelActivity * top_head
Head of DLL of top-level activities.
Definition: fs_api.h:1093
struct GNUNET_FS_FileInformation * fi_pos
Current position in the file-tree for the upload.
Definition: fs_api.h:1225
GNUNET_FS_PublishOptions
Options for publishing.
struct GNUNET_CONTAINER_MultiHashMap * active
Map of active requests (those waiting for a response).
Definition: fs_api.h:1850
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:2076
We&#39;ve encountered a fatal error.
Definition: fs_api.h:1342
struct GNUNET_FS_Uri * chk_uri
CHK for this file or directory.
Definition: fs_api.h:263
struct GNUNET_FS_TreeEncoder * te
Tree encoder used for the reconstruction.
Definition: fs_api.h:1838
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:512
We&#39;ve calculated the CHK bottom-up based on the meta data.
Definition: fs_api.h:1628
uint64_t offset
What is the first offset that we&#39;re interested in?
Definition: fs_api.h:1877
struct TopLevelActivity * top
Our top-level activity entry (if we are top-level, otherwise NULL).
Definition: fs_api.h:1752
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:1252
uint32_t anonymity
Anonymity level to use for probes using this search result.
Definition: fs_api.h:588
Handle for controlling a publication process.
Definition: fs_api.h:1178
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:1375
A 512-bit hashcode.
char * filename
Name of the file that we are unindexing.
Definition: fs_api.h:1385
We&#39;ve successfully downloaded this block, but the children still need to be either downloaded or veri...
Definition: fs_api.h:1654
GNUNET_SCHEDULER_TaskCallback start
Function to call when the job is started.
Definition: fs_api.h:434
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:1871
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:190
struct GNUNET_DISK_FileHandle * rfh
File handle for reading data from an existing file (to pass to tree encoder).
Definition: fs_api.h:1844
struct GNUNET_DATASTORE_QueueEntry * dqe
Handle to datastore &#39;get_key&#39; operation issued for obtaining KBlocks.
Definition: fs_api.h:1423
This block and all of its children have been downloaded successfully (full completion propagates up)...
Definition: fs_api.h:1660
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:1108
uint64_t contents_size
Sum of all of the sizes of all of the files in the directory.
Definition: fs_api.h:383
void * ssf_cls
Closure for &#39;ssf&#39; (some struct GNUNET_FS_XXXHandle*)
Definition: fs_api.h:1036
struct GNUNET_FS_Handle * h
Handle to FS primary context.
Definition: fs_api.h:449
unsigned int active_downloads
How many actual downloads do we have running right now?
Definition: fs_api.h:1151
Content-hash-key (simple file).
Definition: fs_api.h:143
int have_hash
Is "file_id" already valid? Set to GNUNET_YES once the hash has been calculated.
Definition: fs_api.h:344
uint32_t reserve_entries
Overall number of entries to reserve for the publish operation.
Definition: fs_api.h:1269
struct GNUNET_FS_SearchResult * search
Associated search (used when downloading files based on search results), or NULL for none...
Definition: fs_api.h:1769
struct GNUNET_MQ_Handle * mq
Connection to the FS service, only valid during the UNINDEX_STATE_FS_NOTIFY phase.
Definition: fs_api.h:1396
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:1240
char * emsg
Error message, NULL if we&#39;re doing OK.
Definition: fs_api.h:1809
GNUNET_FS_DownloadOptions
Options for downloading.
int has_finished
Flag set upon transitive completion (includes child downloads).
Definition: fs_api.h:1929
int all_done
Set to GNUNET_YES if all processing has completed.
Definition: fs_api.h:1291
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:1246
struct GNUNET_CONTAINER_MetaData * meta
Metadata for the search result.
Definition: fs_api.h:528
struct GNUNET_FS_FileInformation * next
Files in a directory are kept as a linked list.
Definition: fs_api.h:231
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:1220
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:727
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:1667
BlockRequestState
FSM for possible states a block can go through.
Definition: fs_api.h:1606
Handle to a message queue.
Definition: mq.c:85
int do_index
Should the file be indexed or inserted?
Definition: fs_api.h:338
Signed key space (file in namespace).
Definition: fs_api.h:148
struct TopLevelActivity * top
Our top-level activity entry (if we are top-level, otherwise NULL).
Definition: fs_api.h:1188
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:1779
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:595
struct GNUNET_FS_FileInformation * fi
File-structure that is being shared.
Definition: fs_api.h:1193
GNUNET_FS_ProgressCallback upcb
Function to call with updates on our progress.
Definition: fs_api.h:1083
unsigned int blocks
How many blocks do the active downloads have?
Definition: fs_api.h:475
struct GNUNET_FS_SearchResult * next
Kept in a DLL while probing.
Definition: fs_api.h:507
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:1010
We&#39;re currently hashing the file.
Definition: fs_api.h:1310
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:1354
struct GNUNET_FS_QueueEntry * next
This is a linked list.
Definition: fs_api.h:424
configuration data
Definition: configuration.c:85
We&#39;re telling the datastore to delete the respective DBlocks and IBlocks.
Definition: fs_api.h:1316
struct GNUNET_CRYPTO_EcdsaPrivateKey * ns
Namespace that we are publishing in, NULL if we have no namespace.
Definition: fs_api.h:1198
A Universal Resource Identifier (URI), opaque.
Definition: fs_api.h:165
Handle to the datastore service.
struct GNUNET_FS_DownloadContext * prev
Previous download belonging to the same parent.
Definition: fs_api.h:1784
Handle for controlling a search.
Definition: fs_api.h:1509
uint64_t file_length
Total size of the file in bytes.
Definition: fs_api.h:98
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:1140
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:1370
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:1088
struct GNUNET_FS_Uri * keywords
Keywords to use for KBlocks.
Definition: fs_api.h:257
Entry in list of pending tasks.
Definition: scheduler.c:134
struct GNUNET_MQ_Handle * mq
Connection to the FS service.
Definition: fs_api.h:1535
uint32_t anonymity
Desired level of anonymity.
Definition: fs_api.h:1912
struct GNUNET_FS_Handle * h
Handle to the global FS context.
Definition: fs_api.h:1514
GNUNET_SCHEDULER_TaskCallback stop
Function to call when the job needs to stop (or is done / dequeued).
Definition: fs_api.h:439
unsigned int treedepth
The depth of the file-tree.
Definition: fs_api.h:1917
struct GNUNET_FS_SearchResult * probes_head
Head of active probes.
Definition: fs_api.h:1123
struct GNUNET_FS_QueueEntry * prev
This is a linked list.
Definition: fs_api.h:429
struct GNUNET_MQ_Handle * mq
Connection to the FS service.
Definition: fs_api.h:1757
struct GNUNET_CONTAINER_MetaData * meta
Known meta-data for the file (can be NULL).
Definition: fs_api.h:1804
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:744
Location (chk with identity of hosting peer).
Definition: fs_api.h:158
struct GNUNET_FS_QueueEntry * pending_tail
Tail of DLL of pending jobs.
Definition: fs_api.h:1118
uint64_t contents_completed
How much of the directory have we published (relative to contents_size).
Definition: fs_api.h:378
enum GNUNET_TESTBED_UnderlayLinkModelType type
the type of this model
char * emsg
Error message, NULL on success.
Definition: fs_api.h:1438
Time for absolute times used by GNUnet, in microseconds.
void * cls
Closure for start and stop.
Definition: fs_api.h:444
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:525
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:457
char * serialization
Name under which this search result is stored on disk.
Definition: fs_api.h:556
uint64_t completed
How many bytes have we already received within the specified range (DBlocks only).
Definition: fs_api.h:1889
struct GNUNET_FS_Uri * uri
URI that identifies the file that we are downloading.
Definition: fs_api.h:1799
int is_published
Are we done publishing this file?
Definition: fs_api.h:395
void * client_info
Pointer kept for the client.
Definition: fs_api.h:1407
We track all of the top-level activities of FS so that we can signal &#39;suspend&#39; on shutdown...
Definition: fs_api.h:1016
struct TopLevelActivity * next
This is a doubly-linked list.
Definition: fs_api.h:1021
Information we keep for each keyword in a keyword search.
Definition: fs_api.h:1470
void GNUNET_FS_unindex_sync_(struct GNUNET_FS_UnindexContext *uc)
Synchronize this unindex struct with its mirror on disk.
Definition: fs_api.c:1778
struct GNUNET_FS_SearchResult * probes_tail
Tail of active probes.
Definition: fs_api.h:1128
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:1360
uint32_t data
The data value.
unsigned int max_parallel_downloads
Maximum number of parallel downloads.
Definition: fs_api.h:1166
void GNUNET_FS_search_sync_(struct GNUNET_FS_SearchContext *sc)
Synchronize this search struct with its mirror on disk.
Definition: fs_api.c:2167
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:694
struct DownloadRequest * parent
Parent in the CHK-tree.
Definition: fs_api.h:1679
int any_done
Set to GNUNET_YES if we were able to publish any block.
Definition: fs_api.h:1286
Entry in the job queue.
Definition: fs_api.h:419
void * client_info
Pointer we keep for the client.
Definition: fs_api.h:1540
uint64_t file_size
Size of the file (in bytes).
Definition: fs_api.h:333
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:1298
Information about an active download request.
Definition: fs_api.h:1674
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:1486
size_t dir_size
Size of the directory itself (in bytes); 0 if the size has not yet been calculated.
Definition: fs_api.h:367
struct GNUNET_FS_Uri * sks_uri
SKS URI for this file or directory.
Definition: fs_api.h:269
unsigned int depth
Depth of the corresponding block in the tree.
Definition: fs_api.h:1707
We&#39;ve determined the real, desired CHK for this block (full tree reconstruction failed), request is now pending.
Definition: fs_api.h:1645
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:402
static struct GNUNET_FS_DownloadContext * dc
SuspendSignalFunction ssf
Function to call for suspend-signalling and clean up.
Definition: fs_api.h:1031
Default priority.
Definition: fs_api.h:412
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:485
void GNUNET_FS_stop_probe_ping_task_(struct GNUNET_FS_SearchResult *sr)
Stop the ping task for this search result.
Definition: fs_search.c:409
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:1833
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:573
uint64_t file_size
Overall size of the file.
Definition: fs_api.h:1448
Information about a file and its location (peer claiming to share the file).
Definition: fs_api.h:111
const struct GNUNET_CONFIGURATION_Handle * cfg
Configuration to use.
Definition: fs_api.h:1073