automatic transport selection and outbound bandwidth determination More...
Go to the source code of this file.
Data Structures | |
struct | GNUNET_ATS_ReservationContext |
Linked list of pending reservations. More... | |
struct | GNUNET_ATS_AddressListHandle |
Linked list of pending reservations. More... | |
struct | GNUNET_ATS_PerformanceHandle |
ATS Handle to obtain and/or modify performance information. More... | |
Macros | |
#define | LOG(kind, ...) |
Functions | |
static void | reconnect (struct GNUNET_ATS_PerformanceHandle *ph) |
Re-establish the connection to the ATS service. More... | |
static void | reconnect_task (void *cls) |
Re-establish the connection to the ATS service. More... | |
static void | do_reconnect (struct GNUNET_ATS_PerformanceHandle *ph) |
Reconnect to the ATS service, something went wrong. More... | |
static int | check_peer_information (void *cls, const struct PeerInformationMessage *pi) |
We received a peer information message. More... | |
static void | handle_peer_information (void *cls, const struct PeerInformationMessage *pi) |
We received a peer information message. More... | |
static void | handle_reservation_result (void *cls, const struct ReservationResultMessage *rr) |
We received a reservation result message. More... | |
static int | check_address_list (void *cls, const struct PeerInformationMessage *pi) |
We received a PeerInformationMessage. More... | |
static void | handle_address_list (void *cls, const struct PeerInformationMessage *pi) |
We received a GNUNET_MESSAGE_TYPE_ATS_ADDRESSLIST_RESPONSE. More... | |
static void | mq_error_handler (void *cls, enum GNUNET_MQ_Error error) |
Generic error handler, called with the appropriate error code and the same closure specified at the creation of the message queue. More... | |
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) |
Get handle to access performance API of the ATS subsystem. More... | |
void | GNUNET_ATS_performance_done (struct GNUNET_ATS_PerformanceHandle *ph) |
Client is done using the ATS performance subsystem, release resources. More... | |
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) |
Reserve inbound bandwidth from the given peer. More... | |
void | GNUNET_ATS_reserve_bandwidth_cancel (struct GNUNET_ATS_ReservationContext *rc) |
Cancel request for reserving bandwidth. More... | |
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) |
Get information about addresses known to the ATS subsystem. More... | |
void | GNUNET_ATS_performance_list_addresses_cancel (struct GNUNET_ATS_AddressListHandle *alh) |
Cancel a pending address listing operation. More... | |
const char * | GNUNET_ATS_print_preference_type (enum GNUNET_ATS_PreferenceKind type) |
Convert an enum GNUNET_ATS_PreferenceType to a string. More... | |
void | GNUNET_ATS_performance_change_preference (struct GNUNET_ATS_PerformanceHandle *ph, const struct GNUNET_PeerIdentity *peer,...) |
Change preferences for the given peer. More... | |
void | GNUNET_ATS_performance_give_feedback (struct GNUNET_ATS_PerformanceHandle *ph, const struct GNUNET_PeerIdentity *peer, const struct GNUNET_TIME_Relative scope,...) |
Send feedback to ATS on how good a the requirements for a peer and a preference is satisfied by ATS. More... | |
automatic transport selection and outbound bandwidth determination
Definition in file ats_api_performance.c.
#define LOG | ( | kind, | |
... | |||
) |
Definition at line 31 of file ats_api_performance.c.
|
static |
Re-establish the connection to the ATS service.
ph | handle to use to re-connect. |
Definition at line 565 of file ats_api_performance.c.
References GNUNET_ATS_PerformanceHandle::addr_info_cb, GNUNET_ATS_PerformanceHandle::cfg, env, GNUNET_assert, GNUNET_CLIENT_connect(), GNUNET_MESSAGE_TYPE_ATS_ADDRESSLIST_RESPONSE, GNUNET_MESSAGE_TYPE_ATS_PEER_INFORMATION, GNUNET_MESSAGE_TYPE_ATS_RESERVATION_RESULT, GNUNET_MESSAGE_TYPE_ATS_START, GNUNET_MQ_handler_end, GNUNET_MQ_hd_fixed_size, GNUNET_MQ_hd_var_size, GNUNET_MQ_msg, GNUNET_MQ_send(), handlers, init, GNUNET_ATS_PerformanceHandle::mq, mq_error_handler(), ph, START_FLAG_PERFORMANCE_NO_PIC, and START_FLAG_PERFORMANCE_WITH_PIC.
Referenced by GNUNET_ATS_performance_init(), handle_reservation_result(), and reconnect_task().
|
static |
Re-establish the connection to the ATS service.
cls | handle to use to re-connect. |
Definition at line 225 of file ats_api_performance.c.
References ph, reconnect(), and GNUNET_ATS_PerformanceHandle::task.
Referenced by do_reconnect().
|
static |
Reconnect to the ATS service, something went wrong.
ph | handle to reconnect |
Definition at line 240 of file ats_api_performance.c.
References GNUNET_ATS_PerformanceHandle::addr_info_cb, GNUNET_ATS_PerformanceHandle::addr_info_cb_cls, GNUNET_ATS_PerformanceHandle::addresslist_head, GNUNET_ATS_PerformanceHandle::addresslist_tail, alh, GNUNET_ATS_PerformanceHandle::backoff, GNUNET_ATS_AddressListHandle::cb, GNUNET_ATS_AddressListHandle::cb_cls, GNUNET_CONTAINER_DLL_remove, GNUNET_free, GNUNET_MQ_destroy(), GNUNET_NO, GNUNET_SCHEDULER_add_delayed(), GNUNET_TIME_STD_BACKOFF, GNUNET_TIME_UNIT_FOREVER_REL, GNUNET_ATS_PerformanceHandle::mq, ph, GNUNET_ATS_ReservationContext::rcb, GNUNET_ATS_ReservationContext::rcb_cls, reconnect_task(), GNUNET_ATS_PerformanceHandle::reservation_head, GNUNET_ATS_PerformanceHandle::reservation_tail, GNUNET_ATS_PerformanceHandle::task, and GNUNET_BANDWIDTH_Value32NBO::value__.
Referenced by mq_error_handler().
|
static |
We received a peer information message.
Validate and process it.
cls | our context with the callback |
pi | the message |
Definition at line 303 of file ats_api_performance.c.
References GNUNET_break, GNUNET_OK, GNUNET_SYSERR, pi, and plugin_name.
|
static |
We received a peer information message.
Validate and process it.
cls | our context with the callback |
pi | the message |
Definition at line 334 of file ats_api_performance.c.
References GNUNET_ATS_PerformanceHandle::addr_info_cb, GNUNET_ATS_PerformanceHandle::addr_info_cb_cls, address, GNUNET_ATS_properties_ntoh(), consensus-simulation::int, ph, pi, and plugin_name.
|
static |
We received a reservation result message.
Validate and process it.
cls | our context with the callback |
rr | the message |
Definition at line 376 of file ats_api_performance.c.
References ReservationResultMessage::amount, GNUNET_ATS_reserve_bandwidth(), GNUNET_break, GNUNET_CONTAINER_DLL_remove, GNUNET_free, GNUNET_memcmp, GNUNET_TIME_relative_ntoh(), GNUNET_YES, ReservationResultMessage::peer, GNUNET_ATS_ReservationContext::peer, ph, GNUNET_ATS_ReservationContext::rcb, GNUNET_ATS_ReservationContext::rcb_cls, reconnect(), ReservationResultMessage::res_delay, GNUNET_ATS_PerformanceHandle::reservation_head, GNUNET_ATS_PerformanceHandle::reservation_tail, and GNUNET_ATS_ReservationContext::undo.
|
static |
We received a PeerInformationMessage.
Validate it.
cls | our context with the callback |
pi | the message |
Definition at line 429 of file ats_api_performance.c.
References GNUNET_break, GNUNET_OK, GNUNET_SYSERR, pi, and plugin_name.
|
static |
We received a GNUNET_MESSAGE_TYPE_ATS_ADDRESSLIST_RESPONSE.
Process it.
cls | our context with the callback |
pi | the message |
Definition at line 460 of file ats_api_performance.c.
References address, GNUNET_ATS_PerformanceHandle::addresslist_head, GNUNET_ATS_PerformanceHandle::addresslist_tail, alh, GNUNET_ATS_AddressListHandle::all_addresses, GNUNET_ATS_AddressListHandle::cb, GNUNET_ATS_AddressListHandle::cb_cls, GNUNET_ATS_properties_ntoh(), GNUNET_CONTAINER_DLL_remove, GNUNET_ERROR_TYPE_DEBUG, GNUNET_free, GNUNET_i2s(), GNUNET_is_zero, GNUNET_NO, GNUNET_YES, GNUNET_ATS_AddressListHandle::id, id, LOG, GNUNET_ATS_AddressListHandle::next, ph, pi, plugin_name, and GNUNET_BANDWIDTH_Value32NBO::value__.
|
static |
Generic error handler, called with the appropriate error code and the same closure specified at the creation of the message queue.
Not every message queue implementation supports an error handler.
cls | closure with the struct GNUNET_ATS_PerformanceHandle * |
error | error code |
Definition at line 550 of file ats_api_performance.c.
References do_reconnect(), and ph.
Referenced by reconnect().