aboutsummaryrefslogtreecommitdiff
path: root/src/include/gnunet_ats_service.h
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2011-11-04 14:00:32 +0000
committerChristian Grothoff <christian@grothoff.org>2011-11-04 14:00:32 +0000
commit83b19539f4d322b43683f5838b72e9ec2c8e6073 (patch)
treed0ab9329fcbefe360d9d14e2ace21a6b3396dfe9 /src/include/gnunet_ats_service.h
parent28a2eb43281a1f08a67954f07beb9af3a9bc9a35 (diff)
downloadgnunet-83b19539f4d322b43683f5838b72e9ec2c8e6073.tar.gz
gnunet-83b19539f4d322b43683f5838b72e9ec2c8e6073.zip
curly wars / auto-indentation
Diffstat (limited to 'src/include/gnunet_ats_service.h')
-rw-r--r--src/include/gnunet_ats_service.h185
1 files changed, 73 insertions, 112 deletions
diff --git a/src/include/gnunet_ats_service.h b/src/include/gnunet_ats_service.h
index ed5631a33..ac963ce1d 100644
--- a/src/include/gnunet_ats_service.h
+++ b/src/include/gnunet_ats_service.h
@@ -49,14 +49,14 @@ enum GNUNET_ATS_Property
49 49
50 /** 50 /**
51 * Actual traffic on this connection from the other peer to this peer. 51 * Actual traffic on this connection from the other peer to this peer.
52 * 52 *
53 * Unit: [bytes/second] 53 * Unit: [bytes/second]
54 */ 54 */
55 GNUNET_ATS_UTILIZATION_UP, 55 GNUNET_ATS_UTILIZATION_UP,
56 56
57 /** 57 /**
58 * Actual traffic on this connection from this peer to the other peer. 58 * Actual traffic on this connection from this peer to the other peer.
59 * 59 *
60 * Unit: [bytes/second] 60 * Unit: [bytes/second]
61 */ 61 */
62 GNUNET_ATS_UTILIZATION_DOWN, 62 GNUNET_ATS_UTILIZATION_DOWN,
@@ -74,14 +74,14 @@ enum GNUNET_ATS_Property
74 * Dialup: 500 74 * Dialup: 500
75 */ 75 */
76 GNUNET_ATS_QUALITY_NET_DELAY, 76 GNUNET_ATS_QUALITY_NET_DELAY,
77 77
78 /** 78 /**
79 * Distance on network layer (required for distance-vector routing). 79 * Distance on network layer (required for distance-vector routing).
80 * 80 *
81 * Unit: [DV-hops] 81 * Unit: [DV-hops]
82 */ 82 */
83 GNUNET_ATS_QUALITY_NET_DISTANCE, 83 GNUNET_ATS_QUALITY_NET_DISTANCE,
84 84
85 /** 85 /**
86 * Network overhead on WAN (Wide-Area Network) 86 * Network overhead on WAN (Wide-Area Network)
87 * 87 *
@@ -102,7 +102,7 @@ enum GNUNET_ATS_Property
102 * UDP/IPv6 over Ethernet: 1024 + 38 + 40 + 8 = 1110 [bytes/kb] 102 * UDP/IPv6 over Ethernet: 1024 + 38 + 40 + 8 = 1110 [bytes/kb]
103 */ 103 */
104 GNUNET_ATS_COST_WAN, 104 GNUNET_ATS_COST_WAN,
105 105
106 /** 106 /**
107 * Network overhead on LAN (Local-Area Network) 107 * Network overhead on LAN (Local-Area Network)
108 * 108 *
@@ -123,7 +123,7 @@ enum GNUNET_ATS_Property
123 * UDP/IPv6 over Ethernet: 1024 + 38 + 40 + 8 = 1110 [bytes/kb] 123 * UDP/IPv6 over Ethernet: 1024 + 38 + 40 + 8 = 1110 [bytes/kb]
124 */ 124 */
125 GNUNET_ATS_COST_LAN, 125 GNUNET_ATS_COST_LAN,
126 126
127 /** 127 /**
128 * Network overhead on WLAN (Wireless Local Area Network) 128 * Network overhead on WLAN (Wireless Local Area Network)
129 * 129 *
@@ -144,12 +144,8 @@ enum GNUNET_ATS_Property
144 * UDP/IPv6 over Ethernet: 1024 + 38 + 40 + 8 = 1110 [bytes/kb] 144 * UDP/IPv6 over Ethernet: 1024 + 38 + 40 + 8 = 1110 [bytes/kb]
145 */ 145 */
146 GNUNET_ATS_COST_WLAN 146 GNUNET_ATS_COST_WLAN
147 147 /* Cost related values */
148 148 /* =================== */
149
150 /* Cost related values */
151 /* =================== */
152
153 /** 149 /**
154 * Volume based cost in financial units to transmit data 150 * Volume based cost in financial units to transmit data
155 * 151 *
@@ -166,8 +162,7 @@ enum GNUNET_ATS_Property
166 * LAN: 0 [cent/MB] 162 * LAN: 0 [cent/MB]
167 * 2G : 10 [cent/MB] 163 * 2G : 10 [cent/MB]
168 */ 164 */
169 // GNUNET_ATS_COST_FINANCIAL_PER_VOLUME = 1, 165 // GNUNET_ATS_COST_FINANCIAL_PER_VOLUME = 1,
170
171 /** 166 /**
172 * Time based cost in financial units to transmit data 167 * Time based cost in financial units to transmit data
173 * 168 *
@@ -184,8 +179,7 @@ enum GNUNET_ATS_Property
184 * LAN : 0 [cent/h] 179 * LAN : 0 [cent/h]
185 * Dialup: 10 [cent/h] 180 * Dialup: 10 [cent/h]
186 */ 181 */
187 // GNUNET_ATS_COST_FINANCIAL_PER_TIME = 2, 182 // GNUNET_ATS_COST_FINANCIAL_PER_TIME = 2,
188
189 /** 183 /**
190 * Computational costs 184 * Computational costs
191 * 185 *
@@ -204,8 +198,7 @@ enum GNUNET_ATS_Property
204 * HTTPS with AES CBC-128: 5,279 198 * HTTPS with AES CBC-128: 5,279
205 * HTTPS with RC4-1024: 2,652 199 * HTTPS with RC4-1024: 2,652
206 */ 200 */
207 // GNUNET_ATS_COST_COMPUTATIONAL = 3, 201 // GNUNET_ATS_COST_COMPUTATIONAL = 3,
208
209 /** 202 /**
210 * Energy consumption 203 * Energy consumption
211 * 204 *
@@ -233,8 +226,7 @@ enum GNUNET_ATS_Property
233 * WLAN: 89 (600 mW @ 802.11g /w 54 MBit/s) 226 * WLAN: 89 (600 mW @ 802.11g /w 54 MBit/s)
234 * Bluetooth: 267 (100 mW @ BT2.0 EDR /w 3 MBit/s) 227 * Bluetooth: 267 (100 mW @ BT2.0 EDR /w 3 MBit/s)
235 */ 228 */
236 // GNUNET_ATS_COST_ENERGY_CONSUMPTION = 4, 229 // GNUNET_ATS_COST_ENERGY_CONSUMPTION = 4,
237
238 /** 230 /**
239 * Connect cost 231 * Connect cost
240 * How many bytes are transmitted to initiate a new connection using 232 * How many bytes are transmitted to initiate a new connection using
@@ -256,8 +248,7 @@ enum GNUNET_ATS_Property
256 * 2129 bytes Ethernet, 1975 bytes TCP/IP, 1755 bytes TCP, 1403 bytes HTTPS 248 * 2129 bytes Ethernet, 1975 bytes TCP/IP, 1755 bytes TCP, 1403 bytes HTTPS
257 * 249 *
258 * */ 250 * */
259 // GNUNET_ATS_COST_CONNECT = 5, 251 // GNUNET_ATS_COST_CONNECT = 5,
260
261 /** 252 /**
262 * Bandwidth cost 253 * Bandwidth cost
263 * 254 *
@@ -274,8 +265,7 @@ enum GNUNET_ATS_Property
274 * Dial-up: 8 (64 Kbit/s) 265 * Dial-up: 8 (64 Kbit/s)
275 * 266 *
276 */ 267 */
277 // GNUNET_ATS_COST_BANDWITH_AVAILABLE = 6, 268 // GNUNET_ATS_COST_BANDWITH_AVAILABLE = 6,
278
279 /** 269 /**
280 * Network overhead 270 * Network overhead
281 * 271 *
@@ -295,35 +285,28 @@ enum GNUNET_ATS_Property
295 * UDP/IPv4 over Ethernet: 1024 + 38 + 20 + 8 = 1090 [bytes/kb] 285 * UDP/IPv4 over Ethernet: 1024 + 38 + 20 + 8 = 1090 [bytes/kb]
296 * UDP/IPv6 over Ethernet: 1024 + 38 + 40 + 8 = 1110 [bytes/kb] 286 * UDP/IPv6 over Ethernet: 1024 + 38 + 40 + 8 = 1110 [bytes/kb]
297 */ 287 */
298 // GNUNET_ATS_COST_NETWORK_OVERHEAD = 7, 288 // GNUNET_ATS_COST_NETWORK_OVERHEAD = 7,
299 289 /* Quality related values */
300 290 /* ====================== */
301 /* Quality related values */ 291 /* Physical layer quality properties */
302 /* ====================== */
303
304 /* Physical layer quality properties */
305
306 /** 292 /**
307 * Signal strength on physical layer 293 * Signal strength on physical layer
308 * 294 *
309 * Unit: [dBm] 295 * Unit: [dBm]
310 */ 296 */
311 // GNUNET_ATS_QUALITY_PHY_SIGNAL_STRENGTH = 1025, 297 // GNUNET_ATS_QUALITY_PHY_SIGNAL_STRENGTH = 1025,
312
313 /** 298 /**
314 * Collision rate on physical layer 299 * Collision rate on physical layer
315 * 300 *
316 * Unit: [B/s] 301 * Unit: [B/s]
317 */ 302 */
318 // GNUNET_ATS_QUALITY_PHY_COLLISION_RATE = 1026, 303 // GNUNET_ATS_QUALITY_PHY_COLLISION_RATE = 1026,
319
320 /** 304 /**
321 * Error rate on physical layer 305 * Error rate on physical layer
322 * 306 *
323 * Unit: [B/s] 307 * Unit: [B/s]
324 */ 308 */
325 // GNUNET_ATS_QUALITY_PHY_ERROR_RATE = 1027, 309 // GNUNET_ATS_QUALITY_PHY_ERROR_RATE = 1027,
326
327 /** 310 /**
328 * Jitter 311 * Jitter
329 * Time variations of the delay 312 * Time variations of the delay
@@ -331,8 +314,7 @@ enum GNUNET_ATS_Property
331 * 314 *
332 * Unit: [ms] 315 * Unit: [ms]
333 */ 316 */
334 // GNUNET_ATS_QUALITY_NET_JITTER = 1029, 317 // GNUNET_ATS_QUALITY_NET_JITTER = 1029,
335
336 /** 318 /**
337 * Error rate on network layer 319 * Error rate on network layer
338 * 320 *
@@ -346,8 +328,7 @@ enum GNUNET_ATS_Property
346 * Note: This numbers are just assumptions as an example, not 328 * Note: This numbers are just assumptions as an example, not
347 * measured or somehow determined 329 * measured or somehow determined
348 */ 330 */
349 // GNUNET_ATS_QUALITY_NET_ERRORRATE = 1030, 331 // GNUNET_ATS_QUALITY_NET_ERRORRATE = 1030,
350
351 /** 332 /**
352 * Drop rate on network layer 333 * Drop rate on network layer
353 * Bytes actively dismissed by a network component during transmission 334 * Bytes actively dismissed by a network component during transmission
@@ -363,8 +344,7 @@ enum GNUNET_ATS_Property
363 * Note: This numbers are just assumptions as an example, not 344 * Note: This numbers are just assumptions as an example, not
364 * measured or somehow determined 345 * measured or somehow determined
365 */ 346 */
366 // GNUNET_ATS_QUALITY_NET_DROPRATE = 1031, 347 // GNUNET_ATS_QUALITY_NET_DROPRATE = 1031,
367
368 /** 348 /**
369 * Loss rate on network layer 349 * Loss rate on network layer
370 * Bytes lost during transmission 350 * Bytes lost during transmission
@@ -380,8 +360,7 @@ enum GNUNET_ATS_Property
380 * Note: This numbers are just assumptions as an example, not measured 360 * Note: This numbers are just assumptions as an example, not measured
381 * or somehow determined 361 * or somehow determined
382 */ 362 */
383 // GNUNET_ATS_QUALITY_NET_LOSSRATE = 1032, 363 // GNUNET_ATS_QUALITY_NET_LOSSRATE = 1032,
384
385 /** 364 /**
386 * Throughput on network layer 365 * Throughput on network layer
387 * 366 *
@@ -394,21 +373,17 @@ enum GNUNET_ATS_Property
394 * Dialup: 4 373 * Dialup: 4
395 * 374 *
396 */ 375 */
397 // GNUNET_ATS_QUALITY_NET_THROUGHPUT = 1033, 376 // GNUNET_ATS_QUALITY_NET_THROUGHPUT = 1033,
398 377 /* Availability related values */
399 378 /* =========================== */
400 /* Availability related values */
401 /* =========================== */
402
403 /** 379 /**
404 * Is a peer reachable? 380 * Is a peer reachable?
405 */ 381 */
406 // GNUNET_ATS_AVAILABILITY_REACHABLE = 2048, 382 // GNUNET_ATS_AVAILABILITY_REACHABLE = 2048,
407
408 /** 383 /**
409 * Is there a connection established to a peer using this transport 384 * Is there a connection established to a peer using this transport
410 */ 385 */
411 // GNUNET_ATS_AVAILABILITY_CONNECTED = 2049 386 // GNUNET_ATS_AVAILABILITY_CONNECTED = 2049
412}; 387};
413 388
414 389
@@ -461,7 +436,7 @@ struct Session;
461 436
462/** 437/**
463 * Signature of a function called by ATS with the current bandwidth 438 * Signature of a function called by ATS with the current bandwidth
464 * and address preferences as determined by ATS. 439 * and address preferences as determined by ATS.
465 * 440 *
466 * @param cls closure 441 * @param cls closure
467 * @param peer identity of the new peer 442 * @param peer identity of the new peer
@@ -488,10 +463,9 @@ typedef void (*GNUNET_ATS_AddressSuggestionCallback) (void *cls,
488 struct 463 struct
489 GNUNET_BANDWIDTH_Value32NBO 464 GNUNET_BANDWIDTH_Value32NBO
490 bandwidth_in, 465 bandwidth_in,
491 const struct 466 const struct
492 GNUNET_ATS_Information 467 GNUNET_ATS_Information *
493 * ats, 468 ats, uint32_t ats_count);
494 uint32_t ats_count);
495 469
496 470
497/** 471/**
@@ -504,8 +478,8 @@ typedef void (*GNUNET_ATS_AddressSuggestionCallback) (void *cls,
504 */ 478 */
505struct GNUNET_ATS_SchedulingHandle * 479struct GNUNET_ATS_SchedulingHandle *
506GNUNET_ATS_scheduling_init (const struct GNUNET_CONFIGURATION_Handle *cfg, 480GNUNET_ATS_scheduling_init (const struct GNUNET_CONFIGURATION_Handle *cfg,
507 GNUNET_ATS_AddressSuggestionCallback suggest_cb, 481 GNUNET_ATS_AddressSuggestionCallback suggest_cb,
508 void *suggest_cb_cls); 482 void *suggest_cb_cls);
509 483
510 484
511/** 485/**
@@ -549,9 +523,8 @@ GNUNET_ATS_suggest_address (struct GNUNET_ATS_SchedulingHandle *sh,
549void 523void
550GNUNET_ATS_address_update (struct GNUNET_ATS_SchedulingHandle *sh, 524GNUNET_ATS_address_update (struct GNUNET_ATS_SchedulingHandle *sh,
551 const struct GNUNET_PeerIdentity *peer, 525 const struct GNUNET_PeerIdentity *peer,
552 const char *plugin_name, 526 const char *plugin_name, const void *plugin_addr,
553 const void *plugin_addr, size_t plugin_addr_len, 527 size_t plugin_addr_len, struct Session *session,
554 struct Session *session,
555 const struct GNUNET_ATS_Information *ats, 528 const struct GNUNET_ATS_Information *ats,
556 uint32_t ats_count); 529 uint32_t ats_count);
557 530
@@ -570,12 +543,10 @@ GNUNET_ATS_address_update (struct GNUNET_ATS_SchedulingHandle *sh,
570 */ 543 */
571void 544void
572GNUNET_ATS_address_in_use (struct GNUNET_ATS_SchedulingHandle *sh, 545GNUNET_ATS_address_in_use (struct GNUNET_ATS_SchedulingHandle *sh,
573 const struct GNUNET_PeerIdentity *peer, 546 const struct GNUNET_PeerIdentity *peer,
574 const char *plugin_name, 547 const char *plugin_name, const void *plugin_addr,
575 const void *plugin_addr, 548 size_t plugin_addr_len, struct Session *session,
576 size_t plugin_addr_len, 549 int in_use);
577 struct Session *session,
578 int in_use);
579 550
580/** 551/**
581 * A session got destroyed, stop including it as a valid address. 552 * A session got destroyed, stop including it as a valid address.
@@ -590,10 +561,8 @@ GNUNET_ATS_address_in_use (struct GNUNET_ATS_SchedulingHandle *sh,
590void 561void
591GNUNET_ATS_address_destroyed (struct GNUNET_ATS_SchedulingHandle *sh, 562GNUNET_ATS_address_destroyed (struct GNUNET_ATS_SchedulingHandle *sh,
592 const struct GNUNET_PeerIdentity *peer, 563 const struct GNUNET_PeerIdentity *peer,
593 const char *plugin_name, 564 const char *plugin_name, const void *plugin_addr,
594 const void *plugin_addr, 565 size_t plugin_addr_len, struct Session *session);
595 size_t plugin_addr_len,
596 struct Session *session);
597 566
598 567
599/* ******************************** Performance API ***************************** */ 568/* ******************************** Performance API ***************************** */
@@ -618,22 +587,20 @@ struct GNUNET_ATS_PerformanceHandle;
618 * @param ats_count number of performance records in 'ats' 587 * @param ats_count number of performance records in 'ats'
619 */ 588 */
620typedef void (*GNUNET_ATS_PeerInformationCallback) (void *cls, 589typedef void (*GNUNET_ATS_PeerInformationCallback) (void *cls,
621 const struct 590 const struct
622 GNUNET_PeerIdentity * 591 GNUNET_PeerIdentity * peer,
623 peer, 592 const char *plugin_name,
624 const char *plugin_name, 593 const void *plugin_addr,
625 const void *plugin_addr, 594 size_t plugin_addr_len,
626 size_t plugin_addr_len, 595 struct
627 struct 596 GNUNET_BANDWIDTH_Value32NBO
628 GNUNET_BANDWIDTH_Value32NBO 597 bandwidth_out,
629 bandwidth_out, 598 struct
630 struct 599 GNUNET_BANDWIDTH_Value32NBO
631 GNUNET_BANDWIDTH_Value32NBO 600 bandwidth_in,
632 bandwidth_in, 601 const struct
633 const struct 602 GNUNET_ATS_Information *
634 GNUNET_ATS_Information 603 ats, uint32_t ats_count);
635 * ats,
636 uint32_t ats_count);
637 604
638 605
639/** 606/**
@@ -646,8 +613,8 @@ typedef void (*GNUNET_ATS_PeerInformationCallback) (void *cls,
646 */ 613 */
647struct GNUNET_ATS_PerformanceHandle * 614struct GNUNET_ATS_PerformanceHandle *
648GNUNET_ATS_performance_init (const struct GNUNET_CONFIGURATION_Handle *cfg, 615GNUNET_ATS_performance_init (const struct GNUNET_CONFIGURATION_Handle *cfg,
649 GNUNET_ATS_PeerInformationCallback infocb, 616 GNUNET_ATS_PeerInformationCallback infocb,
650 void *infocb_cls); 617 void *infocb_cls);
651 618
652 619
653/** 620/**
@@ -670,13 +637,10 @@ GNUNET_ATS_performance_done (struct GNUNET_ATS_PerformanceHandle *ph);
670 * long should the client wait until re-trying? 637 * long should the client wait until re-trying?
671 */ 638 */
672typedef void (*GNUNET_ATS_ReservationCallback) (void *cls, 639typedef void (*GNUNET_ATS_ReservationCallback) (void *cls,
673 const struct 640 const struct GNUNET_PeerIdentity
674 GNUNET_PeerIdentity * 641 * peer, int32_t amount,
675 peer, 642 struct GNUNET_TIME_Relative
676 int32_t amount, 643 res_delay);
677 struct
678 GNUNET_TIME_Relative
679 res_delay);
680 644
681 645
682 646
@@ -702,10 +666,10 @@ struct GNUNET_ATS_ReservationContext;
702 */ 666 */
703struct GNUNET_ATS_ReservationContext * 667struct GNUNET_ATS_ReservationContext *
704GNUNET_ATS_reserve_bandwidth (struct GNUNET_ATS_PerformanceHandle *ph, 668GNUNET_ATS_reserve_bandwidth (struct GNUNET_ATS_PerformanceHandle *ph,
705 const struct GNUNET_PeerIdentity *peer, 669 const struct GNUNET_PeerIdentity *peer,
706 int32_t amount, 670 int32_t amount,
707 GNUNET_ATS_ReservationCallback rcb, 671 GNUNET_ATS_ReservationCallback rcb,
708 void *rcb_cls); 672 void *rcb_cls);
709 673
710 674
711/** 675/**
@@ -714,8 +678,7 @@ GNUNET_ATS_reserve_bandwidth (struct GNUNET_ATS_PerformanceHandle *ph,
714 * @param rc context returned by the original GNUNET_ATS_reserve_bandwidth call 678 * @param rc context returned by the original GNUNET_ATS_reserve_bandwidth call
715 */ 679 */
716void 680void
717GNUNET_ATS_reserve_bandwidth_cancel (struct 681GNUNET_ATS_reserve_bandwidth_cancel (struct GNUNET_ATS_ReservationContext *rc);
718 GNUNET_ATS_ReservationContext *rc);
719 682
720 683
721 684
@@ -734,7 +697,7 @@ enum GNUNET_ATS_PreferenceKind
734 * Change the peer's bandwidth value (value per byte of bandwidth in 697 * Change the peer's bandwidth value (value per byte of bandwidth in
735 * the goal function) to the given amount. The argument is followed 698 * the goal function) to the given amount. The argument is followed
736 * by a double value giving the desired value (can be negative). 699 * by a double value giving the desired value (can be negative).
737 * Preference changes are forgotten if peers disconnect. 700 * Preference changes are forgotten if peers disconnect.
738 */ 701 */
739 GNUNET_ATS_PREFERENCE_BANDWIDTH, 702 GNUNET_ATS_PREFERENCE_BANDWIDTH,
740 703
@@ -746,22 +709,20 @@ enum GNUNET_ATS_PreferenceKind
746 * the latency preferences. 709 * the latency preferences.
747 */ 710 */
748 GNUNET_ATS_PREFERENCE_LATENCY 711 GNUNET_ATS_PREFERENCE_LATENCY
749
750}; 712};
751 713
752 714
753/** 715/**
754 * Change preferences for the given peer. Preference changes are forgotten if peers 716 * Change preferences for the given peer. Preference changes are forgotten if peers
755 * disconnect. 717 * disconnect.
756 * 718 *
757 * @param ph performance handle 719 * @param ph performance handle
758 * @param peer identifies the peer 720 * @param peer identifies the peer
759 * @param ... 0-terminated specification of the desired changes 721 * @param ... 0-terminated specification of the desired changes
760 */ 722 */
761void 723void
762GNUNET_ATS_change_preference (struct GNUNET_ATS_PerformanceHandle *ph, 724GNUNET_ATS_change_preference (struct GNUNET_ATS_PerformanceHandle *ph,
763 const struct GNUNET_PeerIdentity *peer, 725 const struct GNUNET_PeerIdentity *peer, ...);
764 ...);
765 726
766 727
767 728