2 This file is part of GNUnet.
3 (C) 2010,2011 Christian Grothoff (and other contributing authors)
5 GNUnet is free software; you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published
7 by the Free Software Foundation; either version 3, or (at your
8 option) any later version.
10 GNUnet is distributed in the hope that it will be useful, but
11 WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 General Public License for more details.
15 You should have received a copy of the GNU General Public License
16 along with GNUnet; see the file COPYING. If not, write to the
17 Free Software Foundation, Inc., 59 Temple Place - Suite 330,
18 Boston, MA 02111-1307, USA.
21 * @file include/gnunet_ats_service.h
22 * @brief automatic transport selection and outbound bandwidth determination
23 * @author Christian Grothoff
24 * @author Matthias Wachs
26 #ifndef GNUNET_ATS_SERVICE_H
27 #define GNUNET_ATS_SERVICE_H
29 #include "gnunet_constants.h"
30 #include "gnunet_util_lib.h"
31 #include "gnunet_hello_lib.h"
34 * Number of network types supported by ATS
36 #define GNUNET_ATS_NetworkTypeCount 6
39 * ATS network types as array initializer
41 #define GNUNET_ATS_NetworkType {GNUNET_ATS_NET_UNSPECIFIED, GNUNET_ATS_NET_LOOPBACK, GNUNET_ATS_NET_LAN, GNUNET_ATS_NET_WAN, GNUNET_ATS_NET_WLAN, GNUNET_ATS_NET_BT}
44 * ATS network types as string array initializer
46 #define GNUNET_ATS_NetworkTypeString {"UNSPECIFIED", "LOOPBACK", "LAN", "WAN", "WLAN", "BLUETOOTH"}
48 enum GNUNET_ATS_Network_Type
50 GNUNET_ATS_NET_UNSPECIFIED = 0,
51 GNUNET_ATS_NET_LOOPBACK = 1,
52 GNUNET_ATS_NET_LAN = 2,
53 GNUNET_ATS_NET_WAN = 3,
54 GNUNET_ATS_NET_WLAN = 4,
59 * Default bandwidth assigned to a network : 64 KB/s
61 #define GNUNET_ATS_DefaultBandwidth 65536
64 * Undefined value for a GNUNET_ATS_Property
66 #define GNUNET_ATS_VALUE_UNDEFINED UINT32_MAX
69 * String representation for GNUNET_ATS_VALUE_UNDEFINED
71 #define GNUNET_ATS_VALUE_UNDEFINED_STR "undefined"
74 * Maximum bandwidth assigned to a network : 4095 MB/s
76 #define GNUNET_ATS_MaxBandwidth UINT32_MAX
79 * Textual equivalent for GNUNET_ATS_MaxBandwidth
81 #define GNUNET_ATS_MaxBandwidthString "unlimited"
84 * Number of property types supported by ATS
86 #define GNUNET_ATS_PropertyCount 9
89 * ATS properties types as string array initializer
91 #define GNUNET_ATS_PropertyStrings {"TERMINATOR", "UTILIZATION_UP", "UTILIZATION_DOWN", "NETWORK_TYPE", "DELAY", "DISTANCE", "COST_WAN", "COST_LAN", "COST_WLAN"}
94 * Enum defining all known property types for ATS Enum values are used
95 * in the GNUNET_ATS_Information struct as
98 * Cost are always stored in uint32_t, so all units used to define costs
99 * have to be normalized to fit in uint32_t [0 .. UINT32_MAX-1]
101 * UINT32_MAX is reserved for uninitialized values GNUNET_ATS_VALUE_UNDEFINED
103 enum GNUNET_ATS_Property
110 GNUNET_ATS_ARRAY_TERMINATOR = 0,
113 * Actual traffic on this connection from the other peer to this peer.
115 * Unit: [bytes/second]
117 GNUNET_ATS_UTILIZATION_UP,
120 * Actual traffic on this connection from this peer to the other peer.
122 * Unit: [bytes/second]
124 GNUNET_ATS_UTILIZATION_DOWN,
127 * Is this address located in WAN, LAN or a loopback address
128 * Value is element of GNUNET_ATS_Network_Type
130 GNUNET_ATS_NETWORK_TYPE,
134 * Time between when the time packet is sent and the packet arrives
136 * Unit: [microseconds]
144 GNUNET_ATS_QUALITY_NET_DELAY,
147 * Distance on network layer (required for distance-vector routing).
151 GNUNET_ATS_QUALITY_NET_DISTANCE,
154 * Network overhead on WAN (Wide-Area Network)
156 * How many bytes are sent on the WAN when 1 kilobyte (1024 bytes)
157 * of application data is transmitted?
158 * A factor used with connect cost, bandwidth cost and energy cost
159 * to describe the overhead produced by the transport protocol
163 * Interpretation: less is better
167 * TCP/IPv4 over Ethernet: 1024 + 38 + 20 + 20 = 1102 [bytes/kb]
168 * TCP/IPv6 over Ethernet: 1024 + 38 + 20 + 40 = 1122 [bytes/kb]
169 * UDP/IPv4 over Ethernet: 1024 + 38 + 20 + 8 = 1090 [bytes/kb]
170 * UDP/IPv6 over Ethernet: 1024 + 38 + 40 + 8 = 1110 [bytes/kb]
175 * Network overhead on LAN (Local-Area Network)
177 * How many bytes are sent on the LAN when 1 kilobyte (1024 bytes)
178 * of application data is transmitted?
179 * A factor used with connect cost, bandwidth cost and energy cost
180 * to describe the overhead produced by the transport protocol
184 * Interpretation: less is better
188 * TCP/IPv4 over Ethernet: 1024 + 38 + 20 + 20 = 1102 [bytes/kb]
189 * TCP/IPv6 over Ethernet: 1024 + 38 + 20 + 40 = 1122 [bytes/kb]
190 * UDP/IPv4 over Ethernet: 1024 + 38 + 20 + 8 = 1090 [bytes/kb]
191 * UDP/IPv6 over Ethernet: 1024 + 38 + 40 + 8 = 1110 [bytes/kb]
196 * Network overhead on WLAN (Wireless Local Area Network)
198 * How many bytes are sent on the LAN when 1 kilobyte (1024 bytes)
199 * of application data is transmitted?
200 * A factor used with connect cost, bandwidth cost and energy cost
201 * to describe the overhead produced by the transport protocol
205 * Interpretation: less is better
209 * TCP/IPv4 over Ethernet: 1024 + 38 + 20 + 20 = 1102 [bytes/kb]
210 * TCP/IPv6 over Ethernet: 1024 + 38 + 20 + 40 = 1122 [bytes/kb]
211 * UDP/IPv4 over Ethernet: 1024 + 38 + 20 + 8 = 1090 [bytes/kb]
212 * UDP/IPv6 over Ethernet: 1024 + 38 + 40 + 8 = 1110 [bytes/kb]
215 /* Cost related values */
216 /* =================== */
218 * Volume based cost in financial units to transmit data
220 * Note: This value is not bound to a specific currency or unit and only
222 * "cent" just refers the smallest amount of money in the respective
227 * Interpretation: less is better
233 // GNUNET_ATS_COST_FINANCIAL_PER_VOLUME = 1,
235 * Time based cost in financial units to transmit data
237 * Note: This value is not bound to a specific currency or unit and only
239 * "cent" just refers the smallest amount of money in the respective
244 * Interpretation: less is better
248 * Dialup: 10 [cent/h]
250 // GNUNET_ATS_COST_FINANCIAL_PER_TIME = 2,
252 * Computational costs
254 * Effort of preparing data to be sent with this transport
255 * Includes encoding, encryption and conversion of data
256 * Partial values can be summed up: c_sum = c_enc + c_enc + c_conv
257 * Resulting values depend on local system properties, e.g. CPU
261 * Interpretation: less is better
265 * HTTPS with AES CBC-256: 7,382
266 * HTTPS with AES CBC-128: 5,279
267 * HTTPS with RC4-1024: 2,652
269 // GNUNET_ATS_COST_COMPUTATIONAL = 3,
273 * Energy consumption using this transport when sending with a certain
274 * power at a certain bitrate. This is only an approximation based on:
275 * Energy consumption E = P / D
278 * Power P in Watt (J/s)
279 * Datarate D in MBit/s
281 * Conversion between power P and dBm used by WLAN in radiotap's dBm TX power:
283 * Lp(dbm) = 10 log10 (P/ 1mW)
285 * => P = 1 mW * 10^(Lp(dbm)/10)
289 * Interpretation: less is better
294 * WLAN: 89 (600 mW @ 802.11g /w 54 MBit/s)
295 * Bluetooth: 267 (100 mW @ BT2.0 EDR /w 3 MBit/s)
297 // GNUNET_ATS_COST_ENERGY_CONSUMPTION = 4,
300 * How many bytes are transmitted to initiate a new connection using
305 * Interpretation: less is better
309 * UDP (No connection) :
311 * TCP (TCP 3-Way handshake):
312 * 220 bytes Ethernet, 172 bytes TCP/IP, 122 bytes TCP
313 * HTTP (TCP + Header) :
314 * 477 bytes Ethernet, 429 bytes TCP/IP, 374 bytes TCP, 278 bytes HTTP
315 * HTTPS HTTP+TLS Handshake:
316 * 2129 bytes Ethernet, 1975 bytes TCP/IP, 1755 bytes TCP, 1403 bytes HTTPS
319 // GNUNET_ATS_COST_CONNECT = 5,
323 * How many bandwidth is available to consume?
324 * Used to calculate which impact sending data with this transport has
328 * Interpretation: more is better
331 * LAN: 12,800 (100 MBit/s)
332 * WLAN: 6,912 (54 MBit/s)
333 * Dial-up: 8 (64 Kbit/s)
336 // GNUNET_ATS_COST_BANDWITH_AVAILABLE = 6,
340 * How many bytes are sent over the wire when 1 kilobyte (1024 bytes)
341 * of application data is transmitted?
342 * A factor used with connect cost, bandwidth cost and energy cost
343 * to describe the overhead produced by the transport protocol
347 * Interpretation: less is better
351 * TCP/IPv4 over Ethernet: 1024 + 38 + 20 + 20 = 1102 [bytes/kb]
352 * TCP/IPv6 over Ethernet: 1024 + 38 + 20 + 40 = 1122 [bytes/kb]
353 * UDP/IPv4 over Ethernet: 1024 + 38 + 20 + 8 = 1090 [bytes/kb]
354 * UDP/IPv6 over Ethernet: 1024 + 38 + 40 + 8 = 1110 [bytes/kb]
356 // GNUNET_ATS_COST_NETWORK_OVERHEAD = 7,
357 /* Quality related values */
358 /* ====================== */
359 /* Physical layer quality properties */
361 * Signal strength on physical layer
365 // GNUNET_ATS_QUALITY_PHY_SIGNAL_STRENGTH = 1025,
367 * Collision rate on physical layer
371 // GNUNET_ATS_QUALITY_PHY_COLLISION_RATE = 1026,
373 * Error rate on physical layer
377 // GNUNET_ATS_QUALITY_PHY_ERROR_RATE = 1027,
380 * Time variations of the delay
381 * 1st derivative of a delay function
385 // GNUNET_ATS_QUALITY_NET_JITTER = 1029,
387 * Error rate on network layer
396 * Note: This numbers are just assumptions as an example, not
397 * measured or somehow determined
399 // GNUNET_ATS_QUALITY_NET_ERRORRATE = 1030,
401 * Drop rate on network layer
402 * Bytes actively dismissed by a network component during transmission
403 * Reasons for dropped data can be full queues, congestion, quota violations...
412 * Note: This numbers are just assumptions as an example, not
413 * measured or somehow determined
415 // GNUNET_ATS_QUALITY_NET_DROPRATE = 1031,
417 * Loss rate on network layer
418 * Bytes lost during transmission
419 * Reasons can be collisions, ...
428 * Note: This numbers are just assumptions as an example, not measured
429 * or somehow determined
431 // GNUNET_ATS_QUALITY_NET_LOSSRATE = 1032,
433 * Throughput on network layer
444 // GNUNET_ATS_QUALITY_NET_THROUGHPUT = 1033,
445 /* Availability related values */
446 /* =========================== */
448 * Is a peer reachable?
450 // GNUNET_ATS_AVAILABILITY_REACHABLE = 2048,
452 * Is there a connection established to a peer using this transport
454 // GNUNET_ATS_AVAILABILITY_CONNECTED = 2049
458 * Number of ATS quality properties
460 #define GNUNET_ATS_QualityPropertiesCount 2
463 * ATS quality properties as array initializer
465 #define GNUNET_ATS_QualityProperties {GNUNET_ATS_QUALITY_NET_DELAY, GNUNET_ATS_QUALITY_NET_DISTANCE}
468 * ATS quality properties as string array initializer
470 #define GNUNET_ATS_QualityPropertiesString {"Delay", "Distance"}
473 GNUNET_NETWORK_STRUCT_BEGIN
476 * struct used to communicate the transport's properties like cost and
477 * quality of service as well as high-level constraints on resource
481 * +-----------+ Constraints | | Plugin properties +---------+
482 * | Highlevel |------------> |ATS| <------------------|Transport|
483 * | Component | ATS struct | | ATS struct | Plugin |
484 * +-----------+ | | +---------+
487 * This structure will be used by transport plugins to communicate
488 * costs to ATS or by higher level components to tell ATS their
489 * constraints. Always a pair of (GNUNET_ATS_Property,
490 * uint32_t value). Value is always uint32_t, so all units used to
491 * define costs have to be normalized to fit uint32_t.
493 struct GNUNET_ATS_Information
496 * ATS property type, in network byte order.
498 uint32_t type GNUNET_PACKED;
501 * ATS property value, in network byte order.
503 uint32_t value GNUNET_PACKED;
505 GNUNET_NETWORK_STRUCT_END
508 /* ******************************** Scheduling API ***************************** */
511 * Handle to the ATS subsystem for bandwidth/transport scheduling information.
513 struct GNUNET_ATS_SchedulingHandle;
516 * Handle for address suggestion requests
519 struct GNUNET_ATS_SuggestHandle;
524 * Opaque session handle, defined by plugins. Contents not known to ATS.
531 * Signature of a function called by ATS with the current bandwidth
532 * and address preferences as determined by ATS.
535 * @param address suggested address (including peer identity of the peer)
536 * @param session session to use
537 * @param bandwidth_out assigned outbound bandwidth for the connection
538 * @param bandwidth_in assigned inbound bandwidth for the connection
539 * @param ats performance data for the address (as far as known)
540 * @param ats_count number of performance records in 'ats'
542 typedef void (*GNUNET_ATS_AddressSuggestionCallback) (void *cls,
544 GNUNET_HELLO_Address *
546 struct Session * session,
548 GNUNET_BANDWIDTH_Value32NBO
551 GNUNET_BANDWIDTH_Value32NBO
554 GNUNET_ATS_Information *
555 ats, uint32_t ats_count);
559 * Initialize the ATS subsystem.
561 * @param cfg configuration to use
562 * @param suggest_cb notification to call whenever the suggestation changed
563 * @param suggest_cb_cls closure for 'suggest_cb'
564 * @return ats context
566 struct GNUNET_ATS_SchedulingHandle *
567 GNUNET_ATS_scheduling_init (const struct GNUNET_CONFIGURATION_Handle *cfg,
568 GNUNET_ATS_AddressSuggestionCallback suggest_cb,
569 void *suggest_cb_cls);
573 * Client is done with ATS scheduling, release resources.
575 * @param sh handle to release
578 GNUNET_ATS_scheduling_done (struct GNUNET_ATS_SchedulingHandle *sh);
582 * We would like to reset the address suggestion block time for this
586 * @param peer identity of the peer we want to reset
589 GNUNET_ATS_reset_backoff (struct GNUNET_ATS_SchedulingHandle *sh,
590 const struct GNUNET_PeerIdentity *peer);
593 * We would like to establish a new connection with a peer. ATS
594 * should suggest a good address to begin with.
597 * @param peer identity of the peer we need an address for
598 * @return suggestion handle
600 struct GNUNET_ATS_SuggestHandle *
601 GNUNET_ATS_suggest_address (struct GNUNET_ATS_SchedulingHandle *sh,
602 const struct GNUNET_PeerIdentity *peer);
606 * We want to cancel ATS suggesting addresses for a peer.
609 * @param peer identity of the peer
612 GNUNET_ATS_suggest_address_cancel (struct GNUNET_ATS_SchedulingHandle *sh,
613 const struct GNUNET_PeerIdentity *peer);
616 * Convert a ATS property to a string
618 * @param type the atsi type
619 * @return a string or NULL if invalid
622 GNUNET_ATS_print_property_type (uint32_t type);
626 * Convert a GNUNET_ATS_NetworkType to a string
628 * @param net the network type
629 * @return a string or NULL if invalid
632 GNUNET_ATS_print_network_type (uint32_t net);
635 * Returns where the address is located: LAN or WAN or ...
636 * @param sh the GNUNET_ATS_SchedulingHandle handle
637 * @param addr address
638 * @param addrlen address length
639 * @return location as GNUNET_ATS_Information
641 struct GNUNET_ATS_Information
642 GNUNET_ATS_address_get_type (struct GNUNET_ATS_SchedulingHandle *sh,
643 const struct sockaddr * addr,
647 * Test if a address and a session is known to ATS
649 * @param sh the scheduling handle
650 * @param address the address
651 * @param session the session
652 * @return GNUNET_YES or GNUNET_NO
655 GNUNET_ATS_session_known (struct GNUNET_ATS_SchedulingHandle *sh,
656 const struct GNUNET_HELLO_Address *address,
657 struct Session *session);
660 * We have a new address ATS should know. Addresses have to be added with this
661 * function before they can be: updated, set in use and destroyed
664 * @param address the address
665 * @param session session handle (if available)
666 * @param ats performance data for the address
667 * @param ats_count number of performance records in 'ats'
670 GNUNET_ATS_address_add (struct GNUNET_ATS_SchedulingHandle *sh,
671 const struct GNUNET_HELLO_Address *address,
672 struct Session *session,
673 const struct GNUNET_ATS_Information *ats,
678 * We have updated performance statistics for a given address. Note
679 * that this function can be called for addresses that are currently
680 * in use as well as addresses that are valid but not actively in use.
681 * Furthermore, the peer may not even be connected to us right now (in
682 * which case the call may be ignored or the information may be stored
683 * for later use). Update bandwidth assignments.
686 * @param address updated address
687 * @param session session handle (if available)
688 * @param ats performance data for the address
689 * @param ats_count number of performance records in 'ats'
690 * @return GNUNET_OK or GNUNET_SYSERR
693 GNUNET_ATS_address_update (struct GNUNET_ATS_SchedulingHandle *sh,
694 const struct GNUNET_HELLO_Address *address,
695 struct Session *session,
696 const struct GNUNET_ATS_Information *ats,
701 * An address is now in use or not used any more.
704 * @param address the address
705 * @param session session handle
706 * @param in_use GNUNET_YES if this address is now used, GNUNET_NO
707 * if address is not used any more
710 GNUNET_ATS_address_in_use (struct GNUNET_ATS_SchedulingHandle *sh,
711 const struct GNUNET_HELLO_Address *address,
712 struct Session *session, int in_use);
716 * A session got destroyed, stop including it as a valid address.
719 * @param address the address
720 * @param session session handle that is no longer valid (if available)
723 GNUNET_ATS_address_destroyed (struct GNUNET_ATS_SchedulingHandle *sh,
724 const struct GNUNET_HELLO_Address *address,
725 struct Session *session);
728 /* ******************************** Performance API ***************************** */
731 * ATS Handle to obtain and/or modify performance information.
733 struct GNUNET_ATS_PerformanceHandle;
736 * Signature of a function that is called with QoS information about an address.
739 * @param address the address
740 * @param address_active is this address actively used to maintain a connection
742 * @param bandwidth_out assigned outbound bandwidth for the connection
743 * @param bandwidth_in assigned inbound bandwidth for the connection
744 * @param ats performance data for the address (as far as known)
745 * @param ats_count number of performance records in 'ats'
747 typedef void (*GNUNET_ATS_AddressInformationCallback) (void *cls,
748 const struct GNUNET_HELLO_Address *address,
750 struct GNUNET_BANDWIDTH_Value32NBO bandwidth_out,
751 struct GNUNET_BANDWIDTH_Value32NBO bandwidth_in,
752 const struct GNUNET_ATS_Information *ats,
756 * Handle for an address listing operation
758 struct GNUNET_ATS_AddressListHandle;
762 * Get handle to access performance API of the ATS subsystem.
764 * @param cfg configuration to use
765 * @param addr_info_cb callback called when performance characteristics for
767 * @param addr_info_cb_cls closure for infocb
768 * @return ats performance context
770 struct GNUNET_ATS_PerformanceHandle *
771 GNUNET_ATS_performance_init (const struct GNUNET_CONFIGURATION_Handle *cfg,
772 GNUNET_ATS_AddressInformationCallback addr_info_cb,
773 void *addr_info_cb_cls);
776 * Get information about addresses known to the ATS subsystem.
778 * @param handle the performance handle to use
779 * @param peer peer idm can be NULL for all peers
780 * @param all GNUNET_YES to get information about all addresses or GNUNET_NO to
781 * get only address currently used
782 * @param infocb callback to call with the addresses,
783 * will callback with address == NULL when done
784 * @param infocb_cls closure for infocb
785 * @return ats performance context
787 struct GNUNET_ATS_AddressListHandle *
788 GNUNET_ATS_performance_list_addresses (struct GNUNET_ATS_PerformanceHandle *handle,
789 const struct GNUNET_PeerIdentity *peer,
791 GNUNET_ATS_AddressInformationCallback infocb,
796 * Cancel a pending address listing operation
798 * @param handle the GNUNET_ATS_AddressListHandle handle to cancel
801 GNUNET_ATS_performance_list_addresses_cancel (struct GNUNET_ATS_AddressListHandle *handle);
805 * Client is done using the ATS performance subsystem, release resources.
810 GNUNET_ATS_performance_done (struct GNUNET_ATS_PerformanceHandle *ph);
814 * Function called with reservation result.
817 * @param peer identifies the peer
818 * @param amount set to the amount that was actually reserved or unreserved;
819 * either the full requested amount or zero (no partial reservations)
820 * @param res_delay if the reservation could not be satisfied (amount was 0), how
821 * long should the client wait until re-trying?
823 typedef void (*GNUNET_ATS_ReservationCallback) (void *cls,
824 const struct GNUNET_PeerIdentity
825 * peer, int32_t amount,
826 struct GNUNET_TIME_Relative
832 * Context that can be used to cancel a peer information request.
834 struct GNUNET_ATS_ReservationContext;
838 * Reserve inbound bandwidth from the given peer. ATS will look at
839 * the current amount of traffic we receive from the peer and ensure
840 * that the peer could add 'amount' of data to its stream.
842 * @param ph performance handle
843 * @param peer identifies the peer
844 * @param amount reserve N bytes for receiving, negative
845 * amounts can be used to undo a (recent) reservation;
846 * @param rcb function to call with the resulting reservation information
847 * @param rcb_cls closure for info
848 * @return NULL on error
849 * @deprecated will be replaced soon
851 struct GNUNET_ATS_ReservationContext *
852 GNUNET_ATS_reserve_bandwidth (struct GNUNET_ATS_PerformanceHandle *ph,
853 const struct GNUNET_PeerIdentity *peer,
855 GNUNET_ATS_ReservationCallback rcb,
860 * Cancel request for reserving bandwidth.
862 * @param rc context returned by the original GNUNET_ATS_reserve_bandwidth call
865 GNUNET_ATS_reserve_bandwidth_cancel (struct GNUNET_ATS_ReservationContext *rc);
869 * Number of preference types supported by ATS
871 #define GNUNET_ATS_PreferenceCount 3
874 * ATS preference types as array initializer
876 #define GNUNET_ATS_PreferenceType {GNUNET_ATS_PREFERENCE_END, GNUNET_ATS_PREFERENCE_BANDWIDTH, GNUNET_ATS_PREFERENCE_LATENCY}
879 * ATS preference types as string array initializer
881 #define GNUNET_ATS_PreferenceTypeString {"END", "BANDWIDTH", "LATENCY"}
885 * Enum defining all known preference categories.
887 enum GNUNET_ATS_PreferenceKind
891 * End of preference list.
893 GNUNET_ATS_PREFERENCE_END = 0,
896 * Change the peer's bandwidth value (value per byte of bandwidth in
897 * the goal function) to the given amount. The argument is followed
898 * by a double value giving the desired value (can be negative).
899 * Preference changes are forgotten if peers disconnect.
901 GNUNET_ATS_PREFERENCE_BANDWIDTH,
904 * Change the peer's latency value to the given amount. The
905 * argument is followed by a double value giving the desired value
906 * (can be negative). The absolute score in the goal function is
907 * the inverse of the latency in microseconds (minimum: 1
908 * microsecond) multiplied by the latency preferences.
910 GNUNET_ATS_PREFERENCE_LATENCY
914 * Convert a GNUNET_ATS_PreferenceType to a string
916 * @param type the preference type
917 * @return a string or NULL if invalid
920 GNUNET_ATS_print_preference_type (uint32_t type);
923 * Change preferences for the given peer. Preference changes are forgotten if peers
926 * @param ph performance handle
927 * @param peer identifies the peer
928 * @param ... 0-terminated specification of the desired changes
931 GNUNET_ATS_performance_change_preference (struct GNUNET_ATS_PerformanceHandle *ph,
932 const struct GNUNET_PeerIdentity *peer, ...);
936 * Send feedback to ATS on how good a the requirements for a peer and a
937 * preference is satisfied by ATS
939 * @param ph performance handle
940 * @param scope the time interval this valid for: [now - scope .. now]
941 * @param peer identifies the peer
942 * @param ... 0-terminated specification of the desired changes
945 GNUNET_ATS_performance_give_feedback (struct GNUNET_ATS_PerformanceHandle *ph,
946 const struct GNUNET_PeerIdentity *peer,
947 const struct GNUNET_TIME_Relative scope, ...);
950 /* end of file gnunet-service-transport_ats.h */