From c4e9ba925ffd758aaa3feee2ccfc0b76f26fe207 Mon Sep 17 00:00:00 2001 From: Christian Grothoff Date: Sat, 5 Oct 2019 15:09:28 +0200 Subject: global reindent, now with uncrustify hook enabled --- src/include/gnunet_ats_service.h | 137 ++++++++++++++++++++++----------------- 1 file changed, 77 insertions(+), 60 deletions(-) (limited to 'src/include/gnunet_ats_service.h') diff --git a/src/include/gnunet_ats_service.h b/src/include/gnunet_ats_service.h index a226c7b55..cd1e62bee 100644 --- a/src/include/gnunet_ats_service.h +++ b/src/include/gnunet_ats_service.h @@ -68,7 +68,8 @@ /** * ATS performance characteristics for an address. */ -struct GNUNET_ATS_Properties { +struct GNUNET_ATS_Properties +{ /** * Delay. Time between when the time packet is sent and the packet * arrives. FOREVER if we did not measure yet. @@ -109,7 +110,8 @@ struct GNUNET_ATS_Properties { * ATS performance characteristics for an address in * network byte order (for IPC). */ -struct GNUNET_ATS_PropertiesNBO { +struct GNUNET_ATS_PropertiesNBO +{ /** * Actual traffic on this connection from this peer to the other peer. * Includes transport overhead. @@ -158,8 +160,8 @@ struct GNUNET_ATS_PropertiesNBO { * @param hbo value read */ void -GNUNET_ATS_properties_hton(struct GNUNET_ATS_PropertiesNBO *nbo, - const struct GNUNET_ATS_Properties *hbo); +GNUNET_ATS_properties_hton (struct GNUNET_ATS_PropertiesNBO *nbo, + const struct GNUNET_ATS_Properties *hbo); /** @@ -169,8 +171,8 @@ GNUNET_ATS_properties_hton(struct GNUNET_ATS_PropertiesNBO *nbo, * @param nbo value read */ void -GNUNET_ATS_properties_ntoh(struct GNUNET_ATS_Properties *hbo, - const struct GNUNET_ATS_PropertiesNBO *nbo); +GNUNET_ATS_properties_ntoh (struct GNUNET_ATS_Properties *hbo, + const struct GNUNET_ATS_PropertiesNBO *nbo); @@ -195,7 +197,7 @@ struct GNUNET_ATS_ConnectivitySuggestHandle; * @return ats connectivity handle, NULL on error */ struct GNUNET_ATS_ConnectivityHandle * -GNUNET_ATS_connectivity_init(const struct GNUNET_CONFIGURATION_Handle *cfg); +GNUNET_ATS_connectivity_init (const struct GNUNET_CONFIGURATION_Handle *cfg); /** @@ -204,7 +206,7 @@ GNUNET_ATS_connectivity_init(const struct GNUNET_CONFIGURATION_Handle *cfg); * @param ch handle to destroy */ void -GNUNET_ATS_connectivity_done(struct GNUNET_ATS_ConnectivityHandle *ch); +GNUNET_ATS_connectivity_done (struct GNUNET_ATS_ConnectivityHandle *ch); /** @@ -217,9 +219,9 @@ GNUNET_ATS_connectivity_done(struct GNUNET_ATS_ConnectivityHandle *ch); * @return suggestion handle, NULL if request is already pending */ struct GNUNET_ATS_ConnectivitySuggestHandle * -GNUNET_ATS_connectivity_suggest(struct GNUNET_ATS_ConnectivityHandle *ch, - const struct GNUNET_PeerIdentity *peer, - uint32_t strength); +GNUNET_ATS_connectivity_suggest (struct GNUNET_ATS_ConnectivityHandle *ch, + const struct GNUNET_PeerIdentity *peer, + uint32_t strength); /** @@ -228,7 +230,8 @@ GNUNET_ATS_connectivity_suggest(struct GNUNET_ATS_ConnectivityHandle *ch, * @param sh handle */ void -GNUNET_ATS_connectivity_suggest_cancel(struct GNUNET_ATS_ConnectivitySuggestHandle *sh); +GNUNET_ATS_connectivity_suggest_cancel (struct + GNUNET_ATS_ConnectivitySuggestHandle *sh); /* ******************************** Scheduling API ***************************** */ @@ -263,10 +266,13 @@ struct GNUNET_ATS_Session; typedef void (*GNUNET_ATS_AddressSuggestionCallback) (void *cls, const struct GNUNET_PeerIdentity *peer, - const struct GNUNET_HELLO_Address *address, + const struct + GNUNET_HELLO_Address *address, struct GNUNET_ATS_Session *session, - struct GNUNET_BANDWIDTH_Value32NBO bandwidth_out, - struct GNUNET_BANDWIDTH_Value32NBO bandwidth_in); + struct GNUNET_BANDWIDTH_Value32NBO + bandwidth_out, + struct GNUNET_BANDWIDTH_Value32NBO + bandwidth_in); /** @@ -278,9 +284,9 @@ typedef void * @return ats context */ struct GNUNET_ATS_SchedulingHandle * -GNUNET_ATS_scheduling_init(const struct GNUNET_CONFIGURATION_Handle *cfg, - GNUNET_ATS_AddressSuggestionCallback suggest_cb, - void *suggest_cb_cls); +GNUNET_ATS_scheduling_init (const struct GNUNET_CONFIGURATION_Handle *cfg, + GNUNET_ATS_AddressSuggestionCallback suggest_cb, + void *suggest_cb_cls); /** @@ -289,7 +295,7 @@ GNUNET_ATS_scheduling_init(const struct GNUNET_CONFIGURATION_Handle *cfg, * @param sh handle to release */ void -GNUNET_ATS_scheduling_done(struct GNUNET_ATS_SchedulingHandle *sh); +GNUNET_ATS_scheduling_done (struct GNUNET_ATS_SchedulingHandle *sh); /** @@ -311,10 +317,10 @@ struct GNUNET_ATS_AddressRecord; * address is invalid) */ struct GNUNET_ATS_AddressRecord * -GNUNET_ATS_address_add(struct GNUNET_ATS_SchedulingHandle *sh, - const struct GNUNET_HELLO_Address *address, - struct GNUNET_ATS_Session *session, - const struct GNUNET_ATS_Properties *prop); +GNUNET_ATS_address_add (struct GNUNET_ATS_SchedulingHandle *sh, + const struct GNUNET_HELLO_Address *address, + struct GNUNET_ATS_Session *session, + const struct GNUNET_ATS_Properties *prop); /** @@ -324,8 +330,8 @@ GNUNET_ATS_address_add(struct GNUNET_ATS_SchedulingHandle *sh, * @param session session handle */ void -GNUNET_ATS_address_add_session(struct GNUNET_ATS_AddressRecord *ar, - struct GNUNET_ATS_Session *session); +GNUNET_ATS_address_add_session (struct GNUNET_ATS_AddressRecord *ar, + struct GNUNET_ATS_Session *session); /** @@ -341,8 +347,8 @@ GNUNET_ATS_address_add_session(struct GNUNET_ATS_AddressRecord *ar, * use it still to establish a new session */ int -GNUNET_ATS_address_del_session(struct GNUNET_ATS_AddressRecord *ar, - struct GNUNET_ATS_Session *session); +GNUNET_ATS_address_del_session (struct GNUNET_ATS_AddressRecord *ar, + struct GNUNET_ATS_Session *session); /** @@ -359,8 +365,8 @@ GNUNET_ATS_address_del_session(struct GNUNET_ATS_AddressRecord *ar, * @param prop performance data for the address */ void -GNUNET_ATS_address_update(struct GNUNET_ATS_AddressRecord *ar, - const struct GNUNET_ATS_Properties *prop); +GNUNET_ATS_address_update (struct GNUNET_ATS_AddressRecord *ar, + const struct GNUNET_ATS_Properties *prop); /** @@ -370,7 +376,7 @@ GNUNET_ATS_address_update(struct GNUNET_ATS_AddressRecord *ar, * expired and ATS may no longer use it */ void -GNUNET_ATS_address_destroy(struct GNUNET_ATS_AddressRecord *ar); +GNUNET_ATS_address_destroy (struct GNUNET_ATS_AddressRecord *ar); @@ -398,11 +404,15 @@ struct GNUNET_ATS_PerformanceHandle; */ typedef void (*GNUNET_ATS_AddressInformationCallback) (void *cls, - const struct GNUNET_HELLO_Address *address, + const struct + GNUNET_HELLO_Address *address, int address_active, - struct GNUNET_BANDWIDTH_Value32NBO bandwidth_out, - struct GNUNET_BANDWIDTH_Value32NBO bandwidth_in, - const struct GNUNET_ATS_Properties *prop); + struct GNUNET_BANDWIDTH_Value32NBO + bandwidth_out, + struct GNUNET_BANDWIDTH_Value32NBO + bandwidth_in, + const struct + GNUNET_ATS_Properties *prop); /** @@ -421,9 +431,9 @@ struct GNUNET_ATS_AddressListHandle; * @return ats performance context */ struct GNUNET_ATS_PerformanceHandle * -GNUNET_ATS_performance_init(const struct GNUNET_CONFIGURATION_Handle *cfg, - GNUNET_ATS_AddressInformationCallback addr_info_cb, - void *addr_info_cb_cls); +GNUNET_ATS_performance_init (const struct GNUNET_CONFIGURATION_Handle *cfg, + GNUNET_ATS_AddressInformationCallback addr_info_cb, + void *addr_info_cb_cls); /** @@ -439,11 +449,12 @@ GNUNET_ATS_performance_init(const struct GNUNET_CONFIGURATION_Handle *cfg, * @return handle to abort the operation */ struct GNUNET_ATS_AddressListHandle * -GNUNET_ATS_performance_list_addresses(struct GNUNET_ATS_PerformanceHandle *ph, - const struct GNUNET_PeerIdentity *peer, - int all, - GNUNET_ATS_AddressInformationCallback infocb, - void *infocb_cls); +GNUNET_ATS_performance_list_addresses (struct GNUNET_ATS_PerformanceHandle *ph, + const struct GNUNET_PeerIdentity *peer, + int all, + GNUNET_ATS_AddressInformationCallback + infocb, + void *infocb_cls); /** @@ -452,7 +463,8 @@ GNUNET_ATS_performance_list_addresses(struct GNUNET_ATS_PerformanceHandle *ph, * @param alh the `struct GNUNET_ATS_AddressListHandle` handle to cancel */ void -GNUNET_ATS_performance_list_addresses_cancel(struct GNUNET_ATS_AddressListHandle *alh); +GNUNET_ATS_performance_list_addresses_cancel (struct + GNUNET_ATS_AddressListHandle *alh); /** @@ -461,7 +473,7 @@ GNUNET_ATS_performance_list_addresses_cancel(struct GNUNET_ATS_AddressListHandle * @param ph handle */ void -GNUNET_ATS_performance_done(struct GNUNET_ATS_PerformanceHandle *ph); +GNUNET_ATS_performance_done (struct GNUNET_ATS_PerformanceHandle *ph); /** @@ -502,11 +514,11 @@ struct GNUNET_ATS_ReservationContext; * @deprecated will be replaced soon */ struct GNUNET_ATS_ReservationContext * -GNUNET_ATS_reserve_bandwidth(struct GNUNET_ATS_PerformanceHandle *ph, - const struct GNUNET_PeerIdentity *peer, - int32_t amount, - GNUNET_ATS_ReservationCallback rcb, - void *rcb_cls); +GNUNET_ATS_reserve_bandwidth (struct GNUNET_ATS_PerformanceHandle *ph, + const struct GNUNET_PeerIdentity *peer, + int32_t amount, + GNUNET_ATS_ReservationCallback rcb, + void *rcb_cls); /** @@ -515,13 +527,15 @@ GNUNET_ATS_reserve_bandwidth(struct GNUNET_ATS_PerformanceHandle *ph, * @param rc context returned by the original GNUNET_ATS_reserve_bandwidth call */ void -GNUNET_ATS_reserve_bandwidth_cancel(struct GNUNET_ATS_ReservationContext *rc); +GNUNET_ATS_reserve_bandwidth_cancel (struct GNUNET_ATS_ReservationContext *rc); /** * ATS preference types as array initializer */ -#define GNUNET_ATS_PreferenceType { GNUNET_ATS_PREFERENCE_BANDWIDTH, GNUNET_ATS_PREFERENCE_LATENCY, GNUNET_ATS_PREFERENCE_END } +#define GNUNET_ATS_PreferenceType { GNUNET_ATS_PREFERENCE_BANDWIDTH, \ + GNUNET_ATS_PREFERENCE_LATENCY, \ + GNUNET_ATS_PREFERENCE_END } /** * ATS preference types as string array initializer @@ -531,7 +545,8 @@ GNUNET_ATS_reserve_bandwidth_cancel(struct GNUNET_ATS_ReservationContext *rc); /** * Enum defining all known preference categories. */ -enum GNUNET_ATS_PreferenceKind { +enum GNUNET_ATS_PreferenceKind +{ /** * Change the peer's bandwidth value (value per byte of bandwidth in * the goal function) to the given amount. The argument is followed @@ -563,7 +578,7 @@ enum GNUNET_ATS_PreferenceKind { * @return a string or NULL if invalid */ const char * -GNUNET_ATS_print_preference_type(enum GNUNET_ATS_PreferenceKind type); +GNUNET_ATS_print_preference_type (enum GNUNET_ATS_PreferenceKind type); /** @@ -575,9 +590,11 @@ GNUNET_ATS_print_preference_type(enum GNUNET_ATS_PreferenceKind type); * desired changes */ void -GNUNET_ATS_performance_change_preference(struct GNUNET_ATS_PerformanceHandle *ph, - const struct GNUNET_PeerIdentity *peer, - ...); +GNUNET_ATS_performance_change_preference (struct + GNUNET_ATS_PerformanceHandle *ph, + const struct + GNUNET_PeerIdentity *peer, + ...); /** @@ -598,10 +615,10 @@ GNUNET_ATS_performance_change_preference(struct GNUNET_ATS_PerformanceHandle *ph * @param ... #GNUNET_ATS_PREFERENCE_END-terminated specification of the desired changes */ void -GNUNET_ATS_performance_give_feedback(struct GNUNET_ATS_PerformanceHandle *ph, - const struct GNUNET_PeerIdentity *peer, - const struct GNUNET_TIME_Relative scope, - ...); +GNUNET_ATS_performance_give_feedback (struct GNUNET_ATS_PerformanceHandle *ph, + const struct GNUNET_PeerIdentity *peer, + const struct GNUNET_TIME_Relative scope, + ...); #endif -- cgit v1.2.3