GNUnet 0.22.2
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
33#include "gnunet_fs_service.h"
34#include "gnunet_block_lib.h"
35#include "block_fs.h"
36
37
41#define DBLOCK_SIZE (32 * 1024)
42
48#define HASHING_BLOCKSIZE (1024 * 128)
49
50
55{
60
65};
66
67
69
70
76{
81
87
92
97
101 uint64_t file_length;
102};
103
104
109{
115
121
126
131
136};
137
138
153{
158
163
172
180
185
186 /* this is followed by a 0-terminated
187 * filename of a file with the hash
188 * "file_id" as seen by the client */
189};
190
191
197{
203
208
213
214 /* this is followed by a 0-terminated
215 * filename of a file with the hash
216 * "file_id" as seen by the client */
217};
218
219
228{
233
238
243};
244
245
249#define SEARCH_MESSAGE_OPTION_NONE 0
250
254#define SEARCH_MESSAGE_OPTION_LOOPBACK_ONLY 1
255
262#define SEARCH_MESSAGE_OPTION_CONTINUED 2
263
264
270{
275
286
291
296
308
314
315 /* this is followed by the hash codes of already-known
316 * results (which should hence be excluded from what
317 * the service returns); naturally, this only applies
318 * to queries that can have multiple results (UBLOCKS).
319 */
320};
321
322
330{
335
340
345
346 /* this is followed by the actual encrypted content */
347};
348
356{
361
366
371
377
383
389
390 /* this is followed by the actual encrypted content */
391};
393
394
395#endif
396
397/* end of fs.h */
FS block formats (shared between FS and Block)
Library for data block manipulation.
API to the DHT service.
API for file sharing via GNUnet.
#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:356
uint32_t respect_offered
How much respect did we offer (in total) before getting an answer (estimate).
Definition: fs.h:388
uint32_t type
Type of the block (in big endian).
Definition: fs.h:365
struct GNUNET_TIME_AbsoluteNBO expiration
When does this result expire?
Definition: fs.h:370
struct GNUNET_MessageHeader header
Message type will be GNUNET_MESSAGE_TYPE_FS_PUT.
Definition: fs.h:360
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:376
uint32_t num_transmissions
How often did we transmit this query before getting an answer (estimate).
Definition: fs.h:382
content hash key
Definition: fs.h:55
struct GNUNET_HashCode key
Hash of the original content, used for encryption.
Definition: fs.h:59
struct GNUNET_HashCode query
Hash of the encrypted content, used for querying.
Definition: fs.h:64
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:197
struct GNUNET_HashCode file_id
Hash of the indexed file.
Definition: fs.h:212
uint32_t reserved
Always zero.
Definition: fs.h:207
struct GNUNET_MessageHeader header
Message type will be GNUNET_MESSAGE_TYPE_FS_INDEX_LIST_ENTRY.
Definition: fs.h:202
Message sent from a GNUnet (fs) publishing activity to the gnunet-fs-service to initiate indexing of ...
Definition: fs.h:153
struct GNUNET_MessageHeader header
Message type will be GNUNET_MESSAGE_TYPE_FS_INDEX_START.
Definition: fs.h:157
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:179
struct GNUNET_HashCode file_id
Hash of the file that we would like to index.
Definition: fs.h:184
uint32_t reserved
For alignment.
Definition: fs.h:162
uint64_t device
ID of device containing the file, as seen by the client.
Definition: fs.h:171
Response from FS service with a result for a previous FS search.
Definition: fs.h:330
struct GNUNET_MessageHeader header
Message type will be GNUNET_MESSAGE_TYPE_FS_PUT.
Definition: fs.h:334
uint32_t type
Type of the block (in big endian).
Definition: fs.h:339
struct GNUNET_TIME_AbsoluteNBO expiration
When does this result expire?
Definition: fs.h:344
Message sent from a GNUnet (fs) publishing activity to sign a LOC URI.
Definition: fs.h:76
uint64_t file_length
Size of the shared file (to be signed).
Definition: fs.h:101
uint32_t purpose
Requested signature purpose.
Definition: fs.h:86
struct GNUNET_MessageHeader header
Message type will be GNUNET_MESSAGE_TYPE_FS_REQUEST_LOC_SIGN.
Definition: fs.h:80
struct GNUNET_TIME_AbsoluteNBO expiration_time
Requested expiration time.
Definition: fs.h:91
struct ContentHashKey chk
Information about the shared file (to be signed).
Definition: fs.h:96
Message sent from the service with the signed LOC URI.
Definition: fs.h:109
struct GNUNET_CRYPTO_EddsaSignature signature
The requested signature.
Definition: fs.h:130
struct GNUNET_MessageHeader header
Message type will be GNUNET_MESSAGE_TYPE_FS_REQUEST_LOC_SIGNATURE.
Definition: fs.h:114
struct GNUNET_PeerIdentity peer
Identity of the peer sharing the file.
Definition: fs.h:135
uint32_t purpose
Purpose of the generated signature.
Definition: fs.h:120
struct GNUNET_TIME_AbsoluteNBO expiration_time
Expiration time that was actually used (rounded!).
Definition: fs.h:125
Message sent from a GNUnet (fs) search activity to the gnunet-service-fs to start a search.
Definition: fs.h:270
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:307
uint32_t type
Type of the content that we're looking for.
Definition: fs.h:290
struct GNUNET_HashCode query
Hash of the public key for UBLOCKs; Hash of the CHK-encoded block for DBLOCKS and IBLOCKS.
Definition: fs.h:313
uint32_t anonymity_level
Desired anonymity level, big-endian.
Definition: fs.h:295
struct GNUNET_MessageHeader header
Message type will be GNUNET_MESSAGE_TYPE_FS_START_SEARCH.
Definition: fs.h:274
uint32_t options
Bitmask with options.
Definition: fs.h:285
Message sent from a GNUnet (fs) unindexing activity to the gnunet-service-fs to indicate that a file ...
Definition: fs.h:228
struct GNUNET_HashCode file_id
Hash of the file that we will unindex.
Definition: fs.h:242
uint32_t reserved
Always zero.
Definition: fs.h:237
struct GNUNET_MessageHeader header
Message type will be GNUNET_MESSAGE_TYPE_FS_UNINDEX.
Definition: fs.h:232