GNUnet  0.11.x
gnunet-service-fs_pr.h
Go to the documentation of this file.
1 /*
2  This file is part of GNUnet.
3  Copyright (C) 2009, 2010, 2011 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_PR_H
27 #define GNUNET_SERVICE_FS_PR_H
28 
29 #include "gnunet-service-fs.h"
30 
31 
36 {
41 
46 
51 
56 
61 
66 
73 };
74 
75 
82 {
86  struct GNUNET_HashCode query;
87 
92  const struct GNUNET_PeerIdentity *target;
93 
98 
103 
107  struct GNUNET_TIME_Absolute ttl;
108 
113 
117  uint32_t anonymity_level;
118 
122  uint32_t priority;
123 
128 
136 
143  uint32_t respect_offered;
144 
149 
153  enum GNUNET_BLOCK_Type type;
154 
158  unsigned int results_found;
159 
165 };
166 
167 
186 typedef void
187 (*GSF_PendingRequestReplyHandler) (void *cls,
189  struct GSF_PendingRequest *pr,
190  uint32_t reply_anonymity_level,
192  struct GNUNET_TIME_Absolute
194  enum GNUNET_BLOCK_Type type,
195  const void *data,
196  size_t data_len);
197 
198 
221 struct GSF_PendingRequest *
223  enum GNUNET_BLOCK_Type type,
224  const struct GNUNET_HashCode *query,
225  const struct GNUNET_PeerIdentity *target,
226  const char *bf_data,
227  size_t bf_size,
228  uint32_t mingle,
229  uint32_t anonymity_level,
230  uint32_t priority,
231  int32_t ttl,
234  const struct GNUNET_HashCode *replies_seen,
235  unsigned int replies_seen_count,
237  void *rh_cls);
238 
239 
248 void
250  const struct GNUNET_HashCode *replies_seen,
251  unsigned int replies_seen_count);
252 
253 
260 struct GSF_PendingRequestData *
262 
263 
270 int
272 
273 
283 int
285  struct GSF_PendingRequest *prb);
286 
287 
295 struct GNUNET_MQ_Envelope *
297 
298 
305 void
307  int full_cleanup);
308 
309 
319 typedef int
320 (*GSF_PendingRequestIterator) (void *cls,
321  const struct GNUNET_HashCode *key,
322  struct GSF_PendingRequest *pr);
323 
324 
331 void
333  void *cls);
334 
335 
345 void
346 handle_p2p_put (void *cls,
347  const struct PutMessage *put);
348 
349 
355 void
357 
358 
364 void
366 
367 
376 typedef void
377 (*GSF_LocalLookupContinuation) (void *cls,
378  struct GSF_PendingRequest *pr,
380 
381 
389 void
392  void *cont_cls);
393 
394 
402 int
404  const struct GNUNET_PeerIdentity *target);
405 
406 
410 void
412 
413 
417 void
419 
420 
421 #endif
422 /* end of gnunet-service-fs_pr.h */
struct GNUNET_GETOPT_CommandLineOption options[]
Definition: 002.c:5
static char * expiration
Credential TTL.
Definition: gnunet-abd.c:96
static unsigned int anonymity_level
Anonymity level option to use for publishing.
struct GNUNET_HashCode key
The key used in the DHT.
uint32_t data
The data value.
static int result
Global testing status.
shared data structures of gnunet-service-fs.c
int GSF_pending_request_test_target_(struct GSF_PendingRequest *pr, const struct GNUNET_PeerIdentity *target)
Is the given target a legitimate peer for forwarding the given request?
void(* GSF_LocalLookupContinuation)(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.
void GSF_cadet_lookup_(struct GSF_PendingRequest *pr)
Consider downloading via cadet (if possible)
GSF_PendingRequestOptions
Options for pending requests (bits to be ORed).
@ GSF_PRO_DEFAULTS
No special options (P2P-default).
@ GSF_PRO_LOCAL_REQUEST
Option mask for typical local requests.
@ GSF_PRO_LOCAL_ONLY
Request must only be processed locally.
@ GSF_PRO_PRIORITY_UNLIMITED
Request priority is allowed to be exceeded.
@ GSF_PRO_FORWARD_ONLY
Request must only be forwarded (no routing)
@ GSF_PRO_BLOOMFILTER_FULL_REFRESH
Request is allowed to refresh bloomfilter and change mingle value.
@ GSF_PRO_REQUEST_NEVER_EXPIRES
Request persists indefinitely (no expiration).
int GSF_pending_request_is_compatible_(struct GSF_PendingRequest *pra, struct GSF_PendingRequest *prb)
Test if two pending requests are compatible (would generate the same query modulo filters and should ...
void GSF_dht_lookup_(struct GSF_PendingRequest *pr)
Consider looking up the data in the DHT (anonymity-level permitting).
void GSF_iterate_pending_requests_(GSF_PendingRequestIterator it, void *cls)
Iterate over all pending requests.
void(* GSF_PendingRequestReplyHandler)(void *cls, enum GNUNET_BLOCK_EvaluationResult eval, struct GSF_PendingRequest *pr, uint32_t reply_anonymity_level, struct GNUNET_TIME_Absolute expiration, struct GNUNET_TIME_Absolute last_transmission, enum GNUNET_BLOCK_Type type, const void *data, size_t data_len)
Handle a reply to a pending request.
struct GSF_PendingRequest * GSF_pending_request_create_(enum GSF_PendingRequestOptions options, enum GNUNET_BLOCK_Type type, const struct GNUNET_HashCode *query, const struct GNUNET_PeerIdentity *target, const char *bf_data, size_t bf_size, uint32_t mingle, uint32_t anonymity_level, uint32_t priority, int32_t ttl, GNUNET_PEER_Id sender_pid, GNUNET_PEER_Id origin_pid, const struct GNUNET_HashCode *replies_seen, unsigned int replies_seen_count, GSF_PendingRequestReplyHandler rh, void *rh_cls)
Create a new pending request.
void GSF_local_lookup_(struct GSF_PendingRequest *pr, GSF_LocalLookupContinuation cont, void *cont_cls)
Look up the request in the local datastore.
struct GNUNET_MQ_Envelope * GSF_pending_request_get_message_(struct GSF_PendingRequest *pr)
Generate the message corresponding to the given pending request for transmission to other peers.
void handle_p2p_put(void *cls, const struct PutMessage *put)
Handle P2P "CONTENT" message.
int GSF_pending_request_test_active_(struct GSF_PendingRequest *pr)
Check if the given request is still active.
int(* GSF_PendingRequestIterator)(void *cls, const struct GNUNET_HashCode *key, struct GSF_PendingRequest *pr)
Signature of function called on each request.
void GSF_pending_request_done_(void)
Shutdown the subsystem.
void GSF_pending_request_init_(void)
Setup the subsystem.
struct GSF_PendingRequestData * GSF_pending_request_get_data_(struct GSF_PendingRequest *pr)
Obtain the public data associated with a pending request.
void GSF_pending_request_cancel_(struct GSF_PendingRequest *pr, int full_cleanup)
Explicitly cancel a pending request.
void GSF_pending_request_update_(struct GSF_PendingRequest *pr, const struct GNUNET_HashCode *replies_seen, unsigned int replies_seen_count)
Update a given pending request with additional replies that have been seen.
GNUNET_BLOCK_EvaluationResult
Possible ways for how a block may relate to a query.
GNUNET_BLOCK_Type
Blocks in the datastore and the datacache must have a unique type.
unsigned int GNUNET_PEER_Id
A GNUNET_PEER_Id is simply a shorter version of a "struct GNUNET_PeerIdentifier" that can be used ins...
static GNUNET_CronTime last_transmission
A 512-bit hashcode.
The identity of the host (wraps the signing key of the peer).
Time for absolute times used by GNUnet, in microseconds.
Public data (in the sense of not encapsulated within 'gnunet-service-fs_pr', not in the sense of netw...
int has_started
Has this request been started yet (local/p2p operations)? Or are we still constructing it?
const struct GNUNET_PeerIdentity * target
Identity of a peer hosting the content, otherwise NULl.
struct GNUNET_TIME_Absolute ttl
Current TTL for the request.
uint32_t respect_offered
How much respect did we (in total) offer for this request so far (estimate, because we might have the...
enum GNUNET_BLOCK_Type type
Type of the requested block.
struct GSF_PendingRequestPlanBijection * pr_head
Fields for the plan module to track a DLL with the request.
uint32_t num_transmissions
Counter for how often this request has been transmitted (estimate, because we might have the same req...
enum GSF_PendingRequestOptions options
Options for the request.
unsigned int results_found
Number of results we have found for this request so far.
uint32_t anonymity_level
Desired anonymity level.
struct GSF_PendingRequestPlanBijection * pr_tail
Fields for the plan module to track a DLL with the request.
struct GNUNET_HashCode query
Primary query hash for this request.
struct GNUNET_TIME_Absolute start_time
When did we start with the request.
uint32_t priority
Priority that this request (still) has for us.
uint32_t original_priority
Priority that this request (originally) had for us.
M:N binding of plans to pending requests.
An active request.
unsigned int replies_seen_count
Number of valid entries in the 'replies_seen' array.
GNUNET_PEER_Id sender_pid
Identity of the peer that we should use for the 'sender' (recipient of the response) when forwarding ...
GSF_PendingRequestReplyHandler rh
Function to call if we encounter a reply.
void * rh_cls
Closure for rh.
GNUNET_PEER_Id origin_pid
Identity of the peer that we should never forward this query to since it originated this query (0 for...
struct GNUNET_HashCode * replies_seen
Array of hash codes of replies we've already seen.
Response from FS service with a result for a previous FS search.
Definition: fs.h:329
enum GNUNET_TESTBED_UnderlayLinkModelType type
the type of this model