GNUnet  0.10.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 
40 
45 
50 
55 
60 
65 
71 };
72 
73 
84 
89  const struct GNUNET_PeerIdentity *target;
90 
95 
100 
105 
110 
114  uint32_t anonymity_level;
115 
119  uint32_t priority;
120 
125 
133 
140  uint32_t respect_offered;
141 
146 
151 
155  unsigned int results_found;
156 
162 };
163 
164 
183 typedef void
186  struct GSF_PendingRequest *pr,
187  uint32_t reply_anonymity_level,
190  enum GNUNET_BLOCK_Type type,
191  const void *data,
192  size_t data_len);
193 
194 
217 struct GSF_PendingRequest *
219  enum GNUNET_BLOCK_Type type,
220  const struct GNUNET_HashCode *query,
221  const struct GNUNET_PeerIdentity *target,
222  const char *bf_data,
223  size_t bf_size,
224  uint32_t mingle,
225  uint32_t anonymity_level,
226  uint32_t priority,
227  int32_t ttl,
230  const struct GNUNET_HashCode *replies_seen,
231  unsigned int replies_seen_count,
233  void *rh_cls);
234 
235 
244 void
246  const struct GNUNET_HashCode *replies_seen,
247  unsigned int replies_seen_count);
248 
249 
256 struct GSF_PendingRequestData *
258 
259 
266 int
268 
269 
279 int
281  struct GSF_PendingRequest *prb);
282 
283 
291 struct GNUNET_MQ_Envelope *
293 
294 
301 void
303  int full_cleanup);
304 
305 
315 typedef int
317  const struct GNUNET_HashCode *key,
318  struct GSF_PendingRequest *pr);
319 
320 
327 void
329  void *cls);
330 
331 
341 void
342 handle_p2p_put(void *cls,
343  const struct PutMessage *put);
344 
345 
351 void
353 
354 
360 void
362 
363 
372 typedef void
374  struct GSF_PendingRequest *pr,
376 
377 
385 void
388  void *cont_cls);
389 
390 
398 int
400  const struct GNUNET_PeerIdentity *target);
401 
402 
403 
407 void
409 
410 
414 void
416 
417 
418 #endif
419 /* end of gnunet-service-fs_pr.h */
void GSF_cadet_lookup_(struct GSF_PendingRequest *pr)
Consider downloading via cadet (if possible)
void GSF_dht_lookup_(struct GSF_PendingRequest *pr)
Consider looking up the data in the DHT (anonymity-level permitting).
const struct GNUNET_PeerIdentity * target
Identity of a peer hosting the content, otherwise NULl.
int GSF_pending_request_test_active_(struct GSF_PendingRequest *pr)
Check if the given request is still active.
static char * expiration
Credential TTL.
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.
Request is allowed to refresh bloomfilter and change mingle value.
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.
void GSF_local_lookup_(struct GSF_PendingRequest *pr, GSF_LocalLookupContinuation cont, void *cont_cls)
Look up the request in the local datastore.
static GNUNET_CronTime last_transmission
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...
Response from FS service with a result for a previous FS search.
Definition: fs.h:321
uint32_t num_transmissions
Counter for how often this request has been transmitted (estimate, because we might have the same req...
GNUNET_BLOCK_Type
Blocks in the datastore and the datacache must have a unique type.
void GSF_pending_request_cancel_(struct GSF_PendingRequest *pr, int full_cleanup)
Explicitly cancel a pending request.
struct GNUNET_TIME_Absolute ttl
Current TTL for the request.
No special options (P2P-default).
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_head
Fields for the plan module to track a DLL with the request.
void GSF_iterate_pending_requests_(GSF_PendingRequestIterator it, void *cls)
Iterate over all pending requests.
Request priority is allowed to be exceeded.
shared data structures of gnunet-service-fs.c
struct GNUNET_TIME_Absolute start_time
When did we start with the request.
struct GNUNET_HashCode query
Primary query hash for this request.
void(* GSF_LocalLookupContinuation)(void *cls, struct GSF_PendingRequest *pr, enum GNUNET_BLOCK_EvaluationResult result)
Function to be called after we&#39;re done processing replies from the local lookup.
unsigned int replies_seen_count
Number of valid entries in the &#39;replies_seen&#39; array.
Request persists indefinitely (no expiration).
void GSF_pending_request_init_(void)
Setup the subsystem.
Public data (in the sense of not encapsulated within &#39;gnunet-service-fs_pr&#39;, not in the sense of netw...
GNUNET_PEER_Id origin_pid
Identity of the peer that we should never forward this query to since it originated this query (0 for...
unsigned int GNUNET_PEER_Id
A GNUNET_PEER_Id is simply a shorter version of a "struct GNUNET_PeerIdentifier" that can be used ins...
void handle_p2p_put(void *cls, const struct PutMessage *put)
Handle P2P "CONTENT" message.
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?
int(* GSF_PendingRequestIterator)(void *cls, const struct GNUNET_HashCode *key, struct GSF_PendingRequest *pr)
Signature of function called on each request.
struct GSF_PendingRequestData * GSF_pending_request_get_data_(struct GSF_PendingRequest *pr)
Obtain the public data associated with a pending request.
static int result
Global testing status.
void * rh_cls
Closure for rh.
uint32_t respect_offered
How much respect did we (in total) offer for this request so far (estimate, because we might have the...
void GSF_pending_request_done_(void)
Shutdown the subsystem.
enum GNUNET_BLOCK_Type type
Type of the requested block.
Request must only be processed locally.
A 512-bit hashcode.
GSF_PendingRequestReplyHandler rh
Function to call if we encounter a reply.
struct GSF_PendingRequestPlanBijection * pr_tail
Fields for the plan module to track a DLL with the request.
struct GNUNET_HashCode key
The key used in the DHT.
uint32_t original_priority
Priority that this request (originally) had for us.
GNUNET_BLOCK_EvaluationResult
Possible ways for how a block may relate to a query.
The identity of the host (wraps the signing key of the peer).
Option mask for typical local requests.
enum GSF_PendingRequestOptions options
Options for the request.
Request must only be forwarded (no routing)
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.
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 ...
Time for absolute times used by GNUnet, in microseconds.
uint32_t priority
Priority that this request (still) has for us.
An active request.
uint32_t data
The data value.
int has_started
Has this request been started yet (local/p2p operations)? Or are we still constructing it...
GSF_PendingRequestOptions
Options for pending requests (bits to be ORed).
GNUNET_PEER_Id sender_pid
Identity of the peer that we should use for the &#39;sender&#39; (recipient of the response) when forwarding ...
struct GNUNET_HashCode * replies_seen
Array of hash codes of replies we&#39;ve already seen.
M:N binding of plans to pending requests.