diff options
author | Christian Grothoff <christian@grothoff.org> | 2015-02-08 15:12:14 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2015-02-08 15:12:14 +0000 |
commit | 73189c33eb0e4c065c2dbd31ced703f48efdee6a (patch) | |
tree | d3761ce5f7a4726d8a258ea486e5074b89d7f5bd /src/ats/ats.h | |
parent | 1d971bac50ceddcd6ea2ff20525013becc1d6170 (diff) | |
download | gnunet-73189c33eb0e4c065c2dbd31ced703f48efdee6a.tar.gz gnunet-73189c33eb0e4c065c2dbd31ced703f48efdee6a.zip |
cleaning up gnunet-service-ats_preferences.c
Diffstat (limited to 'src/ats/ats.h')
-rw-r--r-- | src/ats/ats.h | 88 |
1 files changed, 85 insertions, 3 deletions
diff --git a/src/ats/ats.h b/src/ats/ats.h index 5d0637d0d..d5d5d6c3f 100644 --- a/src/ats/ats.h +++ b/src/ats/ats.h | |||
@@ -281,26 +281,54 @@ struct AddressSuggestionMessage | |||
281 | }; | 281 | }; |
282 | 282 | ||
283 | 283 | ||
284 | 284 | /** | |
285 | 285 | * | |
286 | */ | ||
286 | struct PeerInformationMessage | 287 | struct PeerInformationMessage |
287 | { | 288 | { |
289 | /** | ||
290 | * Type is #GNUNET_MESSAGE_TYPE_ATS_PEER_INFORMATION | ||
291 | */ | ||
288 | struct GNUNET_MessageHeader header; | 292 | struct GNUNET_MessageHeader header; |
289 | 293 | ||
294 | /** | ||
295 | * | ||
296 | */ | ||
290 | uint32_t ats_count GNUNET_PACKED; | 297 | uint32_t ats_count GNUNET_PACKED; |
291 | 298 | ||
299 | /** | ||
300 | * | ||
301 | */ | ||
292 | uint32_t address_active GNUNET_PACKED; | 302 | uint32_t address_active GNUNET_PACKED; |
293 | 303 | ||
304 | /** | ||
305 | * | ||
306 | */ | ||
294 | uint32_t id GNUNET_PACKED; | 307 | uint32_t id GNUNET_PACKED; |
295 | 308 | ||
309 | /** | ||
310 | * | ||
311 | */ | ||
296 | struct GNUNET_PeerIdentity peer; | 312 | struct GNUNET_PeerIdentity peer; |
297 | 313 | ||
314 | /** | ||
315 | * | ||
316 | */ | ||
298 | uint16_t address_length GNUNET_PACKED; | 317 | uint16_t address_length GNUNET_PACKED; |
299 | 318 | ||
319 | /** | ||
320 | * | ||
321 | */ | ||
300 | uint16_t plugin_name_length GNUNET_PACKED; | 322 | uint16_t plugin_name_length GNUNET_PACKED; |
301 | 323 | ||
324 | /** | ||
325 | * | ||
326 | */ | ||
302 | struct GNUNET_BANDWIDTH_Value32NBO bandwidth_out; | 327 | struct GNUNET_BANDWIDTH_Value32NBO bandwidth_out; |
303 | 328 | ||
329 | /** | ||
330 | * | ||
331 | */ | ||
304 | struct GNUNET_BANDWIDTH_Value32NBO bandwidth_in; | 332 | struct GNUNET_BANDWIDTH_Value32NBO bandwidth_in; |
305 | 333 | ||
306 | /* followed by: | 334 | /* followed by: |
@@ -341,44 +369,95 @@ struct AddressListRequestMessage | |||
341 | }; | 369 | }; |
342 | 370 | ||
343 | 371 | ||
372 | /** | ||
373 | * | ||
374 | */ | ||
344 | struct ReservationRequestMessage | 375 | struct ReservationRequestMessage |
345 | { | 376 | { |
377 | /** | ||
378 | * Type is #GNUNET_MESSAGE_TYPE_ATS_RESERVATION_REQUEST | ||
379 | */ | ||
346 | struct GNUNET_MessageHeader header; | 380 | struct GNUNET_MessageHeader header; |
347 | 381 | ||
382 | /** | ||
383 | * | ||
384 | */ | ||
348 | int32_t amount GNUNET_PACKED; | 385 | int32_t amount GNUNET_PACKED; |
349 | 386 | ||
387 | /** | ||
388 | * | ||
389 | */ | ||
350 | struct GNUNET_PeerIdentity peer; | 390 | struct GNUNET_PeerIdentity peer; |
351 | }; | 391 | }; |
352 | 392 | ||
353 | 393 | ||
354 | 394 | /** | |
395 | * | ||
396 | */ | ||
355 | struct ReservationResultMessage | 397 | struct ReservationResultMessage |
356 | { | 398 | { |
399 | /** | ||
400 | * Type is #GNUNET_MESSAGE_TYPE_ATS_RESERVATION_RESULT | ||
401 | */ | ||
357 | struct GNUNET_MessageHeader header; | 402 | struct GNUNET_MessageHeader header; |
358 | 403 | ||
404 | /** | ||
405 | * | ||
406 | */ | ||
359 | int32_t amount GNUNET_PACKED; | 407 | int32_t amount GNUNET_PACKED; |
360 | 408 | ||
409 | /** | ||
410 | * | ||
411 | */ | ||
361 | struct GNUNET_PeerIdentity peer; | 412 | struct GNUNET_PeerIdentity peer; |
362 | 413 | ||
414 | /** | ||
415 | * | ||
416 | */ | ||
363 | struct GNUNET_TIME_RelativeNBO res_delay; | 417 | struct GNUNET_TIME_RelativeNBO res_delay; |
364 | }; | 418 | }; |
365 | 419 | ||
420 | |||
421 | /** | ||
422 | * Variable-size entry in a `struct ChangePreferenceMessage` or | ||
423 | * `struct FeedbackPreferenceMessage`. | ||
424 | */ | ||
366 | struct PreferenceInformation | 425 | struct PreferenceInformation |
367 | { | 426 | { |
368 | 427 | ||
428 | /** | ||
429 | * An `enum GNUNET_ATS_PreferenceKind` in NBO. | ||
430 | */ | ||
369 | uint32_t preference_kind GNUNET_PACKED; | 431 | uint32_t preference_kind GNUNET_PACKED; |
370 | 432 | ||
433 | /** | ||
434 | * Degree of preference (or appreciation) for this @e | ||
435 | * preference_kind being expressed. | ||
436 | */ | ||
371 | float preference_value GNUNET_PACKED; | 437 | float preference_value GNUNET_PACKED; |
372 | 438 | ||
373 | }; | 439 | }; |
374 | 440 | ||
375 | 441 | ||
442 | /** | ||
443 | * Client to ATS: I have a performance preference for a peer. | ||
444 | */ | ||
376 | struct ChangePreferenceMessage | 445 | struct ChangePreferenceMessage |
377 | { | 446 | { |
447 | /** | ||
448 | * Type is #GNUNET_MESSAGE_TYPE_ATS_PREFERENCE_CHANGE. | ||
449 | */ | ||
378 | struct GNUNET_MessageHeader header; | 450 | struct GNUNET_MessageHeader header; |
379 | 451 | ||
452 | /** | ||
453 | * How many `struct PreferenceInformation` entries follow | ||
454 | * this struct? | ||
455 | */ | ||
380 | uint32_t num_preferences GNUNET_PACKED; | 456 | uint32_t num_preferences GNUNET_PACKED; |
381 | 457 | ||
458 | /** | ||
459 | * Which peer is the preference being expressed for? | ||
460 | */ | ||
382 | struct GNUNET_PeerIdentity peer; | 461 | struct GNUNET_PeerIdentity peer; |
383 | 462 | ||
384 | /* followed by 'num_preferences' | 463 | /* followed by 'num_preferences' |
@@ -391,6 +470,9 @@ struct ChangePreferenceMessage | |||
391 | */ | 470 | */ |
392 | struct FeedbackPreferenceMessage | 471 | struct FeedbackPreferenceMessage |
393 | { | 472 | { |
473 | /** | ||
474 | * Type is #GNUNET_MESSAGE_TYPE_ATS_PREFERENCE_FEEDBACK. | ||
475 | */ | ||
394 | struct GNUNET_MessageHeader header; | 476 | struct GNUNET_MessageHeader header; |
395 | 477 | ||
396 | /** | 478 | /** |