GNUnet  0.17.6
gnunet-service-ats_addresses.h
Go to the documentation of this file.
1 /*
2  This file is part of GNUnet.
3  Copyright (C) 2011-2014 GNUnet e.V.
4 
5  GNUnet is free software: you can redistribute it and/or modify it
6  under the terms of the GNU Affero General Public License as published
7  by the Free Software Foundation, either version 3 of the License,
8  or (at your option) any later version.
9 
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  Affero General Public License for more details.
14 
15  You should have received a copy of the GNU Affero General Public License
16  along with this program. If not, see <http://www.gnu.org/licenses/>.
17 
18  SPDX-License-Identifier: AGPL3.0-or-later
19  */
20 
27 #ifndef GNUNET_SERVICE_ATS_ADDRESSES_H
28 #define GNUNET_SERVICE_ATS_ADDRESSES_H
29 
30 #include "gnunet_util_lib.h"
31 #include "gnunet_ats_service.h"
32 #include "gnunet-service-ats.h"
33 #include "ats.h"
34 
221 /*
222  * How long will address suggestions blocked after a suggestion
223  */
224 #define ATS_BLOCKING_DELTA GNUNET_TIME_relative_multiply ( \
225  GNUNET_TIME_UNIT_MILLISECONDS, 100)
226 
231 {
235  unsigned int avg_queue_index;
236 
241 
245  uint64_t avg;
246 
250  double norm;
251 };
252 
253 
258 {
262  struct GNUNET_PeerIdentity peer;
263 
267  const void *addr;
268 
272  char *plugin;
273 
278 
283 
288 
293 
297  size_t addr_len;
298 
302  uint32_t session_id;
303 
308 
312  uint32_t atsi_count;
313 
317  uint32_t assigned_bw_in;
318 
322  uint32_t assigned_bw_out;
323 
328 
333 
337  int active;
338 
343 
348 
353 
358 };
359 
360 
365 
366 
371 void
372 GAS_addresses_init (void);
373 
374 
378 void
379 GAS_addresses_done (void);
380 
381 
393 void
395  const char *plugin_name,
396  const void *plugin_addr,
397  size_t plugin_addr_len,
398  uint32_t local_address_info,
399  uint32_t session_id,
400  const struct GNUNET_ATS_Properties *prop);
401 
402 
410 void
412  uint32_t session_id,
413  const struct GNUNET_ATS_Properties *prop);
414 
415 
422 void
424  uint32_t session_id);
425 
426 
430 void
432 
433 
448 typedef void
449 (*GNUNET_ATS_PeerInfo_Iterator) (void *cls,
450  const struct GNUNET_PeerIdentity *id,
451  const char *plugin_name,
452  const void *plugin_addr,
453  size_t plugin_addr_len,
454  const int address_active,
455  const struct GNUNET_ATS_Properties *prop,
457  local_address_info,
459  bandwidth_out,
461  bandwidth_in);
462 
463 
471 void
474  void *pi_it_cls);
475 
476 
483 void
485  const struct AddressListRequestMessage *alrm);
486 
487 
488 #endif
489 
490 /* end of gnunet-service-ats_addresses.h */
automatic transport selection messages
static struct GNUNET_HashCode session_id
static struct GNUNET_IDENTITY_Handle * id
Handle to identity service.
#define GAS_normalization_queue_length
void GAS_addresses_init(void)
Initialize address subsystem.
void GAS_addresses_destroy(const struct GNUNET_PeerIdentity *peer, uint32_t session_id)
Remove an address for a peer.
void GAS_addresses_done(void)
Shutdown address subsystem.
void GAS_addresses_get_peer_info(const struct GNUNET_PeerIdentity *peer, GNUNET_ATS_PeerInfo_Iterator pi_it, void *pi_it_cls)
Return information all peers currently known to ATS.
struct GNUNET_CONTAINER_MultiPeerMap * GSA_addresses
A multipeermap mapping peer identities to struct ATS_Address.
void GAS_addresses_update(const struct GNUNET_PeerIdentity *peer, uint32_t session_id, const struct GNUNET_ATS_Properties *prop)
Update an address with new performance information for a peer.
void(* GNUNET_ATS_PeerInfo_Iterator)(void *cls, const struct GNUNET_PeerIdentity *id, const char *plugin_name, const void *plugin_addr, size_t plugin_addr_len, const int address_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 GAS_addresses_get_peer_info()
void GAS_addresses_add(const struct GNUNET_PeerIdentity *peer, const char *plugin_name, const void *plugin_addr, size_t plugin_addr_len, uint32_t local_address_info, uint32_t session_id, const struct GNUNET_ATS_Properties *prop)
Add a new address for a peer.
void GAS_handle_request_address_list(struct GNUNET_SERVICE_Client *client, const struct AddressListRequestMessage *alrm)
Handle 'address list request' messages from clients.
void GAS_addresses_destroy_all(void)
Remove all addresses.
static char * plugin_name
Name of our plugin.
Automatic transport selection and outbound bandwidth determination.
GNUNET_HELLO_AddressInfo
Additional local information about an address.
Address with additional information.
struct GAS_NormalizationInfo norm_delay
Normalized delay information for this address.
uint32_t assigned_bw_in
Inbound bandwidth assigned by solver.
char * plugin
Plugin name.
uint32_t last_notified_bw_in
Inbound bandwidth assigned by solver in NBO.
struct GNUNET_PeerIdentity peer
Peer ID this address is for.
int active
Is this the active address for this peer?
enum GNUNET_HELLO_AddressInfo local_address_info
Field to store local flags.
void * solver_information
Solver-specific information for this address.
struct GNUNET_TIME_Absolute t_last_activity
Time when address had last activity (update, in uses)
uint32_t last_notified_bw_out
Outbound bandwidth assigned by solver in NBO.
uint32_t assigned_bw_out
Outbound bandwidth assigned by solver.
struct GAS_NormalizationInfo norm_distance
Normalized distance information for this address.
struct GAS_NormalizationInfo norm_utilization_out
Normalized utilization outbound for this address.
uint32_t session_id
Session ID, can never be 0.
size_t addr_len
Address length, number of bytes in addr.
uint32_t atsi_count
ATS performance information for this address, size of the atsi array.
struct GAS_NormalizationInfo norm_utilization_in
Normalized utilization inbound for this address.
struct GNUNET_ATS_Properties properties
ATS performance information for this address.
const void * addr
Address (in plugin-specific binary format).
struct GNUNET_TIME_Absolute t_added
Time when address was added.
Client to service: please give us an overview of the addresses.
Definition: ats.h:342
Information provided by ATS normalization.
uint64_t atsi_abs[3]
Averaging queue.
double norm
Normalized values from queue to a range of values [1.0...2.0].
unsigned int avg_queue_index
Next index to use in averaging queue.
uint64_t avg
Averaged ATSI values from queue.
ATS performance characteristics for an address.
32-bit bandwidth used for network exchange by GNUnet, in bytes per second.
Internal representation of the hash map.
The identity of the host (wraps the signing key of the peer).
Handle to a client that is connected to a service.
Definition: service.c:251
Time for absolute times used by GNUnet, in microseconds.
struct GNUNET_TESTBED_Peer * peer
The peer associated with this model.