diff options
author | Christian Grothoff <christian@grothoff.org> | 2011-02-02 15:34:14 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2011-02-02 15:34:14 +0000 |
commit | 07b5d5dad5ba589cde1c97e574de84e5c7d5d696 (patch) | |
tree | 70d5879e2632d98881c22c38ef3e7bdeeafbf71f /src/fs/gnunet-service-fs_cp.h | |
parent | 1240962f4e349aee4e3a57afe293a399d7d316fd (diff) | |
download | gnunet-07b5d5dad5ba589cde1c97e574de84e5c7d5d696.tar.gz gnunet-07b5d5dad5ba589cde1c97e574de84e5c7d5d696.zip |
cleaning
Diffstat (limited to 'src/fs/gnunet-service-fs_cp.h')
-rw-r--r-- | src/fs/gnunet-service-fs_cp.h | 60 |
1 files changed, 34 insertions, 26 deletions
diff --git a/src/fs/gnunet-service-fs_cp.h b/src/fs/gnunet-service-fs_cp.h index 0c3652ae2..8b11dcd5d 100644 --- a/src/fs/gnunet-service-fs_cp.h +++ b/src/fs/gnunet-service-fs_cp.h | |||
@@ -196,15 +196,15 @@ GSF_peer_transmit_cancel_ (struct GSF_PeerTransmitHandle *pth); | |||
196 | /** | 196 | /** |
197 | * Report on receiving a reply; update the performance record of the given peer. | 197 | * Report on receiving a reply; update the performance record of the given peer. |
198 | * | 198 | * |
199 | * @param peer responding peer (will be updated) | 199 | * @param cp responding peer (will be updated) |
200 | * @param request_time time at which the original query was transmitted | 200 | * @param request_time time at which the original query was transmitted |
201 | * @param request_priority priority of the original request | 201 | * @param request_priority priority of the original request |
202 | * @param initiator_client local client on responsible for query (or NULL) | 202 | * @param initiator_client local client on responsible for query (or NULL) |
203 | * @param initiator_peer other peer responsible for query (or NULL) | 203 | * @param initiator_peer other peer responsible for query (or NULL) |
204 | */ | 204 | */ |
205 | void | 205 | void |
206 | GSF_peer_update_performance_ (struct GSF_ConnectedPeer *peer, | 206 | GSF_peer_update_performance_ (struct GSF_ConnectedPeer *cp, |
207 | GNUNET_TIME_Absolute request_time, | 207 | struct GNUNET_TIME_Absolute request_time, |
208 | uint32_t request_priority, | 208 | uint32_t request_priority, |
209 | const struct GSF_LocalClient *initiator_client, | 209 | const struct GSF_LocalClient *initiator_client, |
210 | const struct GSF_ConnectedPeer *initiator_peer); | 210 | const struct GSF_ConnectedPeer *initiator_peer); |
@@ -231,6 +231,24 @@ GSF_peer_status_handler_ (void *cls, | |||
231 | 231 | ||
232 | 232 | ||
233 | /** | 233 | /** |
234 | * Handle P2P "MIGRATION_STOP" message. | ||
235 | * | ||
236 | * @param cls closure, always NULL | ||
237 | * @param other the other peer involved (sender or receiver, NULL | ||
238 | * for loopback messages where we are both sender and receiver) | ||
239 | * @param message the actual message | ||
240 | * @param atsi performance information | ||
241 | * @return GNUNET_OK to keep the connection open, | ||
242 | * GNUNET_SYSERR to close it (signal serious error) | ||
243 | */ | ||
244 | int | ||
245 | GSF_handle_p2p_migration_stop_ (void *cls, | ||
246 | const struct GNUNET_PeerIdentity *other, | ||
247 | const struct GNUNET_MessageHeader *message, | ||
248 | const struct GNUNET_TRANSPORT_ATS_Information *atsi); | ||
249 | |||
250 | |||
251 | /** | ||
234 | * A peer disconnected from us. Tear down the connected peer | 252 | * A peer disconnected from us. Tear down the connected peer |
235 | * record. | 253 | * record. |
236 | * | 254 | * |
@@ -253,38 +271,28 @@ GSF_handle_local_client_disconnect_ (const struct GSF_LocalClient *lc); | |||
253 | 271 | ||
254 | 272 | ||
255 | /** | 273 | /** |
256 | * Iterate over all connected peers. | 274 | * Notify core about a preference we have for the given peer |
275 | * (to allocate more resources towards it). The change will | ||
276 | * be communicated the next time we reserve bandwidth with | ||
277 | * core (not instantly). | ||
257 | * | 278 | * |
258 | * @param it function to call for each peer | 279 | * @param cp peer to reserve bandwidth from |
259 | * @param it_cls closure for it | 280 | * @param pref preference change |
260 | */ | 281 | */ |
261 | void | 282 | void |
262 | GSF_iterate_connected_peers_ (GSF_ConnectedPeerIterator it, | 283 | GSF_connected_peer_change_preference_ (struct GSF_ConnectedPeer *cp, |
263 | void *it_cls); | 284 | uint64_t pref); |
264 | 285 | ||
265 | 286 | ||
266 | // FIXME: should we allow queueing multiple reservation requests? | ||
267 | // FIXME: what about cancellation? | ||
268 | // FIXME: change docu on peer disconnect handling? | ||
269 | /** | 287 | /** |
270 | * Try to reserve bandwidth (to receive data FROM the given peer). | 288 | * Iterate over all connected peers. |
271 | * This function must only be called ONCE per connected peer at a | ||
272 | * time; it can be called again after the 'rc' callback was invoked. | ||
273 | * If the peer disconnects, the request is (silently!) ignored (and | ||
274 | * the requester is responsible to register for notification about the | ||
275 | * peer disconnect if any special action needs to be taken in this | ||
276 | * case). | ||
277 | * | 289 | * |
278 | * @param cp peer to reserve bandwidth from | 290 | * @param it function to call for each peer |
279 | * @param size number of bytes to reserve | 291 | * @param it_cls closure for it |
280 | * @param rc function to call upon reservation success | ||
281 | * @param rc_cls closure for rc | ||
282 | */ | 292 | */ |
283 | void | 293 | void |
284 | GSF_connected_peer_reserve_ (struct GSF_ConnectedPeer *cp, | 294 | GSF_iterate_connected_peers_ (GSF_ConnectedPeerIterator it, |
285 | size_t size, | 295 | void *it_cls); |
286 | GSF_PeerReserveCallback rc, | ||
287 | void *rc_cls); | ||
288 | 296 | ||
289 | 297 | ||
290 | /** | 298 | /** |