diff options
Diffstat (limited to 'src/fs/gnunet-service-fs_pr.h')
-rw-r--r-- | src/fs/gnunet-service-fs_pr.h | 93 |
1 files changed, 44 insertions, 49 deletions
diff --git a/src/fs/gnunet-service-fs_pr.h b/src/fs/gnunet-service-fs_pr.h index abdb0c9f6..39e471c4d 100644 --- a/src/fs/gnunet-service-fs_pr.h +++ b/src/fs/gnunet-service-fs_pr.h | |||
@@ -11,12 +11,12 @@ | |||
11 | WITHOUT ANY WARRANTY; without even the implied warranty of | 11 | WITHOUT ANY WARRANTY; without even the implied warranty of |
12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
13 | Affero General Public License for more details. | 13 | Affero General Public License for more details. |
14 | 14 | ||
15 | You should have received a copy of the GNU Affero General Public License | 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/>. | 16 | along with this program. If not, see <http://www.gnu.org/licenses/>. |
17 | 17 | ||
18 | SPDX-License-Identifier: AGPL3.0-or-later | 18 | SPDX-License-Identifier: AGPL3.0-or-later |
19 | */ | 19 | */ |
20 | 20 | ||
21 | /** | 21 | /** |
22 | * @file fs/gnunet-service-fs_pr.h | 22 | * @file fs/gnunet-service-fs_pr.h |
@@ -32,9 +32,7 @@ | |||
32 | /** | 32 | /** |
33 | * Options for pending requests (bits to be ORed). | 33 | * Options for pending requests (bits to be ORed). |
34 | */ | 34 | */ |
35 | enum GSF_PendingRequestOptions | 35 | enum GSF_PendingRequestOptions { |
36 | { | ||
37 | |||
38 | /** | 36 | /** |
39 | * No special options (P2P-default). | 37 | * No special options (P2P-default). |
40 | */ | 38 | */ |
@@ -69,7 +67,7 @@ enum GSF_PendingRequestOptions | |||
69 | * Option mask for typical local requests. | 67 | * Option mask for typical local requests. |
70 | */ | 68 | */ |
71 | GSF_PRO_LOCAL_REQUEST = | 69 | GSF_PRO_LOCAL_REQUEST = |
72 | (GSF_PRO_BLOOMFILTER_FULL_REFRESH | GSF_PRO_PRIORITY_UNLIMITED | GSF_PRO_REQUEST_NEVER_EXPIRES) | 70 | (GSF_PRO_BLOOMFILTER_FULL_REFRESH | GSF_PRO_PRIORITY_UNLIMITED | GSF_PRO_REQUEST_NEVER_EXPIRES) |
73 | }; | 71 | }; |
74 | 72 | ||
75 | 73 | ||
@@ -78,9 +76,7 @@ enum GSF_PendingRequestOptions | |||
78 | * 'gnunet-service-fs_pr', not in the sense of network-wide | 76 | * 'gnunet-service-fs_pr', not in the sense of network-wide |
79 | * known) associated with each pending request. | 77 | * known) associated with each pending request. |
80 | */ | 78 | */ |
81 | struct GSF_PendingRequestData | 79 | struct GSF_PendingRequestData { |
82 | { | ||
83 | |||
84 | /** | 80 | /** |
85 | * Primary query hash for this request. | 81 | * Primary query hash for this request. |
86 | */ | 82 | */ |
@@ -163,7 +159,6 @@ struct GSF_PendingRequestData | |||
163 | * we still constructing it? | 159 | * we still constructing it? |
164 | */ | 160 | */ |
165 | int has_started; | 161 | int has_started; |
166 | |||
167 | }; | 162 | }; |
168 | 163 | ||
169 | 164 | ||
@@ -220,22 +215,22 @@ typedef void | |||
220 | * @return handle for the new pending request | 215 | * @return handle for the new pending request |
221 | */ | 216 | */ |
222 | struct GSF_PendingRequest * | 217 | struct GSF_PendingRequest * |
223 | GSF_pending_request_create_ (enum GSF_PendingRequestOptions options, | 218 | GSF_pending_request_create_(enum GSF_PendingRequestOptions options, |
224 | enum GNUNET_BLOCK_Type type, | 219 | enum GNUNET_BLOCK_Type type, |
225 | const struct GNUNET_HashCode *query, | 220 | const struct GNUNET_HashCode *query, |
226 | const struct GNUNET_PeerIdentity *target, | 221 | const struct GNUNET_PeerIdentity *target, |
227 | const char *bf_data, | 222 | const char *bf_data, |
228 | size_t bf_size, | 223 | size_t bf_size, |
229 | uint32_t mingle, | 224 | uint32_t mingle, |
230 | uint32_t anonymity_level, | 225 | uint32_t anonymity_level, |
231 | uint32_t priority, | 226 | uint32_t priority, |
232 | int32_t ttl, | 227 | int32_t ttl, |
233 | GNUNET_PEER_Id sender_pid, | 228 | GNUNET_PEER_Id sender_pid, |
234 | GNUNET_PEER_Id origin_pid, | 229 | GNUNET_PEER_Id origin_pid, |
235 | const struct GNUNET_HashCode *replies_seen, | 230 | const struct GNUNET_HashCode *replies_seen, |
236 | unsigned int replies_seen_count, | 231 | unsigned int replies_seen_count, |
237 | GSF_PendingRequestReplyHandler rh, | 232 | GSF_PendingRequestReplyHandler rh, |
238 | void *rh_cls); | 233 | void *rh_cls); |
239 | 234 | ||
240 | 235 | ||
241 | /** | 236 | /** |
@@ -247,9 +242,9 @@ GSF_pending_request_create_ (enum GSF_PendingRequestOptions options, | |||
247 | * @param replies_seen_count size of the @a replies_seen array | 242 | * @param replies_seen_count size of the @a replies_seen array |
248 | */ | 243 | */ |
249 | void | 244 | void |
250 | GSF_pending_request_update_ (struct GSF_PendingRequest *pr, | 245 | GSF_pending_request_update_(struct GSF_PendingRequest *pr, |
251 | const struct GNUNET_HashCode *replies_seen, | 246 | const struct GNUNET_HashCode *replies_seen, |
252 | unsigned int replies_seen_count); | 247 | unsigned int replies_seen_count); |
253 | 248 | ||
254 | 249 | ||
255 | /** | 250 | /** |
@@ -259,7 +254,7 @@ GSF_pending_request_update_ (struct GSF_PendingRequest *pr, | |||
259 | * @return associated public data | 254 | * @return associated public data |
260 | */ | 255 | */ |
261 | struct GSF_PendingRequestData * | 256 | struct GSF_PendingRequestData * |
262 | GSF_pending_request_get_data_ (struct GSF_PendingRequest *pr); | 257 | GSF_pending_request_get_data_(struct GSF_PendingRequest *pr); |
263 | 258 | ||
264 | 259 | ||
265 | /** | 260 | /** |
@@ -269,7 +264,7 @@ GSF_pending_request_get_data_ (struct GSF_PendingRequest *pr); | |||
269 | * @return #GNUNET_YES if the request is still active | 264 | * @return #GNUNET_YES if the request is still active |
270 | */ | 265 | */ |
271 | int | 266 | int |
272 | GSF_pending_request_test_active_ (struct GSF_PendingRequest *pr); | 267 | GSF_pending_request_test_active_(struct GSF_PendingRequest *pr); |
273 | 268 | ||
274 | 269 | ||
275 | /** | 270 | /** |
@@ -282,8 +277,8 @@ GSF_pending_request_test_active_ (struct GSF_PendingRequest *pr); | |||
282 | * @return #GNUNET_OK if the requests are compatible | 277 | * @return #GNUNET_OK if the requests are compatible |
283 | */ | 278 | */ |
284 | int | 279 | int |
285 | GSF_pending_request_is_compatible_ (struct GSF_PendingRequest *pra, | 280 | GSF_pending_request_is_compatible_(struct GSF_PendingRequest *pra, |
286 | struct GSF_PendingRequest *prb); | 281 | struct GSF_PendingRequest *prb); |
287 | 282 | ||
288 | 283 | ||
289 | /** | 284 | /** |
@@ -294,7 +289,7 @@ GSF_pending_request_is_compatible_ (struct GSF_PendingRequest *pra, | |||
294 | * @return envelope with the request message | 289 | * @return envelope with the request message |
295 | */ | 290 | */ |
296 | struct GNUNET_MQ_Envelope * | 291 | struct GNUNET_MQ_Envelope * |
297 | GSF_pending_request_get_message_ (struct GSF_PendingRequest *pr); | 292 | GSF_pending_request_get_message_(struct GSF_PendingRequest *pr); |
298 | 293 | ||
299 | 294 | ||
300 | /** | 295 | /** |
@@ -304,8 +299,8 @@ GSF_pending_request_get_message_ (struct GSF_PendingRequest *pr); | |||
304 | * @param full_cleanup fully purge the request | 299 | * @param full_cleanup fully purge the request |
305 | */ | 300 | */ |
306 | void | 301 | void |
307 | GSF_pending_request_cancel_ (struct GSF_PendingRequest *pr, | 302 | GSF_pending_request_cancel_(struct GSF_PendingRequest *pr, |
308 | int full_cleanup); | 303 | int full_cleanup); |
309 | 304 | ||
310 | 305 | ||
311 | /** | 306 | /** |
@@ -330,8 +325,8 @@ typedef int | |||
330 | * @param cls closure for it | 325 | * @param cls closure for it |
331 | */ | 326 | */ |
332 | void | 327 | void |
333 | GSF_iterate_pending_requests_ (GSF_PendingRequestIterator it, | 328 | GSF_iterate_pending_requests_(GSF_PendingRequestIterator it, |
334 | void *cls); | 329 | void *cls); |
335 | 330 | ||
336 | 331 | ||
337 | /** | 332 | /** |
@@ -344,8 +339,8 @@ GSF_iterate_pending_requests_ (GSF_PendingRequestIterator it, | |||
344 | * @param put the actual message | 339 | * @param put the actual message |
345 | */ | 340 | */ |
346 | void | 341 | void |
347 | handle_p2p_put (void *cls, | 342 | handle_p2p_put(void *cls, |
348 | const struct PutMessage *put); | 343 | const struct PutMessage *put); |
349 | 344 | ||
350 | 345 | ||
351 | /** | 346 | /** |
@@ -354,7 +349,7 @@ handle_p2p_put (void *cls, | |||
354 | * @param pr the pending request to process | 349 | * @param pr the pending request to process |
355 | */ | 350 | */ |
356 | void | 351 | void |
357 | GSF_dht_lookup_ (struct GSF_PendingRequest *pr); | 352 | GSF_dht_lookup_(struct GSF_PendingRequest *pr); |
358 | 353 | ||
359 | 354 | ||
360 | /** | 355 | /** |
@@ -363,7 +358,7 @@ GSF_dht_lookup_ (struct GSF_PendingRequest *pr); | |||
363 | * @param pr the pending request to process | 358 | * @param pr the pending request to process |
364 | */ | 359 | */ |
365 | void | 360 | void |
366 | GSF_cadet_lookup_ (struct GSF_PendingRequest *pr); | 361 | GSF_cadet_lookup_(struct GSF_PendingRequest *pr); |
367 | 362 | ||
368 | 363 | ||
369 | /** | 364 | /** |
@@ -388,9 +383,9 @@ typedef void | |||
388 | * @param cont_cls closure for @a cont | 383 | * @param cont_cls closure for @a cont |
389 | */ | 384 | */ |
390 | void | 385 | void |
391 | GSF_local_lookup_ (struct GSF_PendingRequest *pr, | 386 | GSF_local_lookup_(struct GSF_PendingRequest *pr, |
392 | GSF_LocalLookupContinuation cont, | 387 | GSF_LocalLookupContinuation cont, |
393 | void *cont_cls); | 388 | void *cont_cls); |
394 | 389 | ||
395 | 390 | ||
396 | /** | 391 | /** |
@@ -401,8 +396,8 @@ GSF_local_lookup_ (struct GSF_PendingRequest *pr, | |||
401 | * @return #GNUNET_YES if this request could be forwarded to the given peer | 396 | * @return #GNUNET_YES if this request could be forwarded to the given peer |
402 | */ | 397 | */ |
403 | int | 398 | int |
404 | GSF_pending_request_test_target_ (struct GSF_PendingRequest *pr, | 399 | GSF_pending_request_test_target_(struct GSF_PendingRequest *pr, |
405 | const struct GNUNET_PeerIdentity *target); | 400 | const struct GNUNET_PeerIdentity *target); |
406 | 401 | ||
407 | 402 | ||
408 | 403 | ||
@@ -410,14 +405,14 @@ GSF_pending_request_test_target_ (struct GSF_PendingRequest *pr, | |||
410 | * Setup the subsystem. | 405 | * Setup the subsystem. |
411 | */ | 406 | */ |
412 | void | 407 | void |
413 | GSF_pending_request_init_ (void); | 408 | GSF_pending_request_init_(void); |
414 | 409 | ||
415 | 410 | ||
416 | /** | 411 | /** |
417 | * Shutdown the subsystem. | 412 | * Shutdown the subsystem. |
418 | */ | 413 | */ |
419 | void | 414 | void |
420 | GSF_pending_request_done_ (void); | 415 | GSF_pending_request_done_(void); |
421 | 416 | ||
422 | 417 | ||
423 | #endif | 418 | #endif |