*/
struct GNUNET_PeerIdentity target;
+ /**
+ * Fields for the plan module to track a DLL with the request.
+ */
+ struct GSF_RequestPlan *rp_head;
+
+ /**
+ * Fields for the plan module to track a DLL with the request.
+ */
+ struct GSF_RequestPlan *rp_tail;
+
+ /**
+ * Current TTL for the request.
+ */
+ struct GNUNET_TIME_Absolute ttl;
+
+ /**
+ * When did we start with the request.
+ */
+ struct GNUNET_TIME_Absolute start_time;
+
/**
* Desired anonymity level.
*/
*/
uint32_t priority;
+ /**
+ * Priority that this request (originally) had for us.
+ */
+ uint32_t original_priority;
+
/**
* Options for the request.
*/
*/
enum GNUNET_BLOCK_Type type;
+ /**
+ * Number of results we have found for this request so far.
+ */
+ unsigned int results_found;
+
/**
* Is the 'target' value set to a valid peer identity?
*/
* expiration.
*
* @param cls user-specified closure
+ * @param eval evaluation of the result
* @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 type type of the block
* @param data response data, NULL on request expiration
* @param data_len number of bytes in data
*/
typedef void (*GSF_PendingRequestReplyHandler)(void *cls,
+ enum GNUNET_BLOCK_EvaluationResult eval,
struct GSF_PendingRequest *pr,
+ uint32_t reply_anonymity_level,
+ struct GNUNET_TIME_Absolute expiration,
+ enum GNUNET_BLOCK_Type type,
const void *data,
size_t data_len);
* @param query key for the lookup
* @param namespace namespace to lookup, NULL for no namespace
* @param target preferred target for the request, NULL for none
- * @param bf bloom filter for known replies, can be NULL
+ * @param bf_data raw data for bloom filter for known replies, can be NULL
+ * @param bf_size number of bytes in bf_data
* @param mingle mingle value for bf
* @param anonymity_level desired anonymity level
* @param priority maximum outgoing cummulative request priority to use
+ * @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 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
const GNUNET_HashCode *query,
const GNUNET_HashCode *namespace,
const struct GNUNET_PeerIdentity *target,
- const struct GNUNET_CONTAINER_BloomFilter *bf,
- int32_t mingle,
+ 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,
const GNUNET_HashCode *replies_seen,
unsigned int replies_seen_count,
GSF_PendingRequestReplyHandler rh,
unsigned int replies_seen_count);
+/**
+ * Obtain the public data associated with a pending request
+ *
+ * @param pr pending request
+ * @return associated public data
+ */
+struct GSF_PendingRequestData *
+GSF_pending_request_get_data_ (struct GSF_PendingRequest *pr);
+
+
/**
* Generate the message corresponding to the given pending request for
* transmission to other peers (or at least determine its size).
*
* @param pr request to generate the message for
- * @param do_route are we routing the reply
* @param buf_size number of bytes available in buf
* @param buf where to copy the message (can be NULL)
* @return number of bytes needed (if buf_size too small) or used
*/
size_t
GSF_pending_request_get_message_ (struct GSF_PendingRequest *pr,
- int do_route,
size_t buf_size,
void *buf);
/**
- * Iterator called on each result obtained for a DHT
- * operation that expects a reply
+ * Consider looking up the data in the DHT (anonymity-level permitting).
+ *
+ * @param pr the pending request to process
+ */
+void
+GSF_dht_lookup_ (struct GSF_PendingRequest *pr);
+
+
+/**
+ * Function to be called after we're done processing
+ * replies from the local lookup.
+ *
+ * @param cls closure
+ * @param pr the pending request we were processing
+ * @param result final datastore lookup result
+ */
+typedef void (*GSF_LocalLookupContinuation)(void *cls,
+ struct GSF_PendingRequest *pr,
+ enum GNUNET_BLOCK_EvaluationResult result);
+
+
+/**
+ * Look up the request in the local datastore.
*
- * @param cls closure, the 'struct GSF_PendingRequest *'.
- * @param exp when will this value expire
- * @param key key of the result
- * @param get_path NULL-terminated array of pointers
- * to the peers on reverse GET path (or NULL if not recorded)
- * @param put_path NULL-terminated array of pointers
- * to the peers on the PUT path (or NULL if not recorded)
- * @param type type of the result
- * @param size number of bytes in data
- * @param data pointer to the result data
+ * @param pr the pending request to process
+ * @param cont function to call at the end
+ * @param cont_cls closure for cont
*/
void
-GSF_handle_dht_reply_ (void *cls,
- struct GNUNET_TIME_Absolute exp,
- const GNUNET_HashCode * key,
- const struct GNUNET_PeerIdentity * const *get_path,
- const struct GNUNET_PeerIdentity * const *put_path,
- enum GNUNET_BLOCK_Type type,
- size_t size,
- const void *data);
+GSF_local_lookup_ (struct GSF_PendingRequest *pr,
+ GSF_LocalLookupContinuation cont,
+ void *cont_cls);
/**