GNUnet  0.11.x
fs.h
Go to the documentation of this file.
1 /*
2  This file is part of GNUnet.
3  Copyright (C) 2003--2012 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_H
27 #define FS_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 
36 
40 #define DBLOCK_SIZE (32 * 1024)
41 
47 #define HASHING_BLOCKSIZE (1024 * 128)
48 
49 
54 {
58  struct GNUNET_HashCode key;
59 
63  struct GNUNET_HashCode query;
64 };
65 
66 
68 
69 
75 {
80 
86 
91 
95  struct ContentHashKey chk;
96 
100  uint64_t file_length;
101 };
102 
103 
108 {
114 
120 
125 
130 
134  struct GNUNET_PeerIdentity peer;
135 };
136 
137 
152 {
157 
162 
171 
179 
183  struct GNUNET_HashCode file_id;
184 
185  /* this is followed by a 0-terminated
186  * filename of a file with the hash
187  * "file_id" as seen by the client */
188 };
189 
190 
196 {
202 
207 
211  struct GNUNET_HashCode file_id;
212 
213  /* this is followed by a 0-terminated
214  * filename of a file with the hash
215  * "file_id" as seen by the client */
216 };
217 
218 
227 {
232 
237 
241  struct GNUNET_HashCode file_id;
242 };
243 
244 
248 #define SEARCH_MESSAGE_OPTION_NONE 0
249 
253 #define SEARCH_MESSAGE_OPTION_LOOPBACK_ONLY 1
254 
261 #define SEARCH_MESSAGE_OPTION_CONTINUED 2
262 
263 
269 {
274 
285 
289  uint32_t type GNUNET_PACKED;
290 
295 
307 
312  struct GNUNET_HashCode query;
313 
314  /* this is followed by the hash codes of already-known
315  * results (which should hence be excluded from what
316  * the service returns); naturally, this only applies
317  * to queries that can have multiple results (UBLOCKS).
318  */
319 };
320 
321 
329 {
334 
338  uint32_t type GNUNET_PACKED;
339 
344 
345  /* this is followed by the actual encrypted content */
346 };
347 
355 {
360 
364  uint32_t type GNUNET_PACKED;
365 
370 
376 
382 
387  uint32_t respect_offered;
388 
389  /* this is followed by the actual encrypted content */
390 };
392 
393 
394 #endif
395 
396 /* end of fs.h */
#define GNUNET_NETWORK_STRUCT_BEGIN
Define as empty, GNUNET_PACKED should suffice, but this won't work on W32.
#define GNUNET_NETWORK_STRUCT_END
Define as empty, GNUNET_PACKED should suffice, but this won't work on W32;.
#define GNUNET_PACKED
gcc-ism to get packed structs.
Response from FS service with a result for a previous FS search.
Definition: fs.h:355
uint32_t respect_offered
How much respect did we offer (in total) before getting an answer (estimate).
Definition: fs.h:387
uint32_t type
Type of the block (in big endian).
Definition: fs.h:364
struct GNUNET_TIME_AbsoluteNBO expiration
When does this result expire?
Definition: fs.h:369
struct GNUNET_MessageHeader header
Message type will be GNUNET_MESSAGE_TYPE_FS_PUT.
Definition: fs.h:359
struct GNUNET_TIME_AbsoluteNBO last_transmission
When was the last time we've tried to download this block? (FOREVER if unknown/not relevant)
Definition: fs.h:375
uint32_t num_transmissions
How often did we transmit this query before getting an answer (estimate).
Definition: fs.h:381
content hash key
Definition: fs.h:54
struct GNUNET_HashCode key
Hash of the original content, used for encryption.
Definition: fs.h:58
struct GNUNET_HashCode query
Hash of the encrypted content, used for querying.
Definition: fs.h:63
an ECC signature using EdDSA.
A 512-bit hashcode.
Header for all communications.
The identity of the host (wraps the signing key of the peer).
Time for absolute time used by GNUnet, in microseconds and in network byte order.
Message send by FS service in response to a request asking for a list of all indexed files.
Definition: fs.h:196
struct GNUNET_HashCode file_id
Hash of the indexed file.
Definition: fs.h:211
uint32_t reserved
Always zero.
Definition: fs.h:206
struct GNUNET_MessageHeader header
Message type will be GNUNET_MESSAGE_TYPE_FS_INDEX_LIST_ENTRY.
Definition: fs.h:201
Message sent from a GNUnet (fs) publishing activity to the gnunet-fs-service to initiate indexing of ...
Definition: fs.h:152
struct GNUNET_MessageHeader header
Message type will be GNUNET_MESSAGE_TYPE_FS_INDEX_START.
Definition: fs.h:156
uint64_t inode
Inode of the file on the given device, as seen by the client ("st_ino" field from "struct stat").
Definition: fs.h:178
struct GNUNET_HashCode file_id
Hash of the file that we would like to index.
Definition: fs.h:183
uint32_t reserved
For alignment.
Definition: fs.h:161
uint64_t device
ID of device containing the file, as seen by the client.
Definition: fs.h:170
Response from FS service with a result for a previous FS search.
Definition: fs.h:329
struct GNUNET_MessageHeader header
Message type will be GNUNET_MESSAGE_TYPE_FS_PUT.
Definition: fs.h:333
uint32_t type
Type of the block (in big endian).
Definition: fs.h:338
struct GNUNET_TIME_AbsoluteNBO expiration
When does this result expire?
Definition: fs.h:343
Message sent from a GNUnet (fs) publishing activity to sign a LOC URI.
Definition: fs.h:75
uint64_t file_length
Size of the shared file (to be signed).
Definition: fs.h:100
uint32_t purpose
Requested signature purpose.
Definition: fs.h:85
struct GNUNET_MessageHeader header
Message type will be GNUNET_MESSAGE_TYPE_FS_REQUEST_LOC_SIGN.
Definition: fs.h:79
struct GNUNET_TIME_AbsoluteNBO expiration_time
Requested expiration time.
Definition: fs.h:90
struct ContentHashKey chk
Information about the shared file (to be signed).
Definition: fs.h:95
Message sent from the service with the signed LOC URI.
Definition: fs.h:108
struct GNUNET_CRYPTO_EddsaSignature signature
The requested signature.
Definition: fs.h:129
struct GNUNET_MessageHeader header
Message type will be GNUNET_MESSAGE_TYPE_FS_REQUEST_LOC_SIGNATURE.
Definition: fs.h:113
struct GNUNET_PeerIdentity peer
Identity of the peer sharing the file.
Definition: fs.h:134
uint32_t purpose
Purpose of the generated signature.
Definition: fs.h:119
struct GNUNET_TIME_AbsoluteNBO expiration_time
Expiration time that was actually used (rounded!).
Definition: fs.h:124
Message sent from a GNUnet (fs) search activity to the gnunet-service-fs to start a search.
Definition: fs.h:269
struct GNUNET_PeerIdentity target
If the request is for a DBLOCK or IBLOCK, this is the identity of the peer that is known to have a re...
Definition: fs.h:306
uint32_t type
Type of the content that we're looking for.
Definition: fs.h:289
struct GNUNET_HashCode query
Hash of the public key for UBLOCKs; Hash of the CHK-encoded block for DBLOCKS and IBLOCKS.
Definition: fs.h:312
uint32_t anonymity_level
Desired anonymity level, big-endian.
Definition: fs.h:294
struct GNUNET_MessageHeader header
Message type will be GNUNET_MESSAGE_TYPE_FS_START_SEARCH.
Definition: fs.h:273
uint32_t options
Bitmask with options.
Definition: fs.h:284
Message sent from a GNUnet (fs) unindexing activity to the gnunet-service-fs to indicate that a file ...
Definition: fs.h:227
struct GNUNET_HashCode file_id
Hash of the file that we will unindex.
Definition: fs.h:241
uint32_t reserved
Always zero.
Definition: fs.h:236
struct GNUNET_MessageHeader header
Message type will be GNUNET_MESSAGE_TYPE_FS_UNINDEX.
Definition: fs.h:231