aboutsummaryrefslogtreecommitdiff
path: root/src/fs/gnunet-service-fs_pe.h
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2011-02-07 21:53:52 +0000
committerChristian Grothoff <christian@grothoff.org>2011-02-07 21:53:52 +0000
commitde952b871bfe79a7f2b79d9ab04dc37933d49bf1 (patch)
treeb40e7dd51794a85a8334406039b10a46bd50581f /src/fs/gnunet-service-fs_pe.h
parent4cdb30b30384ea6baf3da993966974001f200b37 (diff)
downloadgnunet-de952b871bfe79a7f2b79d9ab04dc37933d49bf1.tar.gz
gnunet-de952b871bfe79a7f2b79d9ab04dc37933d49bf1.zip
stuff
Diffstat (limited to 'src/fs/gnunet-service-fs_pe.h')
-rw-r--r--src/fs/gnunet-service-fs_pe.h41
1 files changed, 25 insertions, 16 deletions
diff --git a/src/fs/gnunet-service-fs_pe.h b/src/fs/gnunet-service-fs_pe.h
index 24fbcbb7a..09baebc1a 100644
--- a/src/fs/gnunet-service-fs_pe.h
+++ b/src/fs/gnunet-service-fs_pe.h
@@ -34,45 +34,54 @@
34 * 34 *
35 * @param cp peer with the entry 35 * @param cp peer with the entry
36 * @param pr request with the entry 36 * @param pr request with the entry
37 * @param position position of the entry in the cp queue 37 * @param weight determines position of the entry in the cp queue,
38 * @return handle for the new plan entry 38 * lower weights are earlier in the queue
39 */ 39 */
40struct GSF_PlanEntry * 40void
41GSF_plan_entry_create_ (struct GSF_ConnectedPeer *cp, 41GSF_plan_add_ (struct GSF_ConnectedPeer *cp,
42 struct GSF_PendingRequest *pr, 42 struct GSF_PendingRequest *pr,
43 unsigned int position); 43 double weight);
44 44
45 45
46/** 46/**
47 * Notify the plan about a new peer to use. 47 * Notify the plan about a peer being no longer available;
48 * destroy all entries associated with this peer.
48 * 49 *
49 * @param cp connected peer 50 * @param cp connected peer
50 */ 51 */
51void 52void
52GSF_plan_notify_new_peer_ (struct GSF_ConnectedPeer *cp); 53GSF_plan_notify_peer_disconnect_ (struct GSF_ConnectedPeer *cp);
53 54
54 55
55/** 56/**
56 * Notify the plan about a peer being no longer available. 57 * Notify the plan about a request being done;
58 * destroy all entries associated with this request.
57 * 59 *
58 * @param cp connected peer 60 * @param pr request that is done
59 */ 61 */
60void 62void
61GSF_plan_notify_peer_disconnect_ (struct GSF_ConnectedPeer *cp); 63GSF_plan_notify_request_done_ (struct GSF_PendingRequest *pr);
62
63 64
64 65
65/** 66/**
66 * Get the first plan entry for the given connected peer. 67 * Get the lowest-weight entry for the respective peer
67 * FIXME... 68 * from the plan. Removes the entry from the plan's queue.
68 * 69 *
69 * @param cp connected peer 70 * @param cp connected peer to query for the next request
70 * @return NULL if there is no request planned for this peer 71 * @return NULL if the queue for this peer is empty
71 */ 72 */
72struct GSF_PendingRequest * 73struct GSF_PendingRequest *
73GSF_plan_get_ (struct GSF_ConnectedPeer *cp); 74GSF_plan_get_ (struct GSF_ConnectedPeer *cp);
74 75
75 76
77/**
78 * Get the size of the request queue for the given peer.
79 *
80 * @param cp connected peer to query
81 * @return number of entries in this peer's request queue
82 */
83unsigned int
84GSF_plan_size_ (struct GSF_ConnectedPeer *cp);
76 85
77#endif 86#endif
78/* end of gnunet-service-fs_pe.h */ 87/* end of gnunet-service-fs_pe.h */