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 5
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}
44 * ATS network types as string array initializer
46 #define GNUNET_ATS_NetworkTypeString {"UNSPECIFIED", "LOOPBACK", "LAN", "WAN", "WLAN"}
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,
58 * Default bandwidth assigned to a network : 64 KB/s
60 #define GNUNET_ATS_DefaultBandwidth 65536
64 * Textual equivalent for GNUNET_ATS_MaxBandwidth
66 #define GNUNET_ATS_MaxBandwidthString "unlimited"
69 * Maximum bandwidth assigned to a network : 4095 MB/s
71 #define GNUNET_ATS_MaxBandwidth UINT32_MAX
74 * Number of property types supported by ATS
76 #define GNUNET_ATS_PropertyCount 9
79 * ATS properties types as string array initializer
81 #define GNUNET_ATS_PropertyStrings {"Terminator", "Utilization up", "Utilization down", "Network type", "Delay", "Distance", "Cost WAN", "Cost LAN", "Cost WLAN"}
84 * Enum defining all known property types for ATS Enum values are used
85 * in the GNUNET_ATS_Information struct as
88 * Cost are always stored in uint32_t, so all units used to define costs
89 * have to be normalized to fit in uint32_t [0 .. 4.294.967.295]
91 enum GNUNET_ATS_Property
98 GNUNET_ATS_ARRAY_TERMINATOR = 0,
101 * Actual traffic on this connection from the other peer to this peer.
103 * Unit: [bytes/second]
105 GNUNET_ATS_UTILIZATION_UP,
108 * Actual traffic on this connection from this peer to the other peer.
110 * Unit: [bytes/second]
112 GNUNET_ATS_UTILIZATION_DOWN,
115 * Is this address located in WAN, LAN or a loopback address
116 * Value is element of GNUNET_ATS_Network_Type
118 GNUNET_ATS_NETWORK_TYPE,
122 * Time between when the time packet is sent and the packet arrives
132 GNUNET_ATS_QUALITY_NET_DELAY,
135 * Distance on network layer (required for distance-vector routing).
139 GNUNET_ATS_QUALITY_NET_DISTANCE,
142 * Network overhead on WAN (Wide-Area Network)
144 * How many bytes are sent on the WAN when 1 kilobyte (1024 bytes)
145 * of application data is transmitted?
146 * A factor used with connect cost, bandwidth cost and energy cost
147 * to describe the overhead produced by the transport protocol
151 * Interpretation: less is better
155 * TCP/IPv4 over Ethernet: 1024 + 38 + 20 + 20 = 1102 [bytes/kb]
156 * TCP/IPv6 over Ethernet: 1024 + 38 + 20 + 40 = 1122 [bytes/kb]
157 * UDP/IPv4 over Ethernet: 1024 + 38 + 20 + 8 = 1090 [bytes/kb]
158 * UDP/IPv6 over Ethernet: 1024 + 38 + 40 + 8 = 1110 [bytes/kb]
163 * Network overhead on LAN (Local-Area Network)
165 * How many bytes are sent on the LAN when 1 kilobyte (1024 bytes)
166 * of application data is transmitted?
167 * A factor used with connect cost, bandwidth cost and energy cost
168 * to describe the overhead produced by the transport protocol
172 * Interpretation: less is better
176 * TCP/IPv4 over Ethernet: 1024 + 38 + 20 + 20 = 1102 [bytes/kb]
177 * TCP/IPv6 over Ethernet: 1024 + 38 + 20 + 40 = 1122 [bytes/kb]
178 * UDP/IPv4 over Ethernet: 1024 + 38 + 20 + 8 = 1090 [bytes/kb]
179 * UDP/IPv6 over Ethernet: 1024 + 38 + 40 + 8 = 1110 [bytes/kb]
184 * Network overhead on WLAN (Wireless Local Area Network)
186 * How many bytes are sent on the LAN when 1 kilobyte (1024 bytes)
187 * of application data is transmitted?
188 * A factor used with connect cost, bandwidth cost and energy cost
189 * to describe the overhead produced by the transport protocol
193 * Interpretation: less is better
197 * TCP/IPv4 over Ethernet: 1024 + 38 + 20 + 20 = 1102 [bytes/kb]
198 * TCP/IPv6 over Ethernet: 1024 + 38 + 20 + 40 = 1122 [bytes/kb]
199 * UDP/IPv4 over Ethernet: 1024 + 38 + 20 + 8 = 1090 [bytes/kb]
200 * UDP/IPv6 over Ethernet: 1024 + 38 + 40 + 8 = 1110 [bytes/kb]
203 /* Cost related values */
204 /* =================== */
206 * Volume based cost in financial units to transmit data
208 * Note: This value is not bound to a specific currency or unit and only
210 * "cent" just refers the smallest amount of money in the respective
215 * Interpretation: less is better
221 // GNUNET_ATS_COST_FINANCIAL_PER_VOLUME = 1,
223 * Time based cost in financial units to transmit data
225 * Note: This value is not bound to a specific currency or unit and only
227 * "cent" just refers the smallest amount of money in the respective
232 * Interpretation: less is better
236 * Dialup: 10 [cent/h]
238 // GNUNET_ATS_COST_FINANCIAL_PER_TIME = 2,
240 * Computational costs
242 * Effort of preparing data to be sent with this transport
243 * Includes encoding, encryption and conversion of data
244 * Partial values can be summed up: c_sum = c_enc + c_enc + c_conv
245 * Resulting values depend on local system properties, e.g. CPU
249 * Interpretation: less is better
253 * HTTPS with AES CBC-256: 7,382
254 * HTTPS with AES CBC-128: 5,279
255 * HTTPS with RC4-1024: 2,652
257 // GNUNET_ATS_COST_COMPUTATIONAL = 3,
261 * Energy consumption using this transport when sending with a certain
262 * power at a certain bitrate. This is only an approximation based on:
263 * Energy consumption E = P / D
266 * Power P in Watt (J/s)
267 * Datarate D in MBit/s
269 * Conversion between power P and dBm used by WLAN in radiotap's dBm TX power:
271 * Lp(dbm) = 10 log10 (P/ 1mW)
273 * => P = 1 mW * 10^(Lp(dbm)/10)
277 * Interpretation: less is better
282 * WLAN: 89 (600 mW @ 802.11g /w 54 MBit/s)
283 * Bluetooth: 267 (100 mW @ BT2.0 EDR /w 3 MBit/s)
285 // GNUNET_ATS_COST_ENERGY_CONSUMPTION = 4,
288 * How many bytes are transmitted to initiate a new connection using
293 * Interpretation: less is better
297 * UDP (No connection) :
299 * TCP (TCP 3-Way handshake):
300 * 220 bytes Ethernet, 172 bytes TCP/IP, 122 bytes TCP
301 * HTTP (TCP + Header) :
302 * 477 bytes Ethernet, 429 bytes TCP/IP, 374 bytes TCP, 278 bytes HTTP
303 * HTTPS HTTP+TLS Handshake:
304 * 2129 bytes Ethernet, 1975 bytes TCP/IP, 1755 bytes TCP, 1403 bytes HTTPS
307 // GNUNET_ATS_COST_CONNECT = 5,
311 * How many bandwidth is available to consume?
312 * Used to calculate which impact sending data with this transport has
316 * Interpretation: more is better
319 * LAN: 12,800 (100 MBit/s)
320 * WLAN: 6,912 (54 MBit/s)
321 * Dial-up: 8 (64 Kbit/s)
324 // GNUNET_ATS_COST_BANDWITH_AVAILABLE = 6,
328 * How many bytes are sent over the wire when 1 kilobyte (1024 bytes)
329 * of application data is transmitted?
330 * A factor used with connect cost, bandwidth cost and energy cost
331 * to describe the overhead produced by the transport protocol
335 * Interpretation: less is better
339 * TCP/IPv4 over Ethernet: 1024 + 38 + 20 + 20 = 1102 [bytes/kb]
340 * TCP/IPv6 over Ethernet: 1024 + 38 + 20 + 40 = 1122 [bytes/kb]
341 * UDP/IPv4 over Ethernet: 1024 + 38 + 20 + 8 = 1090 [bytes/kb]
342 * UDP/IPv6 over Ethernet: 1024 + 38 + 40 + 8 = 1110 [bytes/kb]
344 // GNUNET_ATS_COST_NETWORK_OVERHEAD = 7,
345 /* Quality related values */
346 /* ====================== */
347 /* Physical layer quality properties */
349 * Signal strength on physical layer
353 // GNUNET_ATS_QUALITY_PHY_SIGNAL_STRENGTH = 1025,
355 * Collision rate on physical layer
359 // GNUNET_ATS_QUALITY_PHY_COLLISION_RATE = 1026,
361 * Error rate on physical layer
365 // GNUNET_ATS_QUALITY_PHY_ERROR_RATE = 1027,
368 * Time variations of the delay
369 * 1st derivative of a delay function
373 // GNUNET_ATS_QUALITY_NET_JITTER = 1029,
375 * Error rate on network layer
384 * Note: This numbers are just assumptions as an example, not
385 * measured or somehow determined
387 // GNUNET_ATS_QUALITY_NET_ERRORRATE = 1030,
389 * Drop rate on network layer
390 * Bytes actively dismissed by a network component during transmission
391 * Reasons for dropped data can be full queues, congestion, quota violations...
400 * Note: This numbers are just assumptions as an example, not
401 * measured or somehow determined
403 // GNUNET_ATS_QUALITY_NET_DROPRATE = 1031,
405 * Loss rate on network layer
406 * Bytes lost during transmission
407 * Reasons can be collisions, ...
416 * Note: This numbers are just assumptions as an example, not measured
417 * or somehow determined
419 // GNUNET_ATS_QUALITY_NET_LOSSRATE = 1032,
421 * Throughput on network layer
432 // GNUNET_ATS_QUALITY_NET_THROUGHPUT = 1033,
433 /* Availability related values */
434 /* =========================== */
436 * Is a peer reachable?
438 // GNUNET_ATS_AVAILABILITY_REACHABLE = 2048,
440 * Is there a connection established to a peer using this transport
442 // GNUNET_ATS_AVAILABILITY_CONNECTED = 2049
446 * Number of ATS quality properties
448 #define GNUNET_ATS_QualityPropertiesCount 2
451 * ATS quality properties as array initializer
453 #define GNUNET_ATS_QualityProperties {GNUNET_ATS_QUALITY_NET_DELAY, GNUNET_ATS_QUALITY_NET_DISTANCE}
456 * ATS quality properties as string array initializer
458 #define GNUNET_ATS_QualityPropertiesString {"Delay", "Distance"}
461 GNUNET_NETWORK_STRUCT_BEGIN
464 * struct used to communicate the transport's properties like cost and
465 * quality of service as well as high-level constraints on resource
469 * +-----------+ Constraints | | Plugin properties +---------+
470 * | Highlevel |------------> |ATS| <------------------|Transport|
471 * | Component | ATS struct | | ATS struct | Plugin |
472 * +-----------+ | | +---------+
475 * This structure will be used by transport plugins to communicate
476 * costs to ATS or by higher level components to tell ATS their
477 * constraints. Always a pair of (GNUNET_ATS_Property,
478 * uint32_t value). Value is always uint32_t, so all units used to
479 * define costs have to be normalized to fit uint32_t.
481 struct GNUNET_ATS_Information
484 * ATS property type, in network byte order.
486 uint32_t type GNUNET_PACKED;
489 * ATS property value, in network byte order.
491 uint32_t value GNUNET_PACKED;
493 GNUNET_NETWORK_STRUCT_END
496 /* ******************************** Scheduling API ***************************** */
499 * Handle to the ATS subsystem for bandwidth/transport scheduling information.
501 struct GNUNET_ATS_SchedulingHandle;
504 * Handle for address suggestion requests
507 struct GNUNET_ATS_SuggestHandle;
512 * Opaque session handle, defined by plugins. Contents not known to ATS.
519 * Signature of a function called by ATS with the current bandwidth
520 * and address preferences as determined by ATS.
523 * @param address suggested address (including peer identity of the peer)
524 * @param session session to use
525 * @param bandwidth_out assigned outbound bandwidth for the connection
526 * @param bandwidth_in assigned inbound bandwidth for the connection
527 * @param ats performance data for the address (as far as known)
528 * @param ats_count number of performance records in 'ats'
530 typedef void (*GNUNET_ATS_AddressSuggestionCallback) (void *cls,
532 GNUNET_HELLO_Address *
534 struct Session * session,
536 GNUNET_BANDWIDTH_Value32NBO
539 GNUNET_BANDWIDTH_Value32NBO
542 GNUNET_ATS_Information *
543 ats, uint32_t ats_count);
547 * Initialize the ATS subsystem.
549 * @param cfg configuration to use
550 * @param suggest_cb notification to call whenever the suggestation changed
551 * @param suggest_cb_cls closure for 'suggest_cb'
552 * @return ats context
554 struct GNUNET_ATS_SchedulingHandle *
555 GNUNET_ATS_scheduling_init (const struct GNUNET_CONFIGURATION_Handle *cfg,
556 GNUNET_ATS_AddressSuggestionCallback suggest_cb,
557 void *suggest_cb_cls);
561 * Client is done with ATS scheduling, release resources.
563 * @param sh handle to release
566 GNUNET_ATS_scheduling_done (struct GNUNET_ATS_SchedulingHandle *sh);
570 * We would like to reset the address suggestion block time for this
574 * @param peer identity of the peer we want to reset
577 GNUNET_ATS_reset_backoff (struct GNUNET_ATS_SchedulingHandle *sh,
578 const struct GNUNET_PeerIdentity *peer);
581 * We would like to establish a new connection with a peer. ATS
582 * should suggest a good address to begin with.
585 * @param peer identity of the peer we need an address for
586 * @return suggestion handle
588 struct GNUNET_ATS_SuggestHandle *
589 GNUNET_ATS_suggest_address (struct GNUNET_ATS_SchedulingHandle *sh,
590 const struct GNUNET_PeerIdentity *peer);
594 * We want to cancel ATS suggesting addresses for a peer.
597 * @param peer identity of the peer
600 GNUNET_ATS_suggest_address_cancel (struct GNUNET_ATS_SchedulingHandle *sh,
601 const struct GNUNET_PeerIdentity *peer);
605 * Convert a GNUNET_ATS_NetworkType to a string
607 * @param net the network type
608 * @return a string or NULL if invalid
611 GNUNET_ATS_print_network_type (uint32_t net);
614 * Returns where the address is located: LAN or WAN or ...
615 * @param sh the GNUNET_ATS_SchedulingHandle handle
616 * @param addr address
617 * @param addrlen address length
618 * @return location as GNUNET_ATS_Information
620 struct GNUNET_ATS_Information
621 GNUNET_ATS_address_get_type (struct GNUNET_ATS_SchedulingHandle *sh,
622 const struct sockaddr * addr,
626 * We have a new address ATS should know. Addresses have to be added with this
627 * function before they can be: updated, set in use and destroyed
630 * @param address the address
631 * @param session session handle (if available)
632 * @param ats performance data for the address
633 * @param ats_count number of performance records in 'ats'
636 GNUNET_ATS_address_add (struct GNUNET_ATS_SchedulingHandle *sh,
637 const struct GNUNET_HELLO_Address *address,
638 struct Session *session,
639 const struct GNUNET_ATS_Information *ats,
644 * We have updated performance statistics for a given address. Note
645 * that this function can be called for addresses that are currently
646 * in use as well as addresses that are valid but not actively in use.
647 * Furthermore, the peer may not even be connected to us right now (in
648 * which case the call may be ignored or the information may be stored
649 * for later use). Update bandwidth assignments.
652 * @param address updated address
653 * @param session session handle (if available)
654 * @param ats performance data for the address
655 * @param ats_count number of performance records in 'ats'
658 GNUNET_ATS_address_update (struct GNUNET_ATS_SchedulingHandle *sh,
659 const struct GNUNET_HELLO_Address *address,
660 struct Session *session,
661 const struct GNUNET_ATS_Information *ats,
666 * An address is now in use or not used any more.
669 * @param address the address
670 * @param session session handle
671 * @param in_use GNUNET_YES if this address is now used, GNUNET_NO
672 * if address is not used any more
675 GNUNET_ATS_address_in_use (struct GNUNET_ATS_SchedulingHandle *sh,
676 const struct GNUNET_HELLO_Address *address,
677 struct Session *session, int in_use);
681 * A session got destroyed, stop including it as a valid address.
684 * @param address the address
685 * @param session session handle that is no longer valid (if available)
688 GNUNET_ATS_address_destroyed (struct GNUNET_ATS_SchedulingHandle *sh,
689 const struct GNUNET_HELLO_Address *address,
690 struct Session *session);
693 /* ******************************** Performance API ***************************** */
696 * ATS Handle to obtain and/or modify performance information.
698 struct GNUNET_ATS_PerformanceHandle;
701 * Signature of a function that is called with QoS information about an peer.
704 * @param peer the peer
705 * @param ats data for the peer
706 * @param ats_count number of performance records in 'ats'
709 (*GNUNET_ATS_PerformanceMonitorCb) (void *cls,
710 struct GNUNET_PeerIdentity *peer,
711 struct GNUNET_ATS_Information *ats,
716 * Signature of a function that is called with QoS information about an address.
719 * @param address the address
720 * @param bandwidth_out assigned outbound bandwidth for the connection
721 * @param bandwidth_in assigned inbound bandwidth for the connection
722 * @param ats performance data for the address (as far as known)
723 * @param ats_count number of performance records in 'ats'
725 typedef void (*GNUNET_ATS_AddressInformationCallback) (void *cls,
727 GNUNET_HELLO_Address *
730 GNUNET_BANDWIDTH_Value32NBO
733 GNUNET_BANDWIDTH_Value32NBO
736 GNUNET_ATS_Information *
737 ats, uint32_t ats_count);
740 * Handle for an address listing operation
742 struct GNUNET_ATS_AddressListHandle;
746 * Get handle to access performance API of the ATS subsystem.
748 * @param cfg configuration to use
749 * @param infocb function to call on performance changes, can be NULL
750 * @param infocb_cls closure for infocb
751 * @return ats performance context
753 struct GNUNET_ATS_PerformanceHandle *
754 GNUNET_ATS_performance_init (const struct GNUNET_CONFIGURATION_Handle *cfg,
755 GNUNET_ATS_AddressInformationCallback infocb,
760 * Start monitoring performance information
762 * @param ph performance handle to use
763 * @param monitor_cb function to call on performance changes
764 * @param monitor_cb_cls closure for infocb
765 * @return a performance monitor handle
767 struct GNUNET_ATS_PerformanceMonitorHandle *
768 GNUNET_ATS_performance_monitor_start (struct GNUNET_ATS_PerformanceHandle * ph,
769 GNUNET_ATS_PerformanceMonitorCb monitor_cb,
770 void * monitor_cb_cls);
774 * Stop monitoring performance information
776 * @param phm performance monitoring handle to use
779 GNUNET_ATS_performance_monitor_stop (struct GNUNET_ATS_PerformanceMonitorHandle * phm);
784 * Get information about addresses known to the ATS subsystem.
786 * @param handle the performance handle to use
787 * @param peer peer idm can be NULL for all peers
788 * @param all GNUNET_YES to get information about all addresses or GNUNET_NO to
789 * get only address currently used
790 * @param infocb callback to call with the addresses,
791 * will callback with address == NULL when done
792 * @param infocb_cls closure for infocb
793 * @return ats performance context
795 struct GNUNET_ATS_AddressListHandle *
796 GNUNET_ATS_performance_list_addresses (struct GNUNET_ATS_PerformanceHandle *handle,
797 const struct GNUNET_PeerIdentity *peer,
799 GNUNET_ATS_AddressInformationCallback infocb,
804 * Cancel a pending address listing operation
806 * @param handle the GNUNET_ATS_AddressListHandle handle to cancel
809 GNUNET_ATS_performance_list_addresses_cancel (struct GNUNET_ATS_AddressListHandle *handle);
813 * Client is done using the ATS performance subsystem, release resources.
818 GNUNET_ATS_performance_done (struct GNUNET_ATS_PerformanceHandle *ph);
822 * Function called with reservation result.
825 * @param peer identifies the peer
826 * @param amount set to the amount that was actually reserved or unreserved;
827 * either the full requested amount or zero (no partial reservations)
828 * @param res_delay if the reservation could not be satisfied (amount was 0), how
829 * long should the client wait until re-trying?
831 typedef void (*GNUNET_ATS_ReservationCallback) (void *cls,
832 const struct GNUNET_PeerIdentity
833 * peer, int32_t amount,
834 struct GNUNET_TIME_Relative
840 * Context that can be used to cancel a peer information request.
842 struct GNUNET_ATS_ReservationContext;
846 * Reserve inbound bandwidth from the given peer. ATS will look at
847 * the current amount of traffic we receive from the peer and ensure
848 * that the peer could add 'amount' of data to its stream.
850 * @param ph performance handle
851 * @param peer identifies the peer
852 * @param amount reserve N bytes for receiving, negative
853 * amounts can be used to undo a (recent) reservation;
854 * @param rcb function to call with the resulting reservation information
855 * @param rcb_cls closure for info
856 * @return NULL on error
857 * @deprecated will be replaced soon
859 struct GNUNET_ATS_ReservationContext *
860 GNUNET_ATS_reserve_bandwidth (struct GNUNET_ATS_PerformanceHandle *ph,
861 const struct GNUNET_PeerIdentity *peer,
863 GNUNET_ATS_ReservationCallback rcb,
868 * Cancel request for reserving bandwidth.
870 * @param rc context returned by the original GNUNET_ATS_reserve_bandwidth call
873 GNUNET_ATS_reserve_bandwidth_cancel (struct GNUNET_ATS_ReservationContext *rc);
877 * Number of preference types supported by ATS
879 #define GNUNET_ATS_PreferenceCount 3
882 * ATS preference types as array initializer
884 #define GNUNET_ATS_PreferenceType {GNUNET_ATS_PREFERENCE_END, GNUNET_ATS_PREFERENCE_BANDWIDTH, GNUNET_ATS_PREFERENCE_LATENCY}
887 * ATS preference types as string array initializer
889 #define GNUNET_ATS_PreferenceTypeString {"END", "BANDWIDTH", "LATENCY"}
893 * Enum defining all known preference categories.
895 enum GNUNET_ATS_PreferenceKind
899 * End of preference list.
901 GNUNET_ATS_PREFERENCE_END = 0,
904 * Change the peer's bandwidth value (value per byte of bandwidth in
905 * the goal function) to the given amount. The argument is followed
906 * by a double value giving the desired value (can be negative).
907 * Preference changes are forgotten if peers disconnect.
909 GNUNET_ATS_PREFERENCE_BANDWIDTH,
912 * Change the peer's latency value to the given amount. The
913 * argument is followed by a double value giving the desired value
914 * (can be negative). The absolute score in the goal function is
915 * the inverse of the latency in ms (minimum: 1 ms) multiplied by
916 * the latency preferences.
918 GNUNET_ATS_PREFERENCE_LATENCY
922 * Convert a GNUNET_ATS_PreferenceType to a string
924 * @param type the preference type
925 * @return a string or NULL if invalid
928 GNUNET_ATS_print_preference_type (uint32_t type);
931 * Change preferences for the given peer. Preference changes are forgotten if peers
934 * @param ph performance handle
935 * @param peer identifies the peer
936 * @param ... 0-terminated specification of the desired changes
939 GNUNET_ATS_change_preference (struct GNUNET_ATS_PerformanceHandle *ph,
940 const struct GNUNET_PeerIdentity *peer, ...);
945 /* end of file gnunet-service-transport_ats.h */