X-Git-Url: https://git.librecmc.org/?a=blobdiff_plain;f=src%2Ffs%2Fgnunet-service-fs_pr.h;h=92827f76bb053a9da6eb99e4665c6bf921d9f404;hb=0238d7e2f30821e7b94e9ea25ce3918fcc04b2c3;hp=03fc047fbc4b08e828e528d44d085d96e46da604;hpb=cddbdf5b928c68ab71b40c950b9f01ea68a9fbdb;p=oweals%2Fgnunet.git diff --git a/src/fs/gnunet-service-fs_pr.h b/src/fs/gnunet-service-fs_pr.h index 03fc047fb..92827f76b 100644 --- a/src/fs/gnunet-service-fs_pr.h +++ b/src/fs/gnunet-service-fs_pr.h @@ -34,6 +34,12 @@ */ enum GSF_PendingRequestOptions { + + /** + * No special options (P2P-default). + */ + GSF_PRO_DEFAULTS = 0, + /** * Request must only be processed locally. */ @@ -47,7 +53,7 @@ enum GSF_PendingRequestOptions /** * Request persists indefinitely (no expiration). */ - GSF_PRO_REQUEST_EXPIRES = 4, + GSF_PRO_REQUEST_NEVER_EXPIRES = 4, /** * Request is allowed to refresh bloomfilter and change mingle value. @@ -63,7 +69,7 @@ enum GSF_PendingRequestOptions * Option mask for typical local requests. */ GSF_PRO_LOCAL_REQUEST = - (GSF_PRO_BLOOMFILTER_FULL_REFRESH | GSF_PRO_PRIORITY_UNLIMITED) + (GSF_PRO_BLOOMFILTER_FULL_REFRESH | GSF_PRO_PRIORITY_UNLIMITED | GSF_PRO_REQUEST_NEVER_EXPIRES) }; @@ -146,6 +152,12 @@ struct GSF_PendingRequestData */ int has_target; + /** + * Has this request been started yet (local/p2p operations)? Or are + * we still constructing it? + */ + int has_started; + }; @@ -162,6 +174,7 @@ struct GSF_PendingRequestData * @param pr handle to the original pending request * @param reply_anonymity_level anonymity level for the reply, UINT32_MAX for "unknown" * @param expiration when does 'data' expire? + * @param last_transmission the last time we've tried to get this block (FOREVER if unknown) * @param type type of the block * @param data response data, NULL on request expiration * @param data_len number of bytes in data @@ -174,6 +187,8 @@ typedef void (*GSF_PendingRequestReplyHandler) (void *cls, 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); @@ -195,6 +210,7 @@ typedef void (*GSF_PendingRequestReplyHandler) (void *cls, * @param ttl current time-to-live for the request * @param sender_pid peer ID to use for the sender when forwarding, 0 for none; * reference counter is taken over by this function + * @param origin_pid peer ID of origin of query (do not loop back) * @param replies_seen hash codes of known local replies * @param replies_seen_count size of the 'replies_seen' array * @param rh handle to call when we get a reply @@ -211,6 +227,7 @@ GSF_pending_request_create_ (enum GSF_PendingRequestOptions options, uint32_t mingle, uint32_t anonymity_level, uint32_t priority, int32_t ttl, GNUNET_PEER_Id sender_pid, + GNUNET_PEER_Id origin_pid, const GNUNET_HashCode * replies_seen, unsigned int replies_seen_count, GSF_PendingRequestReplyHandler rh, void *rh_cls); @@ -246,7 +263,7 @@ GSF_pending_request_get_data_ (struct GSF_PendingRequest *pr); * jointly). * * @param pra a pending request - * @param pra another pending request + * @param prb another pending request * @return GNUNET_OK if the requests are compatible */ int @@ -355,6 +372,19 @@ GSF_local_lookup_ (struct GSF_PendingRequest *pr, GSF_LocalLookupContinuation cont, void *cont_cls); +/** + * Is the given target a legitimate peer for forwarding the given request? + * + * @param pr request + * @param target + * @return GNUNET_YES if this request could be forwarded to the given peer + */ +int +GSF_pending_request_test_target_ (struct GSF_PendingRequest *pr, + const struct GNUNET_PeerIdentity *target); + + + /** * Setup the subsystem. */