GNUnet  0.10.x
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(GNUNET_TIME_UNIT_MILLISECONDS, 100)
225 
230 {
234  unsigned int avg_queue_index;
235 
240 
244  uint64_t avg;
245 
249  double norm;
250 };
251 
252 
257 {
262 
266  const void *addr;
267 
271  char *plugin;
272 
277 
281  struct GNUNET_ATS_Properties properties;
282 
286  struct GNUNET_TIME_Absolute t_last_activity;
287 
291  struct GNUNET_TIME_Absolute t_added;
292 
296  size_t addr_len;
297 
301  uint32_t session_id;
302 
306  enum GNUNET_HELLO_AddressInfo local_address_info;
307 
311  uint32_t atsi_count;
312 
316  uint32_t assigned_bw_in;
317 
321  uint32_t assigned_bw_out;
322 
327 
332 
336  int active;
337 
341  struct GAS_NormalizationInfo norm_delay;
342 
346  struct GAS_NormalizationInfo norm_distance;
347 
351  struct GAS_NormalizationInfo norm_utilization_in;
352 
356  struct GAS_NormalizationInfo norm_utilization_out;
357 
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
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,
456  enum GNUNET_HELLO_AddressInfo local_address_info,
457  struct GNUNET_BANDWIDTH_Value32NBO bandwidth_out,
458  struct GNUNET_BANDWIDTH_Value32NBO bandwidth_in);
459 
460 
468 void
471  void *pi_it_cls);
472 
473 
480 void
482  const struct AddressListRequestMessage *alrm);
483 
484 
485 #endif
486 
487 /* end of gnunet-service-ats_addresses.h */
unsigned int avg_queue_index
Next index to use in averaging queue.
void GAS_addresses_destroy(const struct GNUNET_PeerIdentity *peer, uint32_t session_id)
Remove an address for a peer.
uint32_t session_id
Session ID, can never be 0.
#define GAS_normalization_queue_length
int active
Is this the active address for this peer?
uint64_t atsi_abs[3]
Averaging queue.
const void * addr
Address (in plugin-specific binary format).
uint32_t last_notified_bw_out
Outbound bandwidth assigned by solver in NBO.
void GAS_addresses_init(void)
Initialize address subsystem.
struct GNUNET_CONTAINER_MultiPeerMap * GSA_addresses
A multipeermap mapping peer identities to struct ATS_Address.
static struct GNUNET_HashCode session_id
static struct GNUNET_IDENTITY_Handle * id
Handle to identity service.
size_t addr_len
Address length, number of bytes in addr.
char * plugin
Plugin name.
ATS performance characteristics for an address.
Handle to a client that is connected to a service.
Definition: service.c:249
uint32_t assigned_bw_in
Inbound bandwidth assigned by solver.
void GAS_handle_request_address_list(struct GNUNET_SERVICE_Client *client, const struct AddressListRequestMessage *alrm)
Handle &#39;address list request&#39; messages from clients.
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.
static char * plugin_name
Solver plugin name as string.
Internal representation of the hash map.
Information provided by ATS normalization.
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()
uint64_t avg
Averaged ATSI values from queue.
Address with additional information.
struct GNUNET_TESTBED_Peer * peer
The peer associated with this model.
void * solver_information
Solver-specific information for this address.
Client to service: please give us an overview of the addresses.
Definition: ats.h:348
void GAS_addresses_done(void)
Shutdown address subsystem.
32-bit bandwidth used for network exchange by GNUnet, in bytes per second.
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.
The identity of the host (wraps the signing key of the peer).
uint32_t assigned_bw_out
Outbound bandwidth assigned by solver.
Automatic transport selection and outbound bandwidth determination.
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.
void GAS_addresses_destroy_all(void)
Remove all addresses.
Time for absolute times used by GNUnet, in microseconds.
GNUNET_HELLO_AddressInfo
Additional local information about an address.
uint32_t atsi_count
ATS performance information for this address, size of the atsi array.
double norm
Normalized values from queue to a range of values [1.0...2.0].
uint32_t last_notified_bw_in
Inbound bandwidth assigned by solver in NBO.
automatic transport selection messages