diff options
author | Christian Grothoff <christian@grothoff.org> | 2011-08-15 21:46:35 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2011-08-15 21:46:35 +0000 |
commit | 502af2167f7c218366666ca4944bd7cc54b5b19a (patch) | |
tree | a91fec5cc9769d260640bd91c6633cb9cf395524 /src/fs/gnunet-service-fs_cp.h | |
parent | 03af5a603b7cc53432249d5854cd412aa90dde0d (diff) | |
download | gnunet-502af2167f7c218366666ca4944bd7cc54b5b19a.tar.gz gnunet-502af2167f7c218366666ca4944bd7cc54b5b19a.zip |
indentation
Diffstat (limited to 'src/fs/gnunet-service-fs_cp.h')
-rw-r--r-- | src/fs/gnunet-service-fs_cp.h | 112 |
1 files changed, 56 insertions, 56 deletions
diff --git a/src/fs/gnunet-service-fs_cp.h b/src/fs/gnunet-service-fs_cp.h index 2925dd8ae..c9485f23b 100644 --- a/src/fs/gnunet-service-fs_cp.h +++ b/src/fs/gnunet-service-fs_cp.h | |||
@@ -59,7 +59,7 @@ struct GSF_PeerPerformanceData | |||
59 | * getting a reply (only calculated over the requests for | 59 | * getting a reply (only calculated over the requests for |
60 | * which we actually got a reply). Calculated | 60 | * which we actually got a reply). Calculated |
61 | * as a moving average: new_delay = ((n-1)*last_delay+curr_delay) / n | 61 | * as a moving average: new_delay = ((n-1)*last_delay+curr_delay) / n |
62 | */ | 62 | */ |
63 | struct GNUNET_TIME_Relative avg_reply_delay; | 63 | struct GNUNET_TIME_Relative avg_reply_delay; |
64 | 64 | ||
65 | /** | 65 | /** |
@@ -125,10 +125,11 @@ struct GSF_PeerPerformanceData | |||
125 | * @param cp handle to the connected peer record | 125 | * @param cp handle to the connected peer record |
126 | * @param perf peer performance data | 126 | * @param perf peer performance data |
127 | */ | 127 | */ |
128 | typedef void (*GSF_ConnectedPeerIterator)(void *cls, | 128 | typedef void (*GSF_ConnectedPeerIterator) (void *cls, |
129 | const struct GNUNET_PeerIdentity *peer, | 129 | const struct GNUNET_PeerIdentity * |
130 | struct GSF_ConnectedPeer *cp, | 130 | peer, struct GSF_ConnectedPeer * cp, |
131 | const struct GSF_PeerPerformanceData *ppd); | 131 | const struct GSF_PeerPerformanceData |
132 | * ppd); | ||
132 | 133 | ||
133 | 134 | ||
134 | /** | 135 | /** |
@@ -139,9 +140,8 @@ typedef void (*GSF_ConnectedPeerIterator)(void *cls, | |||
139 | * @param buf where to copy the message, NULL on error (peer disconnect) | 140 | * @param buf where to copy the message, NULL on error (peer disconnect) |
140 | * @return number of bytes copied to 'buf', can be 0 (without indicating an error) | 141 | * @return number of bytes copied to 'buf', can be 0 (without indicating an error) |
141 | */ | 142 | */ |
142 | typedef size_t (*GSF_GetMessageCallback)(void *cls, | 143 | typedef size_t (*GSF_GetMessageCallback) (void *cls, |
143 | size_t buf_size, | 144 | size_t buf_size, void *buf); |
144 | void *buf); | ||
145 | 145 | ||
146 | 146 | ||
147 | /** | 147 | /** |
@@ -151,9 +151,9 @@ typedef size_t (*GSF_GetMessageCallback)(void *cls, | |||
151 | * @param cp handle to the connected peer record | 151 | * @param cp handle to the connected peer record |
152 | * @param success GNUNET_YES on success, GNUNET_NO on failure | 152 | * @param success GNUNET_YES on success, GNUNET_NO on failure |
153 | */ | 153 | */ |
154 | typedef void (*GSF_PeerReserveCallback)(void *cls, | 154 | typedef void (*GSF_PeerReserveCallback) (void *cls, |
155 | struct GSF_ConnectedPeer *cp, | 155 | struct GSF_ConnectedPeer * cp, |
156 | int success); | 156 | int success); |
157 | 157 | ||
158 | 158 | ||
159 | /** | 159 | /** |
@@ -170,9 +170,11 @@ struct GSF_PeerTransmitHandle; | |||
170 | * @param atsi performance data for the connection | 170 | * @param atsi performance data for the connection |
171 | * @return handle to connected peer entry | 171 | * @return handle to connected peer entry |
172 | */ | 172 | */ |
173 | struct GSF_ConnectedPeer * | 173 | struct GSF_ConnectedPeer *GSF_peer_connect_handler_ (const struct |
174 | GSF_peer_connect_handler_ (const struct GNUNET_PeerIdentity *peer, | 174 | GNUNET_PeerIdentity *peer, |
175 | const struct GNUNET_TRANSPORT_ATS_Information *atsi); | 175 | const struct |
176 | GNUNET_TRANSPORT_ATS_Information | ||
177 | *atsi); | ||
176 | 178 | ||
177 | 179 | ||
178 | /** | 180 | /** |
@@ -181,8 +183,8 @@ GSF_peer_connect_handler_ (const struct GNUNET_PeerIdentity *peer, | |||
181 | * @param peer peer's identity | 183 | * @param peer peer's identity |
182 | * @return NULL if this peer is not currently connected | 184 | * @return NULL if this peer is not currently connected |
183 | */ | 185 | */ |
184 | struct GSF_ConnectedPeer * | 186 | struct GSF_ConnectedPeer *GSF_peer_get_ (const struct GNUNET_PeerIdentity |
185 | GSF_peer_get_ (const struct GNUNET_PeerIdentity *peer); | 187 | *peer); |
186 | 188 | ||
187 | 189 | ||
188 | /** | 190 | /** |
@@ -199,14 +201,13 @@ GSF_peer_get_ (const struct GNUNET_PeerIdentity *peer); | |||
199 | * @param gmc_cls closure for gmc | 201 | * @param gmc_cls closure for gmc |
200 | * @return handle to cancel request | 202 | * @return handle to cancel request |
201 | */ | 203 | */ |
202 | struct GSF_PeerTransmitHandle * | 204 | struct GSF_PeerTransmitHandle *GSF_peer_transmit_ (struct GSF_ConnectedPeer *cp, |
203 | GSF_peer_transmit_ (struct GSF_ConnectedPeer *cp, | 205 | int is_query, |
204 | int is_query, | 206 | uint32_t priority, |
205 | uint32_t priority, | 207 | struct GNUNET_TIME_Relative |
206 | struct GNUNET_TIME_Relative timeout, | 208 | timeout, size_t size, |
207 | size_t size, | 209 | GSF_GetMessageCallback gmc, |
208 | GSF_GetMessageCallback gmc, | 210 | void *gmc_cls); |
209 | void *gmc_cls); | ||
210 | 211 | ||
211 | 212 | ||
212 | /** | 213 | /** |
@@ -214,8 +215,7 @@ GSF_peer_transmit_ (struct GSF_ConnectedPeer *cp, | |||
214 | * | 215 | * |
215 | * @param pth request to cancel | 216 | * @param pth request to cancel |
216 | */ | 217 | */ |
217 | void | 218 | void GSF_peer_transmit_cancel_ (struct GSF_PeerTransmitHandle *pth); |
218 | GSF_peer_transmit_cancel_ (struct GSF_PeerTransmitHandle *pth); | ||
219 | 219 | ||
220 | 220 | ||
221 | /** | 221 | /** |
@@ -227,8 +227,8 @@ GSF_peer_transmit_cancel_ (struct GSF_PeerTransmitHandle *pth); | |||
227 | */ | 227 | */ |
228 | void | 228 | void |
229 | GSF_peer_update_performance_ (struct GSF_ConnectedPeer *cp, | 229 | GSF_peer_update_performance_ (struct GSF_ConnectedPeer *cp, |
230 | struct GNUNET_TIME_Absolute request_time, | 230 | struct GNUNET_TIME_Absolute request_time, |
231 | uint32_t request_priority); | 231 | uint32_t request_priority); |
232 | 232 | ||
233 | 233 | ||
234 | /** | 234 | /** |
@@ -240,7 +240,7 @@ GSF_peer_update_performance_ (struct GSF_ConnectedPeer *cp, | |||
240 | */ | 240 | */ |
241 | void | 241 | void |
242 | GSF_peer_update_responder_client_ (struct GSF_ConnectedPeer *cp, | 242 | GSF_peer_update_responder_client_ (struct GSF_ConnectedPeer *cp, |
243 | struct GSF_LocalClient *initiator_client); | 243 | struct GSF_LocalClient *initiator_client); |
244 | 244 | ||
245 | 245 | ||
246 | /** | 246 | /** |
@@ -252,7 +252,8 @@ GSF_peer_update_responder_client_ (struct GSF_ConnectedPeer *cp, | |||
252 | */ | 252 | */ |
253 | void | 253 | void |
254 | GSF_peer_update_responder_peer_ (struct GSF_ConnectedPeer *cp, | 254 | GSF_peer_update_responder_peer_ (struct GSF_ConnectedPeer *cp, |
255 | const struct GSF_ConnectedPeer *initiator_peer); | 255 | const struct GSF_ConnectedPeer |
256 | *initiator_peer); | ||
256 | 257 | ||
257 | 258 | ||
258 | /** | 259 | /** |
@@ -268,11 +269,11 @@ GSF_peer_update_responder_peer_ (struct GSF_ConnectedPeer *cp, | |||
268 | */ | 269 | */ |
269 | void | 270 | void |
270 | GSF_peer_status_handler_ (void *cls, | 271 | GSF_peer_status_handler_ (void *cls, |
271 | const struct GNUNET_PeerIdentity *peer, | 272 | const struct GNUNET_PeerIdentity *peer, |
272 | struct GNUNET_BANDWIDTH_Value32NBO bandwidth_in, | 273 | struct GNUNET_BANDWIDTH_Value32NBO bandwidth_in, |
273 | struct GNUNET_BANDWIDTH_Value32NBO bandwidth_out, | 274 | struct GNUNET_BANDWIDTH_Value32NBO bandwidth_out, |
274 | struct GNUNET_TIME_Absolute timeout, | 275 | struct GNUNET_TIME_Absolute timeout, |
275 | const struct GNUNET_TRANSPORT_ATS_Information *atsi); | 276 | const struct GNUNET_TRANSPORT_ATS_Information *atsi); |
276 | 277 | ||
277 | 278 | ||
278 | /** | 279 | /** |
@@ -288,9 +289,10 @@ GSF_peer_status_handler_ (void *cls, | |||
288 | */ | 289 | */ |
289 | int | 290 | int |
290 | GSF_handle_p2p_migration_stop_ (void *cls, | 291 | GSF_handle_p2p_migration_stop_ (void *cls, |
291 | const struct GNUNET_PeerIdentity *other, | 292 | const struct GNUNET_PeerIdentity *other, |
292 | const struct GNUNET_MessageHeader *message, | 293 | const struct GNUNET_MessageHeader *message, |
293 | const struct GNUNET_TRANSPORT_ATS_Information *atsi); | 294 | const struct GNUNET_TRANSPORT_ATS_Information |
295 | *atsi); | ||
294 | 296 | ||
295 | 297 | ||
296 | /** | 298 | /** |
@@ -304,9 +306,11 @@ GSF_handle_p2p_migration_stop_ (void *cls, | |||
304 | * @param message the actual message | 306 | * @param message the actual message |
305 | * @return pending request handle, NULL on error | 307 | * @return pending request handle, NULL on error |
306 | */ | 308 | */ |
307 | struct GSF_PendingRequest * | 309 | struct GSF_PendingRequest *GSF_handle_p2p_query_ (const struct |
308 | GSF_handle_p2p_query_ (const struct GNUNET_PeerIdentity *other, | 310 | GNUNET_PeerIdentity *other, |
309 | const struct GNUNET_MessageHeader *message); | 311 | const struct |
312 | GNUNET_MessageHeader | ||
313 | *message); | ||
310 | 314 | ||
311 | 315 | ||
312 | /** | 316 | /** |
@@ -315,8 +319,9 @@ GSF_handle_p2p_query_ (const struct GNUNET_PeerIdentity *other, | |||
315 | * @param cp peer to query | 319 | * @param cp peer to query |
316 | * @return performance data record for the peer | 320 | * @return performance data record for the peer |
317 | */ | 321 | */ |
318 | struct GSF_PeerPerformanceData * | 322 | struct GSF_PeerPerformanceData *GSF_get_peer_performance_data_ (struct |
319 | GSF_get_peer_performance_data_ (struct GSF_ConnectedPeer *cp); | 323 | GSF_ConnectedPeer |
324 | *cp); | ||
320 | 325 | ||
321 | 326 | ||
322 | /** | 327 | /** |
@@ -328,7 +333,7 @@ GSF_get_peer_performance_data_ (struct GSF_ConnectedPeer *cp); | |||
328 | */ | 333 | */ |
329 | void | 334 | void |
330 | GSF_block_peer_migration_ (struct GSF_ConnectedPeer *cp, | 335 | GSF_block_peer_migration_ (struct GSF_ConnectedPeer *cp, |
331 | struct GNUNET_TIME_Relative block_time); | 336 | struct GNUNET_TIME_Relative block_time); |
332 | 337 | ||
333 | 338 | ||
334 | /** | 339 | /** |
@@ -340,7 +345,7 @@ GSF_block_peer_migration_ (struct GSF_ConnectedPeer *cp, | |||
340 | */ | 345 | */ |
341 | void | 346 | void |
342 | GSF_peer_disconnect_handler_ (void *cls, | 347 | GSF_peer_disconnect_handler_ (void *cls, |
343 | const struct GNUNET_PeerIdentity *peer); | 348 | const struct GNUNET_PeerIdentity *peer); |
344 | 349 | ||
345 | 350 | ||
346 | /** | 351 | /** |
@@ -349,8 +354,7 @@ GSF_peer_disconnect_handler_ (void *cls, | |||
349 | * | 354 | * |
350 | * @param lc handle to the local client (henceforth invalid) | 355 | * @param lc handle to the local client (henceforth invalid) |
351 | */ | 356 | */ |
352 | void | 357 | void GSF_handle_local_client_disconnect_ (const struct GSF_LocalClient *lc); |
353 | GSF_handle_local_client_disconnect_ (const struct GSF_LocalClient *lc); | ||
354 | 358 | ||
355 | 359 | ||
356 | /** | 360 | /** |
@@ -364,7 +368,7 @@ GSF_handle_local_client_disconnect_ (const struct GSF_LocalClient *lc); | |||
364 | */ | 368 | */ |
365 | void | 369 | void |
366 | GSF_connected_peer_change_preference_ (struct GSF_ConnectedPeer *cp, | 370 | GSF_connected_peer_change_preference_ (struct GSF_ConnectedPeer *cp, |
367 | uint64_t pref); | 371 | uint64_t pref); |
368 | 372 | ||
369 | 373 | ||
370 | /** | 374 | /** |
@@ -375,7 +379,7 @@ GSF_connected_peer_change_preference_ (struct GSF_ConnectedPeer *cp, | |||
375 | */ | 379 | */ |
376 | void | 380 | void |
377 | GSF_connected_peer_get_identity_ (const struct GSF_ConnectedPeer *cp, | 381 | GSF_connected_peer_get_identity_ (const struct GSF_ConnectedPeer *cp, |
378 | struct GNUNET_PeerIdentity *id); | 382 | struct GNUNET_PeerIdentity *id); |
379 | 383 | ||
380 | 384 | ||
381 | /** | 385 | /** |
@@ -384,23 +388,19 @@ GSF_connected_peer_get_identity_ (const struct GSF_ConnectedPeer *cp, | |||
384 | * @param it function to call for each peer | 388 | * @param it function to call for each peer |
385 | * @param it_cls closure for it | 389 | * @param it_cls closure for it |
386 | */ | 390 | */ |
387 | void | 391 | void GSF_iterate_connected_peers_ (GSF_ConnectedPeerIterator it, void *it_cls); |
388 | GSF_iterate_connected_peers_ (GSF_ConnectedPeerIterator it, | ||
389 | void *it_cls); | ||
390 | 392 | ||
391 | 393 | ||
392 | /** | 394 | /** |
393 | * Initialize peer management subsystem. | 395 | * Initialize peer management subsystem. |
394 | */ | 396 | */ |
395 | void | 397 | void GSF_connected_peer_init_ (void); |
396 | GSF_connected_peer_init_ (void); | ||
397 | 398 | ||
398 | 399 | ||
399 | /** | 400 | /** |
400 | * Shutdown peer management subsystem. | 401 | * Shutdown peer management subsystem. |
401 | */ | 402 | */ |
402 | void | 403 | void GSF_connected_peer_done_ (void); |
403 | GSF_connected_peer_done_ (void); | ||
404 | 404 | ||
405 | 405 | ||
406 | #endif | 406 | #endif |