aboutsummaryrefslogtreecommitdiff
path: root/src/fs/gnunet-service-fs_pr.h
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2011-02-10 12:59:38 +0000
committerChristian Grothoff <christian@grothoff.org>2011-02-10 12:59:38 +0000
commitf54389f6724ecbd39389d53fba7b3bfdb2e0a8eb (patch)
tree11a7156180b22e4eaf784f5b1e400261c00e3ef9 /src/fs/gnunet-service-fs_pr.h
parent3a39cd4cd22e345733ba225e7a4c0b6eecdad7df (diff)
downloadgnunet-f54389f6724ecbd39389d53fba7b3bfdb2e0a8eb.tar.gz
gnunet-f54389f6724ecbd39389d53fba7b3bfdb2e0a8eb.zip
stuff
Diffstat (limited to 'src/fs/gnunet-service-fs_pr.h')
-rw-r--r--src/fs/gnunet-service-fs_pr.h62
1 files changed, 37 insertions, 25 deletions
diff --git a/src/fs/gnunet-service-fs_pr.h b/src/fs/gnunet-service-fs_pr.h
index 5fb9d2a5a..88c650042 100644
--- a/src/fs/gnunet-service-fs_pr.h
+++ b/src/fs/gnunet-service-fs_pr.h
@@ -68,7 +68,9 @@ enum GSF_PendingRequestOptions
68 68
69 69
70/** 70/**
71 * Public data associated with each pending request. 71 * Public data (in the sense of not encapsulated within
72 * 'gnunet-service-fs_pr', not in the sense of network-wide
73 * known) associated with each pending request.
72 */ 74 */
73struct GSF_PendingRequestData 75struct GSF_PendingRequestData
74{ 76{
@@ -185,36 +187,18 @@ GSF_pending_request_update_ (struct GSF_PendingRequest *pr,
185 187
186 188
187/** 189/**
188 * Get the query for a given pending request.
189 *
190 * @param pr the request
191 * @return pointer to the query (only valid as long as pr is valid)
192 */
193const GNUNET_HashCode *
194GSF_pending_request_get_query_ (const struct GSF_PendingRequest *pr);
195
196
197/**
198 * Get the type of a given pending request.
199 *
200 * @param pr the request
201 * @return query type
202 */
203enum GNUNET_BLOCK_Type
204GSF_pending_request_get_type_ (const struct GSF_PendingRequest *pr);
205
206
207/**
208 * Generate the message corresponding to the given pending request for 190 * Generate the message corresponding to the given pending request for
209 * transmission to other peers (or at least determine its size). 191 * transmission to other peers (or at least determine its size).
210 * 192 *
211 * @param pr request to generate the message for 193 * @param pr request to generate the message for
194 * @param do_route are we routing the reply
212 * @param buf_size number of bytes available in buf 195 * @param buf_size number of bytes available in buf
213 * @param buf where to copy the message (can be NULL) 196 * @param buf where to copy the message (can be NULL)
214 * @return number of bytes needed (if > buf_size) or used 197 * @return number of bytes needed (if buf_size too small) or used
215 */ 198 */
216size_t 199size_t
217GSF_pending_request_get_message_ (struct GSF_PendingRequest *pr, 200GSF_pending_request_get_message_ (struct GSF_PendingRequest *pr,
201 int do_route,
218 size_t buf_size, 202 size_t buf_size,
219 void *buf); 203 void *buf);
220 204
@@ -230,10 +214,12 @@ GSF_pending_request_cancel_ (struct GSF_PendingRequest *pr);
230 214
231/** 215/**
232 * Signature of function called on each request. 216 * Signature of function called on each request.
217 * (Note: 'subtype' of GNUNET_CONTAINER_HashMapIterator).
233 * 218 *
234 * @param cls closure 219 * @param cls closure
235 * @param key query for the request 220 * @param key query for the request
236 * @param pr handle to the pending request 221 * @param pr handle to the pending request
222 * @return GNUNET_YES to continue to iterate
237 */ 223 */
238typedef int (*GSF_PendingRequestIterator)(void *cls, 224typedef int (*GSF_PendingRequestIterator)(void *cls,
239 const GNUNET_HashCode *key, 225 const GNUNET_HashCode *key,
@@ -257,19 +243,45 @@ GSF_iterate_pending_requests_ (GSF_PendingRequestIterator it,
257 * this content and possibly passes it on (to local clients or other 243 * this content and possibly passes it on (to local clients or other
258 * peers). Does NOT perform migration (content caching at this peer). 244 * peers). Does NOT perform migration (content caching at this peer).
259 * 245 *
260 * @param other the other peer involved (sender or receiver, NULL 246 * @param cp the other peer involved (sender or receiver, NULL
261 * for loopback messages where we are both sender and receiver) 247 * for loopback messages where we are both sender and receiver)
262 * @param message the actual message 248 * @param message the actual message
263 * @return how valueable was the content to us (0 for not at all), 249 * @return GNUNET_OK if the message was well-formed,
264 * GNUNET_SYSERR if the message was malformed (close connection, 250 * GNUNET_SYSERR if the message was malformed (close connection,
265 * do not cache under any circumstances) 251 * do not cache under any circumstances)
266 */ 252 */
267int 253int
268GSF_handle_p2p_content_ (const struct GNUNET_PeerIdentity *other, 254GSF_handle_p2p_content_ (struct GSF_ConnectedPeer *cp,
269 const struct GNUNET_MessageHeader *message); 255 const struct GNUNET_MessageHeader *message);
270 256
271 257
272/** 258/**
259 * Iterator called on each result obtained for a DHT
260 * operation that expects a reply
261 *
262 * @param cls closure, the 'struct GSF_PendingRequest *'.
263 * @param exp when will this value expire
264 * @param key key of the result
265 * @param get_path NULL-terminated array of pointers
266 * to the peers on reverse GET path (or NULL if not recorded)
267 * @param put_path NULL-terminated array of pointers
268 * to the peers on the PUT path (or NULL if not recorded)
269 * @param type type of the result
270 * @param size number of bytes in data
271 * @param data pointer to the result data
272 */
273void
274GSF_handle_dht_reply_ (void *cls,
275 struct GNUNET_TIME_Absolute exp,
276 const GNUNET_HashCode * key,
277 const struct GNUNET_PeerIdentity * const *get_path,
278 const struct GNUNET_PeerIdentity * const *put_path,
279 enum GNUNET_BLOCK_Type type,
280 size_t size,
281 const void *data);
282
283
284/**
273 * Setup the subsystem. 285 * Setup the subsystem.
274 */ 286 */
275void 287void