ats service, interaction with 'performance' API More...
#include "platform.h"
#include "gnunet-service-ats.h"
#include "gnunet-service-ats_addresses.h"
#include "gnunet-service-ats_performance.h"
#include "ats.h"
Go to the source code of this file.
Functions | |
static void | notify_client (struct GNUNET_SERVICE_Client *client, const struct GNUNET_PeerIdentity *peer, const char *plugin_name, const void *plugin_addr, size_t plugin_addr_len, int active, const struct GNUNET_ATS_Properties *prop, enum GNUNET_HELLO_AddressInfo local_address_info, struct GNUNET_BANDWIDTH_Value32NBO bandwidth_out, struct GNUNET_BANDWIDTH_Value32NBO bandwidth_in) |
Transmit the given performance information to all performance clients. More... | |
void | GAS_performance_notify_all_clients (const struct GNUNET_PeerIdentity *peer, const char *plugin_name, const void *plugin_addr, size_t plugin_addr_len, int active, const struct GNUNET_ATS_Properties *prop, enum GNUNET_HELLO_AddressInfo local_address_info, struct GNUNET_BANDWIDTH_Value32NBO bandwidth_out, struct GNUNET_BANDWIDTH_Value32NBO bandwidth_in) |
Transmit the given performance information to all performance clients. More... | |
static void | peerinfo_it (void *cls, const struct GNUNET_PeerIdentity *id, const char *plugin_name, const void *plugin_addr, size_t plugin_addr_len, int active, const struct GNUNET_ATS_Properties *prop, enum GNUNET_HELLO_AddressInfo local_address_info, struct GNUNET_BANDWIDTH_Value32NBO bandwidth_out, struct GNUNET_BANDWIDTH_Value32NBO bandwidth_in) |
Iterator for called from GAS_addresses_get_peer_info() More... | |
void | GAS_performance_add_client (struct GNUNET_SERVICE_Client *client, enum StartFlag flag) |
Register a new performance client. More... | |
void | GAS_performance_init () |
Initialize performance subsystem. More... | |
void | GAS_performance_done () |
Shutdown performance subsystem. More... | |
Variables | |
static struct GNUNET_NotificationContext * | nc_no_pic |
Context for sending messages to performance clients without PIC. More... | |
static struct GNUNET_NotificationContext * | nc_pic |
Context for sending messages to performance clients with PIC. More... | |
ats service, interaction with 'performance' API
TODO:
struct GNUNET_HELLO_Address
Definition in file gnunet-service-ats_performance.c.
|
static |
Transmit the given performance information to all performance clients.
client | client to send to, NULL for all |
peer | peer for which this is an address suggestion |
plugin_name | 0-termintated string specifying the transport plugin |
plugin_addr | binary address for the plugin to use |
plugin_addr_len | number of bytes in plugin_addr |
active | GNUNET_YES if this address is actively used to maintain a connection to a peer; GNUNET_NO if the address is not actively used; GNUNET_SYSERR if this address is no longer available for ATS |
prop | performance data for the address |
local_address_info | information about the local flags for the address |
bandwidth_out | assigned outbound bandwidth |
bandwidth_in | assigned inbound bandwidth |
Definition at line 66 of file gnunet-service-ats_performance.c.
References PeerInformationMessage::bandwidth_in, PeerInformationMessage::bandwidth_out, buf, env, GNUNET_ALIGN, GNUNET_assert, GNUNET_ATS_properties_hton(), GNUNET_break, GNUNET_MAX_MESSAGE_SIZE, GNUNET_memcpy, GNUNET_MESSAGE_TYPE_ATS_PEER_INFORMATION, GNUNET_MQ_msg_copy(), GNUNET_MQ_send(), GNUNET_notification_context_broadcast(), GNUNET_NT_UNSPECIFIED, GNUNET_SERVICE_client_get_mq(), GNUNET_YES, msg, nc_pic, peer, plugin_name, PeerInformationMessage::plugin_name_length, GNUNET_ATS_Properties::scope, GNUNET_MessageHeader::size, and GNUNET_MessageHeader::type.
Referenced by GAS_performance_notify_all_clients(), and peerinfo_it().
void GAS_performance_notify_all_clients | ( | const struct GNUNET_PeerIdentity * | peer, |
const char * | plugin_name, | ||
const void * | plugin_addr, | ||
size_t | plugin_addr_len, | ||
int | active, | ||
const struct GNUNET_ATS_Properties * | prop, | ||
enum GNUNET_HELLO_AddressInfo | local_address_info, | ||
struct GNUNET_BANDWIDTH_Value32NBO | bandwidth_out, | ||
struct GNUNET_BANDWIDTH_Value32NBO | bandwidth_in | ||
) |
Transmit the given performance information to all performance clients.
peer | peer for which this is an address suggestion |
plugin_name | 0-termintated string specifying the transport plugin |
plugin_addr | binary address for the plugin to use |
plugin_addr_len | number of bytes in plugin_addr |
active | GNUNET_YES if this address is actively used to maintain a connection to a peer; GNUNET_NO if the address is not actively used; GNUNET_SYSERR if this address is no longer available for ATS |
prop | performance data for the address |
local_address_info | information about the local flags for the address |
bandwidth_out | assigned outbound bandwidth |
bandwidth_in | assigned inbound bandwidth |
Definition at line 145 of file gnunet-service-ats_performance.c.
References GNUNET_break, GNUNET_NO, GNUNET_NT_UNSPECIFIED, GNUNET_STATISTICS_update(), GSA_stats, notify_client(), peer, plugin_name, and GNUNET_ATS_Properties::scope.
Referenced by bandwidth_changed_cb(), free_address(), GAS_addresses_add(), and GAS_addresses_update().
|
static |
Iterator for called from GAS_addresses_get_peer_info()
cls | closure with the struct GNUNET_SERVICE_Client * to inform. |
id | the peer id |
plugin_name | plugin name |
plugin_addr | address |
plugin_addr_len | length of plugin_addr |
active | is address actively used |
prop | performance information |
local_address_info | information about the local flags for the address |
bandwidth_out | current outbound bandwidth assigned to address |
bandwidth_in | current inbound bandwidth assigned to address |
Definition at line 192 of file gnunet-service-ats_performance.c.
References GNUNET_break, GNUNET_ERROR_TYPE_DEBUG, GNUNET_i2s(), GNUNET_log, GNUNET_NT_UNSPECIFIED, notify_client(), plugin_name, GNUNET_ATS_Properties::scope, and GNUNET_BANDWIDTH_Value32NBO::value__.
Referenced by GAS_performance_add_client().
void GAS_performance_add_client | ( | struct GNUNET_SERVICE_Client * | client, |
enum StartFlag | flag | ||
) |
Register a new performance client.
client | handle of the new client |
flag | flag specifying the type of the client |
Definition at line 234 of file gnunet-service-ats_performance.c.
References GAS_addresses_get_peer_info(), GNUNET_notification_context_add(), GNUNET_SERVICE_client_get_mq(), mq, nc_no_pic, nc_pic, peerinfo_it(), and START_FLAG_PERFORMANCE_WITH_PIC.
Referenced by handle_ats_start().
void GAS_performance_init | ( | void | ) |
Initialize performance subsystem.
server | handle to our server |
Definition at line 262 of file gnunet-service-ats_performance.c.
References GNUNET_notification_context_create(), nc_no_pic, and nc_pic.
Referenced by run().
void GAS_performance_done | ( | void | ) |
Shutdown performance subsystem.
Definition at line 273 of file gnunet-service-ats_performance.c.
References GNUNET_notification_context_destroy(), nc_no_pic, and nc_pic.
Referenced by cleanup_task().
|
static |
Context for sending messages to performance clients without PIC.
Definition at line 39 of file gnunet-service-ats_performance.c.
Referenced by GAS_performance_add_client(), GAS_performance_done(), and GAS_performance_init().
|
static |
Context for sending messages to performance clients with PIC.
Definition at line 44 of file gnunet-service-ats_performance.c.
Referenced by GAS_performance_add_client(), GAS_performance_done(), GAS_performance_init(), and notify_client().