GNUnet  0.11.x
gnunet-service-fs.h
Go to the documentation of this file.
1 /*
2  This file is part of GNUnet.
3  Copyright (C) 2009, 2010 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 GNUNET_SERVICE_FS_H
27 #define GNUNET_SERVICE_FS_H
28 
29 #include "gnunet_util_lib.h"
32 #include "gnunet_core_service.h"
33 #include "gnunet_block_lib.h"
34 #include "gnunet_ats_service.h"
35 #include "fs.h"
36 
37 
44 #define TTL_DECREMENT 5000
45 
51 #define DATASTORE_LOAD_AUTODECLINE GNUNET_TIME_relative_multiply ( \
52  GNUNET_TIME_UNIT_MILLISECONDS, 250)
53 
57 #define GET_MESSAGE_BIT_QUERY_ONLY 0
58 
65 #define GET_MESSAGE_BIT_RETURN_TO 1
66 
75 #define GET_MESSAGE_BIT_TRANSMIT_TO 4
76 
77 
79 
83 struct GetMessage
84 {
89 
93  uint32_t type GNUNET_PACKED;
94 
99 
104 
113 
122 
127  struct GNUNET_HashCode query;
128 
129  /* this is followed by PeerIdentities as specified in the "hash_bitmap";
130  * after that, an optional bloomfilter (with bits set for replies
131  * that should be suppressed) can be present */
132 };
133 
134 
140 {
146 
151 
156 };
158 
162 struct GSF_ConnectedPeer;
163 
167 struct GSF_PendingRequest;
168 
172 struct GSF_LocalClient;
173 
177 struct GSF_RequestPlan;
178 
183 
187 extern struct GNUNET_DATASTORE_Handle *GSF_dsh;
188 
192 extern const struct GNUNET_CONFIGURATION_Handle *GSF_cfg;
193 
197 extern struct GNUNET_STATISTICS_Handle *GSF_stats;
198 
203 extern struct GNUNET_CORE_Handle *GSF_core;
204 
208 extern struct GNUNET_DHT_Handle *GSF_dht;
209 
214 
219 
224 
228 extern struct GNUNET_PeerIdentity GSF_my_id;
229 
240 extern double GSF_current_priorities;
241 
246 extern unsigned int GSF_cover_query_count;
247 
252 extern unsigned int GSF_cover_content_count;
253 
257 extern struct GNUNET_BLOCK_Context *GSF_block_ctx;
258 
263 
267 extern unsigned int GSF_datastore_queue_size;
268 
269 
280 void
281 GSF_consider_forwarding (void *cls,
282  struct GSF_PendingRequest *pr,
284 
285 
295 int
296 GSF_test_get_load_too_high_ (uint32_t priority);
297 
298 
305 void
307 
308 
309 #endif
310 /* end of gnunet-service-fs.h */
definitions for the entire fs module
static int start
Set if we are to start default services (including ARM).
Definition: gnunet-arm.c:39
static int result
Global testing status.
int GSF_enable_randomized_delays
Are we introducing randomized delays for better anonymity?
void GSF_update_datastore_delay_(struct GNUNET_TIME_Absolute start)
We've just now completed a datastore request.
struct GNUNET_BLOCK_Context * GSF_block_ctx
Our block context.
struct GNUNET_DHT_Handle * GSF_dht
Handle for DHT operations.
int GSF_test_get_load_too_high_(uint32_t priority)
Test if the DATABASE (GET) load on this peer is too high to even consider processing the query at all...
struct GNUNET_STATISTICS_Handle * GSF_stats
Handle for reporting statistics.
double GSF_current_priorities
Typical priorities we're seeing from other peers right now.
unsigned int GSF_cover_query_count
How many query messages have we received 'recently' that have not yet been claimed as cover traffic?
const struct GNUNET_CONFIGURATION_Handle * GSF_cfg
Our configuration.
struct GNUNET_PeerIdentity GSF_my_id
Identity of this peer.
struct GNUNET_ATS_PerformanceHandle * GSF_ats
Handle to ATS service.
struct GNUNET_CORE_Handle * GSF_core
Pointer to handle to the core service (points to NULL until we've connected to it).
unsigned int GSF_cover_content_count
How many content messages have we received 'recently' that have not yet been claimed as cover traffic...
struct GNUNET_TIME_Relative GSF_avg_latency
Running average of the observed latency to other peers (round trip).
struct GNUNET_LOAD_Value * GSF_rt_entry_lifetime
How long do requests typically stay in the routing table?
struct GNUNET_DATASTORE_Handle * GSF_dsh
Our connection to the datastore.
unsigned int GSF_datastore_queue_size
Size of the datastore queue we assume for common requests.
void GSF_consider_forwarding(void *cls, struct GSF_PendingRequest *pr, enum GNUNET_BLOCK_EvaluationResult result)
Function to be called after we're done processing replies from the local lookup.
Automatic transport selection and outbound bandwidth determination.
#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.
GNUNET_BLOCK_EvaluationResult
Possible ways for how a block may relate to a query.
ATS Handle to obtain and/or modify performance information.
Handle to an initialized block library.
Definition: block.c:55
Context for the core service connection.
Definition: core_api.c:78
Handle to the datastore service.
Connection to the DHT service.
Definition: dht_api.c:202
A 512-bit hashcode.
Values we track for load calculations.
Definition: load.c:36
Header for all communications.
The identity of the host (wraps the signing key of the peer).
Handle for the service.
Time for absolute times used by GNUnet, in microseconds.
Time for relative time used by GNUnet, in microseconds and in network byte order.
Time for relative time used by GNUnet, in microseconds.
A connected peer.
A local client.
M:N binding of plans to pending requests.
An active request.
Information we keep per request per peer.
Message to the datastore service asking about specific content.
Definition: datastore.h:141
uint32_t type
Desired content type.
Definition: datastore.h:150
struct GNUNET_MessageHeader header
Type is GNUNET_MESSAGE_TYPE_DATASTORE_GET.
Definition: datastore.h:145
uint32_t priority
How important is this request (network byte order)
uint32_t filter_mutator
The content hash should be mutated using this value before checking against the bloomfilter (used to ...
struct GNUNET_HashCode query
Hashcodes of the file(s) we're looking for.
int32_t ttl
Relative time to live in MILLISECONDS (network byte order)
uint32_t hash_bitmap
Which of the optional hash codes are present at the end of the message? See GET_MESSAGE_BIT_xx consta...
Message send by a peer that wants to be excluded from migration for a while.
struct GNUNET_MessageHeader header
Message type will be GNUNET_MESSAGE_TYPE_FS_MIGRATION_STOP.
struct GNUNET_TIME_RelativeNBO duration
How long should the block last?
uint32_t reserved
Always zero.