GNUnet  0.20.0
gnunet-ats.c File Reference

ATS command line tool. More...

Include dependency graph for gnunet-ats.c:

Go to the source code of this file.

Data Structures

struct  PendingResolutions
 Structure used to remember all pending address resolutions. More...
 
struct  ATSAddress
 Information we keep for an address. More...
 
struct  AddressFindCtx
 Closure for find_address_it(). More...
 

Macros

#define UNLIMITED_STRING   "unlimited"
 String to respresent unlimited. More...
 

Functions

static int free_addr_it (void *cls, const struct GNUNET_PeerIdentity *key, void *value)
 Free address corresponding to a given peer. More...
 
static void end (void *cls)
 Task run on shutdown. More...
 
static void transport_addr_to_str_cb (void *cls, const char *address, int res)
 Function to call with a textual representation of an address. More...
 
static int find_address_it (void *cls, const struct GNUNET_PeerIdentity *key, void *value)
 Find address corresponding to a given peer. More...
 
static void ats_perf_mon_cb (void *cls, const struct GNUNET_HELLO_Address *address, int active, struct GNUNET_BANDWIDTH_Value32NBO bandwidth_out, struct GNUNET_BANDWIDTH_Value32NBO bandwidth_in, const struct GNUNET_ATS_Properties *prop)
 Signature of a function that is called with QoS information about an address. More...
 
static void ats_perf_cb (void *cls, const struct GNUNET_HELLO_Address *address, int active, struct GNUNET_BANDWIDTH_Value32NBO bandwidth_out, struct GNUNET_BANDWIDTH_Value32NBO bandwidth_in, const struct GNUNET_ATS_Properties *prop)
 Signature of a function that is called with QoS information about an address. More...
 
static unsigned int print_quotas (const struct GNUNET_CONFIGURATION_Handle *cfg)
 Print information about the quotas configured for the various network scopes. More...
 
static void run (void *cls, char *const *args, const char *cfgfile, const struct GNUNET_CONFIGURATION_Handle *my_cfg)
 Main function that will be run by the scheduler. More...
 
int main (int argc, char *const *argv)
 The main function. More...
 

Variables

static int opt_resolve_addresses_numeric
 CLI Opt: More...
 
static int opt_verbose
 CLI Opt: Print verbose ATS information. More...
 
static int opt_list_used
 CLI Option: List only addresses currently used (active) More...
 
static int opt_list_all
 CLI Option: List all addresses. More...
 
static int opt_set_pref
 CLI Option: set preference. More...
 
static int opt_print_quotas
 CLI Option: print quotas configured. More...
 
static int opt_monitor
 CLI Option: Monitor addresses used. More...
 
static char * opt_pid_str
 CLI Option: use specific peer. More...
 
static char * opt_type_str
 CLI Option: preference type to set. More...
 
static unsigned int opt_pref_value
 CLI Option: preference value to set. More...
 
static int ret
 Final status code. More...
 
static int stat_results
 Number of results returned from service. More...
 
static int stat_receive_done
 State: all pending receive operations done? More...
 
static int stat_pending
 State: number of pending operations. More...
 
static char * cpid_str
 Which peer should we connect to? More...
 
static struct GNUNET_ATS_PerformanceHandleph
 ATS performance handle used. More...
 
static struct GNUNET_ATS_ConnectivityHandleats_ch
 Our connectivity handle. More...
 
static struct GNUNET_ATS_ConnectivitySuggestHandleats_sh
 Handle for address suggestion request. More...
 
static struct GNUNET_ATS_AddressListHandlealh
 ATS address list handle used. More...
 
static struct GNUNET_CONFIGURATION_Handlecfg
 Configuration handle. More...
 
static struct GNUNET_SCHEDULER_Taskshutdown_task
 Shutdown task. More...
 
static struct GNUNET_CONTAINER_MultiPeerMapaddresses
 Hashmap to store addresses. More...
 
static struct PendingResolutionshead
 Head of list of pending resolution requests. More...
 
static struct PendingResolutionstail
 Tail of list of pending resolution requests. More...
 

Detailed Description

ATS command line tool.

Author
Matthias Wachs
Christian Grothoff

Definition in file gnunet-ats.c.

Macro Definition Documentation

◆ UNLIMITED_STRING

#define UNLIMITED_STRING   "unlimited"

String to respresent unlimited.

Definition at line 35 of file gnunet-ats.c.

Function Documentation

◆ free_addr_it()

static int free_addr_it ( void *  cls,
const struct GNUNET_PeerIdentity key,
void *  value 
)
static

Free address corresponding to a given peer.

Parameters
clsNULL
keypeer identity
valuethe struct ATSAddress * to be freed
Returns
GNUNET_YES (always)

Definition at line 247 of file gnunet-ats.c.

248 {
249  struct ATSAddress *a = value;
250 
254  GNUNET_free (a);
255  return GNUNET_OK;
256 }
static struct GNUNET_CONTAINER_MultiPeerMap * addresses
Hashmap to store addresses.
Definition: gnunet-ats.c:146
struct GNUNET_HashCode key
The key used in the DHT.
static char * value
Value of the record to add/remove.
enum GNUNET_GenericReturnValue GNUNET_CONTAINER_multipeermap_remove(struct GNUNET_CONTAINER_MultiPeerMap *map, const struct GNUNET_PeerIdentity *key, const void *value)
Remove the given key-value pair from the map.
#define GNUNET_HELLO_address_free(addr)
Free an address.
@ GNUNET_OK
#define GNUNET_assert(cond)
Use this for fatal errors that cannot be handled.
#define GNUNET_free(ptr)
Wrapper around free.
Information we keep for an address.
Definition: gnunet-ats.c:204
struct GNUNET_HELLO_Address * address
Address information.
Definition: gnunet-ats.c:208

References ATSAddress::address, addresses, GNUNET_assert, GNUNET_CONTAINER_multipeermap_remove(), GNUNET_free, GNUNET_HELLO_address_free, GNUNET_OK, key, and value.

Referenced by ats_perf_mon_cb(), and end().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ end()

static void end ( void *  cls)
static

Task run on shutdown.

Parameters
clsNULL

Definition at line 265 of file gnunet-ats.c.

266 {
267  struct PendingResolutions *pr;
268  struct PendingResolutions *next;
269  unsigned int pending;
270 
271  if (NULL != alh)
272  {
274  alh = NULL;
275  }
276 
277  if (NULL != ph)
278  {
280  ph = NULL;
281  }
282 
283  pending = 0;
284  next = head;
285  while (NULL != (pr = next))
286  {
287  next = pr->next;
290  GNUNET_free (pr->address);
291  GNUNET_free (pr);
292  pending++;
293  }
296  addresses = NULL;
297 
298  if (0 < pending)
299  fprintf (stdout, _ ("%u address resolutions had a timeout\n"), pending);
301  fprintf (stdout,
302  _ ("ATS returned stat_results for %u addresses\n"),
303  stat_results);
304 
305  if (NULL != ats_sh)
306  {
308  ats_sh = NULL;
309  }
310  if (NULL != ats_ch)
311  {
313  ats_ch = NULL;
314  }
315  ret = 0;
316 }
static struct PendingResolutions * tail
Tail of list of pending resolution requests.
Definition: gnunet-ats.c:235
static struct GNUNET_ATS_ConnectivityHandle * ats_ch
Our connectivity handle.
Definition: gnunet-ats.c:121
static struct GNUNET_ATS_PerformanceHandle * ph
ATS performance handle used.
Definition: gnunet-ats.c:116
static int ret
Final status code.
Definition: gnunet-ats.c:91
static int stat_results
Number of results returned from service.
Definition: gnunet-ats.c:96
static struct PendingResolutions * head
Head of list of pending resolution requests.
Definition: gnunet-ats.c:230
static int opt_list_all
CLI Option: List all addresses.
Definition: gnunet-ats.c:56
static struct GNUNET_ATS_AddressListHandle * alh
ATS address list handle used.
Definition: gnunet-ats.c:131
static int opt_list_used
CLI Option: List only addresses currently used (active)
Definition: gnunet-ats.c:51
static struct GNUNET_ATS_ConnectivitySuggestHandle * ats_sh
Handle for address suggestion request.
Definition: gnunet-ats.c:126
static int free_addr_it(void *cls, const struct GNUNET_PeerIdentity *key, void *value)
Free address corresponding to a given peer.
Definition: gnunet-ats.c:247
static unsigned int pending
The number of queries that are outstanding.
void GNUNET_ATS_performance_list_addresses_cancel(struct GNUNET_ATS_AddressListHandle *alh)
Cancel a pending address listing operation.
void GNUNET_ATS_performance_done(struct GNUNET_ATS_PerformanceHandle *ph)
Client is done using the ATS performance subsystem, release resources.
void GNUNET_ATS_connectivity_done(struct GNUNET_ATS_ConnectivityHandle *ch)
Client is done with ATS connectivity management, release resources.
void GNUNET_ATS_connectivity_suggest_cancel(struct GNUNET_ATS_ConnectivitySuggestHandle *sh)
We no longer care about being connected to a peer.
#define GNUNET_CONTAINER_DLL_remove(head, tail, element)
Remove an element from a DLL.
void GNUNET_CONTAINER_multipeermap_destroy(struct GNUNET_CONTAINER_MultiPeerMap *map)
Destroy a hash map.
int GNUNET_CONTAINER_multipeermap_iterate(struct GNUNET_CONTAINER_MultiPeerMap *map, GNUNET_CONTAINER_PeerMapIterator it, void *it_cls)
Iterate over all entries in the map.
void GNUNET_TRANSPORT_address_to_string_cancel(struct GNUNET_TRANSPORT_AddressToStringContext *alc)
Cancel request for address conversion.
#define _(String)
GNU gettext support macro.
Definition: platform.h:178
Structure used to remember all pending address resolutions.
Definition: gnunet-ats.c:155
struct GNUNET_TRANSPORT_AddressToStringContext * tats_ctx
Handle to the transport request to convert the address to a string.
Definition: gnunet-ats.c:175
struct GNUNET_HELLO_Address * address
Copy of the address we are resolving.
Definition: gnunet-ats.c:169
struct PendingResolutions * next
Kept in a DLL.
Definition: gnunet-ats.c:159

References _, PendingResolutions::address, addresses, alh, ats_ch, ats_sh, free_addr_it(), GNUNET_ATS_connectivity_done(), GNUNET_ATS_connectivity_suggest_cancel(), GNUNET_ATS_performance_done(), GNUNET_ATS_performance_list_addresses_cancel(), GNUNET_CONTAINER_DLL_remove, GNUNET_CONTAINER_multipeermap_destroy(), GNUNET_CONTAINER_multipeermap_iterate(), GNUNET_free, GNUNET_TRANSPORT_address_to_string_cancel(), head, PendingResolutions::next, opt_list_all, opt_list_used, pending, ph, ret, stat_results, tail, and PendingResolutions::tats_ctx.

Referenced by ats_perf_cb(), run(), and transport_addr_to_str_cb().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ transport_addr_to_str_cb()

static void transport_addr_to_str_cb ( void *  cls,
const char *  address,
int  res 
)
static

Function to call with a textual representation of an address.

This function will be called several times with different possible textual representations, and a last time with address being NULL to signal the end of the iteration. Note that address NULL always is the last call, regardless of the value in res.

Parameters
clsclosure, a struct PendingResolutions *
addressNULL on end of iteration, otherwise 0-terminated printable UTF-8 string, in particular an empty string if res is GNUNET_NO
resresult of the address to string conversion: if GNUNET_OK: conversion successful if GNUNET_NO: address was invalid (or not supported) if GNUNET_SYSERR: communication error (IPC error)

Definition at line 336 of file gnunet-ats.c.

337 {
338  struct PendingResolutions *pr = cls;
339 
340  if (NULL == address)
341  {
342  /* We're done */
344  GNUNET_free (pr->address);
345  GNUNET_free (pr);
346  stat_pending--;
347 
348  if ((GNUNET_YES == stat_receive_done) && (0 == stat_pending))
349  {
350  /* All messages received and no resolutions pending*/
351  if (shutdown_task != NULL)
354  }
355  return;
356  }
357  switch (res)
358  {
359  case GNUNET_SYSERR:
360  fprintf (
361  stderr,
362  "Failed to convert address for peer `%s' plugin `%s' length %u to string (communication error)\n",
363  GNUNET_i2s (&pr->address->peer),
364  pr->address->transport_name,
365  (unsigned int) pr->address->address_length);
366  return;
367 
368  case GNUNET_NO:
369  fprintf (
370  stderr,
371  "Failed to convert address for peer `%s' plugin `%s' length %u to string (address invalid or not supported)\n",
372  GNUNET_i2s (&pr->address->peer),
373  pr->address->transport_name,
374  (unsigned int) pr->address->address_length);
375  return;
376 
377  case GNUNET_OK:
378  /* continues below */
379  break;
380 
381  default:
382  GNUNET_break (0);
383  return;
384  }
385 
386  fprintf (
387  stdout,
388  _ (
389  "Peer `%s' plugin `%s', address `%s', `%s' bw out: %u Bytes/s, bw in %u Bytes/s, %s\n"),
390  GNUNET_i2s (&pr->address->peer),
391  pr->address->transport_name,
392  address,
394  ntohl (pr->bandwidth_out.value__),
395  ntohl (pr->bandwidth_in.value__),
396  pr->active ? _ ("active ") : _ ("inactive "));
397 }
static int res
static int stat_receive_done
State: all pending receive operations done?
Definition: gnunet-ats.c:101
static int stat_pending
State: number of pending operations.
Definition: gnunet-ats.c:106
static void end(void *cls)
Task run on shutdown.
Definition: gnunet-ats.c:265
static struct GNUNET_SCHEDULER_Task * shutdown_task
Shutdown task.
Definition: gnunet-ats.c:141
static char * address
GNS address for this phone.
@ GNUNET_YES
@ GNUNET_NO
@ GNUNET_SYSERR
const char * GNUNET_i2s(const struct GNUNET_PeerIdentity *pid)
Convert a peer identity to a string (for printing debug messages).
#define GNUNET_break(cond)
Use this for internal assertion violations that are not fatal (can be handled) but should not occur.
const char * GNUNET_NT_to_string(enum GNUNET_NetworkType net)
Convert a enum GNUNET_NetworkType to a string.
Definition: nt.c:38
struct GNUNET_SCHEDULER_Task * GNUNET_SCHEDULER_add_now(GNUNET_SCHEDULER_TaskCallback task, void *task_cls)
Schedule a new task to be run as soon as possible.
Definition: scheduler.c:1299
void * GNUNET_SCHEDULER_cancel(struct GNUNET_SCHEDULER_Task *task)
Cancel the task with the specified identifier.
Definition: scheduler.c:975
enum GNUNET_NetworkType scope
Which network scope does the respective address belong to? This property does not change.
uint32_t value__
The actual value (bytes per second).
const char * transport_name
Name of the transport plugin enabling the communication using this address.
size_t address_length
Number of bytes in address.
struct GNUNET_PeerIdentity peer
For which peer is this an address?
struct GNUNET_BANDWIDTH_Value32NBO bandwidth_in
Amount of inbound bandwidth assigned by ATS.
Definition: gnunet-ats.c:190
struct GNUNET_ATS_Properties properties
Performance data.
Definition: gnunet-ats.c:180
int active
Is this an active address?
Definition: gnunet-ats.c:195
struct GNUNET_BANDWIDTH_Value32NBO bandwidth_out
Amount of outbound bandwidth assigned by ATS.
Definition: gnunet-ats.c:185

References _, PendingResolutions::active, PendingResolutions::address, address, GNUNET_HELLO_Address::address_length, PendingResolutions::bandwidth_in, PendingResolutions::bandwidth_out, end(), GNUNET_break, GNUNET_CONTAINER_DLL_remove, GNUNET_free, GNUNET_i2s(), GNUNET_NO, GNUNET_NT_to_string(), GNUNET_OK, GNUNET_SCHEDULER_add_now(), GNUNET_SCHEDULER_cancel(), GNUNET_SYSERR, GNUNET_YES, head, GNUNET_HELLO_Address::peer, PendingResolutions::properties, res, GNUNET_ATS_Properties::scope, shutdown_task, stat_pending, stat_receive_done, tail, GNUNET_HELLO_Address::transport_name, and GNUNET_BANDWIDTH_Value32NBO::value__.

Referenced by ats_perf_cb(), and ats_perf_mon_cb().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ find_address_it()

static int find_address_it ( void *  cls,
const struct GNUNET_PeerIdentity key,
void *  value 
)
static

Find address corresponding to a given peer.

Parameters
clsthe struct AddressFindCtx *
keypeer identity
valuethe struct ATSAddress * for an existing address
Returns
GNUNET_NO if we found a match, GNUNET_YES if not

Definition at line 426 of file gnunet-ats.c.

427 {
428  struct AddressFindCtx *actx = cls;
429  struct ATSAddress *exist = value;
430 
431  if (0 == GNUNET_HELLO_address_cmp (actx->src, exist->address))
432  {
433  actx->res = exist;
434  return GNUNET_NO;
435  }
436  return GNUNET_YES;
437 }
int GNUNET_HELLO_address_cmp(const struct GNUNET_HELLO_Address *a1, const struct GNUNET_HELLO_Address *a2)
Compare two addresses.
Definition: address.c:112
Closure for find_address_it().
Definition: gnunet-ats.c:404
struct ATSAddress * res
Where to write the struct ATSAddress if we found one that matches.
Definition: gnunet-ats.c:413
const struct GNUNET_HELLO_Address * src
Address we are looking for.
Definition: gnunet-ats.c:408

References ATSAddress::address, GNUNET_HELLO_address_cmp(), GNUNET_NO, GNUNET_YES, AddressFindCtx::res, AddressFindCtx::src, and value.

Referenced by ats_perf_mon_cb().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ats_perf_mon_cb()

static void ats_perf_mon_cb ( void *  cls,
const struct GNUNET_HELLO_Address address,
int  active,
struct GNUNET_BANDWIDTH_Value32NBO  bandwidth_out,
struct GNUNET_BANDWIDTH_Value32NBO  bandwidth_in,
const struct GNUNET_ATS_Properties prop 
)
static

Signature of a function that is called with QoS information about an address.

Parameters
clsclosure (NULL)
addressthe address, NULL if ATS service was disconnected
activeGNUNET_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
bandwidth_outassigned outbound bandwidth for the connection
bandwidth_inassigned inbound bandwidth for the connection
propperformance data for the address (as far as known)

Definition at line 454 of file gnunet-ats.c.

460 {
461  struct PendingResolutions *pr;
462  struct PendingResolutions *cur;
463  struct PendingResolutions *next;
464 
465  if (NULL == address)
466  {
467  /* ATS service temporarily disconnected, remove current state */
468  next = head;
469  for (cur = next; NULL != cur; cur = next)
470  {
471  next = cur->next;
475  GNUNET_free (cur);
476  }
478  return;
479  }
480  if (GNUNET_SYSERR == active)
481  {
482  /* remove address */
483  struct AddressFindCtx actx;
484 
485  actx.src = address;
486  actx.res = NULL;
488  &address->peer,
490  &actx);
491  if (NULL == actx.res)
492  {
493  GNUNET_break (0);
494  return;
495  }
498  &address->peer,
499  actx.res));
500  fprintf (stdout,
501  _ ("Removed address of peer `%s' with plugin `%s'\n"),
502  GNUNET_i2s (&address->peer),
503  actx.res->address->transport_name);
504  GNUNET_HELLO_address_free (actx.res);
505  return;
506  }
507 
508  if (GNUNET_NO == opt_verbose)
509  {
510  struct AddressFindCtx actx;
511  struct ATSAddress *a;
512 
513  actx.src = address;
514  actx.res = NULL;
516  &address->peer,
518  &actx);
519  if ((NULL != actx.res))
520  {
521  if ((bandwidth_in.value__ == actx.res->bandwidth_in.value__) &&
522  (bandwidth_out.value__ == actx.res->bandwidth_out.value__) &&
523  (active == actx.res->active))
524  {
525  return; /* Nothing to do here */
526  }
527  else
528  {
529  actx.res->bandwidth_in = bandwidth_in;
530  actx.res->bandwidth_out = bandwidth_out;
531  }
532  }
533  else
534  {
535  a = GNUNET_new (struct ATSAddress);
536 
540  a->active = active;
542  addresses,
543  &address->peer,
544  a,
546  }
547  }
548 
549  pr = GNUNET_new (struct PendingResolutions);
550  pr->properties = *prop;
554  pr->active = active;
556  cfg,
557  address,
561  pr);
563  stat_results++;
564  stat_pending++;
565 }
static int opt_verbose
CLI Opt: Print verbose ATS information.
Definition: gnunet-ats.c:46
static struct GNUNET_CONFIGURATION_Handle * cfg
Configuration handle.
Definition: gnunet-ats.c:136
static int opt_resolve_addresses_numeric
CLI Opt:
Definition: gnunet-ats.c:41
static void transport_addr_to_str_cb(void *cls, const char *address, int res)
Function to call with a textual representation of an address.
Definition: gnunet-ats.c:336
static int find_address_it(void *cls, const struct GNUNET_PeerIdentity *key, void *value)
Find address corresponding to a given peer.
Definition: gnunet-ats.c:426
#define GNUNET_CONTAINER_DLL_insert(head, tail, element)
Insert an element at the head of a DLL.
int GNUNET_CONTAINER_multipeermap_get_multiple(struct GNUNET_CONTAINER_MultiPeerMap *map, const struct GNUNET_PeerIdentity *key, GNUNET_CONTAINER_PeerMapIterator it, void *it_cls)
Iterate over all entries in the map that match a particular key.
int GNUNET_CONTAINER_multipeermap_put(struct GNUNET_CONTAINER_MultiPeerMap *map, const struct GNUNET_PeerIdentity *key, void *value, enum GNUNET_CONTAINER_MultiHashMapOption opt)
Store a key-value pair in the map.
@ GNUNET_CONTAINER_MULTIHASHMAPOPTION_MULTIPLE
Allow multiple values with the same key.
struct GNUNET_HELLO_Address * GNUNET_HELLO_address_copy(const struct GNUNET_HELLO_Address *address)
Copy an address struct.
Definition: address.c:99
#define GNUNET_new(type)
Allocate a struct or union of the given type.
#define GNUNET_TIME_UNIT_SECONDS
One second.
struct GNUNET_TIME_Relative GNUNET_TIME_relative_multiply(struct GNUNET_TIME_Relative rel, unsigned long long factor)
Multiply relative time by a given factor.
Definition: time.c:484
struct GNUNET_TRANSPORT_AddressToStringContext * GNUNET_TRANSPORT_address_to_string(const struct GNUNET_CONFIGURATION_Handle *cfg, const struct GNUNET_HELLO_Address *address, int numeric, struct GNUNET_TIME_Relative timeout, GNUNET_TRANSPORT_AddressToStringCallback aluc, void *aluc_cls)
Convert a binary address into a human readable address.
int active
Is this an active address?
Definition: gnunet-ats.c:223
struct GNUNET_BANDWIDTH_Value32NBO bandwidth_out
Current outbound bandwidth.
Definition: gnunet-ats.c:213
struct GNUNET_BANDWIDTH_Value32NBO bandwidth_in
Current inbound bandwidth.
Definition: gnunet-ats.c:218

References _, PendingResolutions::active, ATSAddress::active, PendingResolutions::address, ATSAddress::address, address, addresses, PendingResolutions::bandwidth_in, ATSAddress::bandwidth_in, PendingResolutions::bandwidth_out, ATSAddress::bandwidth_out, cfg, find_address_it(), free_addr_it(), GNUNET_break, GNUNET_CONTAINER_DLL_insert, GNUNET_CONTAINER_DLL_remove, GNUNET_CONTAINER_MULTIHASHMAPOPTION_MULTIPLE, GNUNET_CONTAINER_multipeermap_get_multiple(), GNUNET_CONTAINER_multipeermap_iterate(), GNUNET_CONTAINER_multipeermap_put(), GNUNET_CONTAINER_multipeermap_remove(), GNUNET_free, GNUNET_HELLO_address_copy(), GNUNET_HELLO_address_free, GNUNET_i2s(), GNUNET_new, GNUNET_NO, GNUNET_OK, GNUNET_SYSERR, GNUNET_TIME_relative_multiply(), GNUNET_TIME_UNIT_SECONDS, GNUNET_TRANSPORT_address_to_string(), GNUNET_TRANSPORT_address_to_string_cancel(), head, PendingResolutions::next, opt_resolve_addresses_numeric, opt_verbose, PendingResolutions::properties, AddressFindCtx::res, AddressFindCtx::src, stat_pending, stat_results, tail, PendingResolutions::tats_ctx, transport_addr_to_str_cb(), GNUNET_HELLO_Address::transport_name, and GNUNET_BANDWIDTH_Value32NBO::value__.

Referenced by run().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ats_perf_cb()

static void ats_perf_cb ( void *  cls,
const struct GNUNET_HELLO_Address address,
int  active,
struct GNUNET_BANDWIDTH_Value32NBO  bandwidth_out,
struct GNUNET_BANDWIDTH_Value32NBO  bandwidth_in,
const struct GNUNET_ATS_Properties prop 
)
static

Signature of a function that is called with QoS information about an address.

Parameters
clsclosure (NULL)
addressthe address, NULL if ATS service was disconnected
activeis this address actively used to maintain a connection to a peer
bandwidth_outassigned outbound bandwidth for the connection
bandwidth_inassigned inbound bandwidth for the connection
propperformance data for the address (as far as known)

Definition at line 580 of file gnunet-ats.c.

586 {
587  struct PendingResolutions *pr;
588 
589  if (NULL == address)
590  {
591  /* All messages received */
593  alh = NULL;
594  if (0 == stat_pending)
595  {
596  /* All messages received and no resolutions pending*/
597  if (shutdown_task != NULL)
600  }
601  return;
602  }
603 
604  pr = GNUNET_new (struct PendingResolutions);
605  pr->properties = *prop;
609  pr->active = active;
611  cfg,
612  address,
616  pr);
618  stat_results++;
619  stat_pending++;
620 }

References PendingResolutions::active, PendingResolutions::address, address, alh, PendingResolutions::bandwidth_in, PendingResolutions::bandwidth_out, cfg, end(), GNUNET_CONTAINER_DLL_insert, GNUNET_HELLO_address_copy(), GNUNET_new, GNUNET_SCHEDULER_add_now(), GNUNET_SCHEDULER_cancel(), GNUNET_TIME_relative_multiply(), GNUNET_TIME_UNIT_SECONDS, GNUNET_TRANSPORT_address_to_string(), GNUNET_YES, head, opt_resolve_addresses_numeric, PendingResolutions::properties, shutdown_task, stat_pending, stat_receive_done, stat_results, tail, PendingResolutions::tats_ctx, and transport_addr_to_str_cb().

Referenced by run().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ print_quotas()

static unsigned int print_quotas ( const struct GNUNET_CONFIGURATION_Handle cfg)
static

Print information about the quotas configured for the various network scopes.

Parameters
cfgconfiguration to obtain quota information from
Returns
total number of ATS network types known

Definition at line 631 of file gnunet-ats.c.

632 {
633  char *entry_in = NULL;
634  char *entry_out = NULL;
635  char *quota_out_str;
636  char *quota_in_str;
637  unsigned long long int quota_out;
638  unsigned long long int quota_in;
639  int c;
640 
641  for (c = 0; (c < GNUNET_NT_COUNT); c++)
642  {
643  GNUNET_asprintf (&entry_out, "%s_QUOTA_OUT", GNUNET_NT_to_string (c));
644  GNUNET_asprintf (&entry_in, "%s_QUOTA_IN", GNUNET_NT_to_string (c));
645 
646  /* quota out */
648  "ats",
649  entry_out,
650  &quota_out_str))
651  {
652  if ((0 == strcmp (quota_out_str, UNLIMITED_STRING)) ||
653  (GNUNET_SYSERR ==
654  GNUNET_STRINGS_fancy_size_to_bytes (quota_out_str, &quota_out)))
655  quota_out = UINT32_MAX;
656 
657  GNUNET_free (quota_out_str);
658  GNUNET_asprintf (&quota_out_str, "%llu", quota_out);
659  }
660  else
661  {
662  fprintf (stderr,
663  "Outbound quota for network `%11s' not configured!\n",
664  GNUNET_NT_to_string (c));
665  GNUNET_asprintf (&quota_out_str, "-");
666  }
667  GNUNET_free (entry_out);
668 
669  /* quota in */
671  "ats",
672  entry_in,
673  &quota_in_str))
674  {
675  if ((0 == strcmp (quota_in_str, UNLIMITED_STRING)) ||
676  (GNUNET_SYSERR ==
677  GNUNET_STRINGS_fancy_size_to_bytes (quota_in_str, &quota_in)))
678  quota_in = UINT32_MAX;
679  GNUNET_free (quota_in_str);
680  GNUNET_asprintf (&quota_in_str, "%llu", quota_in);
681  }
682  else
683  {
684  fprintf (stderr,
685  "Inbound quota for network `%11s' not configured!\n",
686  GNUNET_NT_to_string (c));
687  GNUNET_asprintf (&quota_in_str, "-");
688  }
689  GNUNET_free (entry_in);
690 
691  fprintf (stdout,
692  _ ("Quota for network `%11s' (in/out): %10s / %10s\n"),
694  quota_in_str,
695  quota_out_str);
696  GNUNET_free (quota_out_str);
697  GNUNET_free (quota_in_str);
698  }
699  return GNUNET_NT_COUNT;
700 }
#define UNLIMITED_STRING
String to respresent unlimited.
Definition: gnunet-ats.c:35
#define GNUNET_NT_COUNT
enum GNUNET_GenericReturnValue GNUNET_CONFIGURATION_get_value_string(const struct GNUNET_CONFIGURATION_Handle *cfg, const char *section, const char *option, char **value)
Get a configuration value that should be a string.
int int GNUNET_asprintf(char **buf, const char *format,...) __attribute__((format(printf
Like asprintf, just portable.
enum GNUNET_GenericReturnValue GNUNET_STRINGS_fancy_size_to_bytes(const char *fancy_size, unsigned long long *size)
Convert a given fancy human-readable size to bytes.
Definition: strings.c:236

References _, cfg, GNUNET_asprintf(), GNUNET_CONFIGURATION_get_value_string(), GNUNET_free, GNUNET_NT_COUNT, GNUNET_NT_to_string(), GNUNET_OK, GNUNET_STRINGS_fancy_size_to_bytes(), GNUNET_SYSERR, and UNLIMITED_STRING.

Referenced by run().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ run()

static void run ( void *  cls,
char *const *  args,
const char *  cfgfile,
const struct GNUNET_CONFIGURATION_Handle my_cfg 
)
static

Main function that will be run by the scheduler.

Parameters
clsclosure
argsremaining command-line arguments
cfgfilename of the configuration file used (for saving, can be NULL!)
my_cfgconfiguration

Definition at line 712 of file gnunet-ats.c.

716 {
717  struct GNUNET_PeerIdentity pid;
718  struct GNUNET_PeerIdentity cpid;
719  unsigned int c;
720  unsigned int type;
721 
724  stat_results = 0;
725 
726  c = 0;
727  if (NULL != opt_pid_str)
728  {
729  if (GNUNET_OK !=
731  strlen (opt_pid_str),
732  &pid.public_key))
733  {
734  fprintf (stderr, _ ("Failed to parse peer identity `%s'\n"), opt_pid_str);
735  return;
736  }
737  }
738  if (NULL != cpid_str)
739  {
740  if (GNUNET_OK !=
742  strlen (cpid_str),
743  &cpid.public_key))
744  {
745  fprintf (stderr, _ ("Failed to parse peer identity `%s'\n"), cpid_str);
746  return;
747  }
748  c++;
749  }
750 
752 
753  if (1 < c)
754  {
755  fprintf (stderr,
756  _ ("Please select one operation: %s or %s or %s or %s or %s\n"),
757  "--used",
758  "--all",
759  "--monitor",
760  "--preference",
761  "--quotas");
762  return;
763  }
764  if (0 == c)
765  opt_list_used = GNUNET_YES; /* set default */
766  if (opt_print_quotas)
767  {
768  ret = print_quotas (cfg);
769  return;
770  }
771  if (opt_list_all)
772  {
773  ph = GNUNET_ATS_performance_init (cfg, NULL, NULL);
774  if (NULL == ph)
775  {
776  fprintf (stderr, "%s", _ ("Cannot connect to ATS service, exiting...\n"));
777  return;
778  }
780  (NULL == opt_pid_str) ? NULL
781  : &pid,
782  GNUNET_YES,
783  &ats_perf_cb,
784  NULL);
785  if (NULL == alh)
786  {
787  fprintf (stderr,
788  "%s",
789  _ ("Cannot issue request to ATS service, exiting...\n"));
791  return;
792  }
794  return;
795  }
796  if (opt_list_used)
797  {
798  ph = GNUNET_ATS_performance_init (cfg, NULL, NULL);
799  if (NULL == ph)
800  fprintf (stderr, "%s", _ ("Cannot connect to ATS service, exiting...\n"));
801 
803  (NULL == opt_pid_str) ? NULL
804  : &pid,
805  GNUNET_NO,
806  &ats_perf_cb,
807  NULL);
808  if (NULL == alh)
809  {
810  fprintf (stderr,
811  "%s",
812  _ ("Cannot issue request to ATS service, exiting...\n"));
814  return;
815  }
817  return;
818  }
819  if (opt_monitor)
820  {
823  if (NULL == ph)
824  {
825  fprintf (stderr, "%s", _ ("Cannot connect to ATS service, exiting...\n"));
827  }
828  return;
829  }
830  if (opt_set_pref)
831  {
832  if (NULL == opt_type_str)
833  {
834  fprintf (stderr, "%s", _ ("No preference type given!\n"));
835  return;
836  }
837  if (NULL == opt_pid_str)
838  {
839  fprintf (stderr, "%s", _ ("No peer given!\n"));
840  return;
841  }
842 
843  for (c = 0; c < strlen (opt_type_str); c++)
844  {
845  if (isupper ((unsigned char) opt_type_str[c]))
846  opt_type_str[c] = tolower ((unsigned char) opt_type_str[c]);
847  }
848 
849  if (0 == strcasecmp ("latency", opt_type_str))
851  else if (0 == strcasecmp ("bandwidth", opt_type_str))
853  else
854  {
855  fprintf (stderr, "%s", _ ("Valid type required\n"));
856  return;
857  }
858 
859  /* set */
860  ph = GNUNET_ATS_performance_init (cfg, NULL, NULL);
861  if (NULL == ph)
862  fprintf (stderr, "%s", _ ("Cannot connect to ATS service, exiting...\n"));
863 
865  &pid,
866  type,
867  (double) opt_pref_value,
869 
870  shutdown_task =
872  return;
873  }
874  if (NULL != cpid_str)
875  {
878  shutdown_task =
880  return;
881  }
882  ret = 1;
883 }
static char * opt_pid_str
CLI Option: use specific peer.
Definition: gnunet-ats.c:76
static void ats_perf_mon_cb(void *cls, const struct GNUNET_HELLO_Address *address, int active, struct GNUNET_BANDWIDTH_Value32NBO bandwidth_out, struct GNUNET_BANDWIDTH_Value32NBO bandwidth_in, const struct GNUNET_ATS_Properties *prop)
Signature of a function that is called with QoS information about an address.
Definition: gnunet-ats.c:454
static unsigned int opt_pref_value
CLI Option: preference value to set.
Definition: gnunet-ats.c:86
static char * opt_type_str
CLI Option: preference type to set.
Definition: gnunet-ats.c:81
static int opt_set_pref
CLI Option: set preference.
Definition: gnunet-ats.c:61
static char * cpid_str
Which peer should we connect to?
Definition: gnunet-ats.c:111
static unsigned int print_quotas(const struct GNUNET_CONFIGURATION_Handle *cfg)
Print information about the quotas configured for the various network scopes.
Definition: gnunet-ats.c:631
static void ats_perf_cb(void *cls, const struct GNUNET_HELLO_Address *address, int active, struct GNUNET_BANDWIDTH_Value32NBO bandwidth_out, struct GNUNET_BANDWIDTH_Value32NBO bandwidth_in, const struct GNUNET_ATS_Properties *prop)
Signature of a function that is called with QoS information about an address.
Definition: gnunet-ats.c:580
static int opt_monitor
CLI Option: Monitor addresses used.
Definition: gnunet-ats.c:71
static int opt_print_quotas
CLI Option: print quotas configured.
Definition: gnunet-ats.c:66
static const struct GNUNET_CONFIGURATION_Handle * my_cfg
Our configuration.
Definition: gnunet-cadet.c:97
static struct GNUNET_PeerIdentity pid
Identity of the peer we transmit to / connect to.
static char * cpid
Which peer should we connect to?
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.
struct GNUNET_ATS_ConnectivityHandle * GNUNET_ATS_connectivity_init(const struct GNUNET_CONFIGURATION_Handle *cfg)
Initialize the ATS connectivity suggestion client handle.
struct GNUNET_ATS_ConnectivitySuggestHandle * GNUNET_ATS_connectivity_suggest(struct GNUNET_ATS_ConnectivityHandle *ch, const struct GNUNET_PeerIdentity *peer, uint32_t strength)
We would like to receive address suggestions for a peer.
void GNUNET_ATS_performance_change_preference(struct GNUNET_ATS_PerformanceHandle *ph, const struct GNUNET_PeerIdentity *peer,...)
Change preferences for the given peer.
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.
@ GNUNET_ATS_PREFERENCE_BANDWIDTH
Change the peer's bandwidth value (value per byte of bandwidth in the goal function) to the given amo...
@ GNUNET_ATS_PREFERENCE_LATENCY
Change the peer's latency value to the given amount.
@ GNUNET_ATS_PREFERENCE_END
End of preference list.
struct GNUNET_CONTAINER_MultiPeerMap * GNUNET_CONTAINER_multipeermap_create(unsigned int len, int do_not_copy_keys)
Create a multi peer map (hash map for public keys of peers).
enum GNUNET_GenericReturnValue GNUNET_CRYPTO_eddsa_public_key_from_string(const char *enc, size_t enclen, struct GNUNET_CRYPTO_EddsaPublicKey *pub)
Convert a string representing a public key to a public key.
Definition: crypto_ecc.c:358
void GNUNET_SCHEDULER_shutdown(void)
Request the shutdown of a scheduler.
Definition: scheduler.c:562
struct GNUNET_SCHEDULER_Task * GNUNET_SCHEDULER_add_shutdown(GNUNET_SCHEDULER_TaskCallback task, void *task_cls)
Schedule a new task to be run on shutdown, that is when a CTRL-C signal is received,...
Definition: scheduler.c:1334
struct GNUNET_SCHEDULER_Task * GNUNET_SCHEDULER_add_delayed(struct GNUNET_TIME_Relative delay, GNUNET_SCHEDULER_TaskCallback task, void *task_cls)
Schedule a new task to be run with a specified delay.
Definition: scheduler.c:1272
The identity of the host (wraps the signing key of the peer).
struct GNUNET_CRYPTO_EddsaPublicKey public_key
enum GNUNET_TESTBED_UnderlayLinkModelType type
the type of this model

References _, addresses, alh, ats_ch, ats_perf_cb(), ats_perf_mon_cb(), ats_sh, cfg, cpid, cpid_str, end(), GNUNET_ATS_connectivity_init(), GNUNET_ATS_connectivity_suggest(), GNUNET_ATS_performance_change_preference(), GNUNET_ATS_performance_init(), GNUNET_ATS_performance_list_addresses(), GNUNET_ATS_PREFERENCE_BANDWIDTH, GNUNET_ATS_PREFERENCE_END, GNUNET_ATS_PREFERENCE_LATENCY, GNUNET_CONTAINER_multipeermap_create(), GNUNET_CRYPTO_eddsa_public_key_from_string(), GNUNET_NO, GNUNET_OK, GNUNET_SCHEDULER_add_delayed(), GNUNET_SCHEDULER_add_now(), GNUNET_SCHEDULER_add_shutdown(), GNUNET_SCHEDULER_shutdown(), GNUNET_TIME_UNIT_SECONDS, GNUNET_YES, my_cfg, opt_list_all, opt_list_used, opt_monitor, opt_pid_str, opt_pref_value, opt_print_quotas, opt_set_pref, opt_type_str, ph, pid, print_quotas(), GNUNET_PeerIdentity::public_key, ret, shutdown_task, stat_results, and type.

Referenced by main().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ main()

int main ( int  argc,
char *const *  argv 
)

The main function.

Parameters
argcnumber of arguments from the command line
argvcommand line arguments
Returns
0 ok, 1 on error

Definition at line 894 of file gnunet-ats.c.

895 {
896  int res;
897 
903  stat_pending = 0;
905  opt_type_str = NULL;
906 
909  "used",
910  gettext_noop (
911  "get list of active addresses currently used"),
912  &opt_list_used),
914  "all",
915  gettext_noop (
916  "get list of all active addresses"),
917  &opt_list_all),
918 
920  "connect",
921  NULL,
922  gettext_noop ("connect to PEER"),
923  &cpid_str),
925  "numeric",
926  gettext_noop (
927  "do not resolve IP addresses to hostnames"),
929 
931  "monitor",
932  gettext_noop ("monitor mode"),
933  &opt_monitor),
934 
936  "preference",
937  gettext_noop (
938  "set preference for the given peer"),
939  &opt_set_pref),
940 
942  "quotas",
943  gettext_noop ("print all configured quotas"),
946  "id",
947  "TYPE",
948  gettext_noop ("peer id"),
949  &opt_pid_str),
950 
952  "type",
953  "TYPE",
954  gettext_noop (
955  "preference type to set: latency | bandwidth"),
956  &opt_type_str),
957 
959  "value",
960  "VALUE",
961  gettext_noop ("preference value"),
962  &opt_pref_value),
963 
965  'V',
966  "verbose",
967  gettext_noop ("verbose output (include ATS address properties)"),
968  &opt_verbose),
970 
971  if (GNUNET_OK != GNUNET_STRINGS_get_utf8_args (argc, argv, &argc, &argv))
972  return 2;
973 
974  res = GNUNET_PROGRAM_run (argc,
975  argv,
976  "gnunet-ats",
977  gettext_noop ("Print information about ATS state"),
978  options,
979  &run,
980  NULL);
983  GNUNET_free_nz ((void *) argv);
984 
985  if (GNUNET_OK == res)
986  return ret;
987  else
988  return 1;
989 }
struct GNUNET_GETOPT_CommandLineOption GNUNET_GETOPT_OPTION_END
Definition: 002.c:13
struct GNUNET_GETOPT_CommandLineOption options[]
Definition: 002.c:5
#define gettext_noop(String)
Definition: gettext.h:70
static void run(void *cls, char *const *args, const char *cfgfile, const struct GNUNET_CONFIGURATION_Handle *my_cfg)
Main function that will be run by the scheduler.
Definition: gnunet-ats.c:712
struct GNUNET_GETOPT_CommandLineOption GNUNET_GETOPT_option_uint(char shortName, const char *name, const char *argumentHelp, const char *description, unsigned int *val)
Allow user to specify an unsigned int.
struct GNUNET_GETOPT_CommandLineOption GNUNET_GETOPT_option_flag(char shortName, const char *name, const char *description, int *val)
Allow user to specify a flag (which internally means setting an integer to 1/GNUNET_YES/GNUNET_OK.
struct GNUNET_GETOPT_CommandLineOption GNUNET_GETOPT_option_string(char shortName, const char *name, const char *argumentHelp, const char *description, char **str)
Allow user to specify a string.
#define GNUNET_free_nz(ptr)
Wrapper around free.
enum GNUNET_GenericReturnValue GNUNET_PROGRAM_run(int argc, char *const *argv, const char *binaryName, const char *binaryHelp, const struct GNUNET_GETOPT_CommandLineOption *options, GNUNET_PROGRAM_Main task, void *task_cls)
Run a standard GNUnet command startup sequence (initialize loggers and configuration,...
Definition: program.c:400
enum GNUNET_GenericReturnValue GNUNET_STRINGS_get_utf8_args(int argc, char *const *argv, int *u8argc, char *const **u8argv)
Returns utf-8 encoded arguments.
Definition: strings.c:1222
Definition of a command line option.

References cpid_str, gettext_noop, GNUNET_free, GNUNET_free_nz, GNUNET_GETOPT_OPTION_END, GNUNET_GETOPT_option_flag(), GNUNET_GETOPT_option_string(), GNUNET_GETOPT_option_uint(), GNUNET_NO, GNUNET_OK, GNUNET_PROGRAM_run(), GNUNET_STRINGS_get_utf8_args(), opt_list_all, opt_list_used, opt_monitor, opt_pid_str, opt_pref_value, opt_print_quotas, opt_resolve_addresses_numeric, opt_set_pref, opt_type_str, opt_verbose, options, res, ret, run(), stat_pending, and stat_receive_done.

Here is the call graph for this function:

Variable Documentation

◆ opt_resolve_addresses_numeric

int opt_resolve_addresses_numeric
static

CLI Opt:

Definition at line 41 of file gnunet-ats.c.

Referenced by ats_perf_cb(), ats_perf_mon_cb(), and main().

◆ opt_verbose

int opt_verbose
static

CLI Opt: Print verbose ATS information.

Definition at line 46 of file gnunet-ats.c.

Referenced by ats_perf_mon_cb(), and main().

◆ opt_list_used

int opt_list_used
static

CLI Option: List only addresses currently used (active)

Definition at line 51 of file gnunet-ats.c.

Referenced by end(), main(), and run().

◆ opt_list_all

int opt_list_all
static

CLI Option: List all addresses.

Definition at line 56 of file gnunet-ats.c.

Referenced by end(), main(), and run().

◆ opt_set_pref

int opt_set_pref
static

CLI Option: set preference.

Definition at line 61 of file gnunet-ats.c.

Referenced by main(), and run().

◆ opt_print_quotas

int opt_print_quotas
static

CLI Option: print quotas configured.

Definition at line 66 of file gnunet-ats.c.

Referenced by main(), and run().

◆ opt_monitor

int opt_monitor
static

CLI Option: Monitor addresses used.

Definition at line 71 of file gnunet-ats.c.

Referenced by main(), and run().

◆ opt_pid_str

char* opt_pid_str
static

CLI Option: use specific peer.

Definition at line 76 of file gnunet-ats.c.

Referenced by main(), and run().

◆ opt_type_str

char* opt_type_str
static

CLI Option: preference type to set.

Definition at line 81 of file gnunet-ats.c.

Referenced by main(), and run().

◆ opt_pref_value

unsigned int opt_pref_value
static

CLI Option: preference value to set.

Definition at line 86 of file gnunet-ats.c.

Referenced by main(), and run().

◆ ret

int ret
static

Final status code.

Definition at line 91 of file gnunet-ats.c.

Referenced by end(), main(), and run().

◆ stat_results

int stat_results
static

Number of results returned from service.

Definition at line 96 of file gnunet-ats.c.

Referenced by ats_perf_cb(), ats_perf_mon_cb(), end(), and run().

◆ stat_receive_done

int stat_receive_done
static

State: all pending receive operations done?

Definition at line 101 of file gnunet-ats.c.

Referenced by ats_perf_cb(), main(), and transport_addr_to_str_cb().

◆ stat_pending

int stat_pending
static

State: number of pending operations.

Definition at line 106 of file gnunet-ats.c.

Referenced by ats_perf_cb(), ats_perf_mon_cb(), main(), and transport_addr_to_str_cb().

◆ cpid_str

char* cpid_str
static

Which peer should we connect to?

Definition at line 111 of file gnunet-ats.c.

Referenced by main(), and run().

◆ ph

◆ ats_ch

struct GNUNET_ATS_ConnectivityHandle* ats_ch
static

Our connectivity handle.

Definition at line 121 of file gnunet-ats.c.

Referenced by consider_peer_activate(), end(), and run().

◆ ats_sh

struct GNUNET_ATS_ConnectivitySuggestHandle* ats_sh
static

Handle for address suggestion request.

Definition at line 126 of file gnunet-ats.c.

Referenced by end(), and run().

◆ alh

◆ cfg

struct GNUNET_CONFIGURATION_Handle* cfg
static

Configuration handle.

Definition at line 136 of file gnunet-ats.c.

Referenced by ats_perf_cb(), ats_perf_mon_cb(), print_quotas(), and run().

◆ shutdown_task

struct GNUNET_SCHEDULER_Task* shutdown_task
static

Shutdown task.

Definition at line 141 of file gnunet-ats.c.

Referenced by ats_perf_cb(), run(), and transport_addr_to_str_cb().

◆ addresses

struct GNUNET_CONTAINER_MultiPeerMap* addresses
static

Hashmap to store addresses.

Definition at line 146 of file gnunet-ats.c.

Referenced by ats_perf_mon_cb(), end(), free_addr_it(), get_best_address(), plugin_env_address_change_notification(), and run().

◆ head

struct PendingResolutions* head
static

◆ tail

struct PendingResolutions* tail
static

Tail of list of pending resolution requests.

Definition at line 235 of file gnunet-ats.c.

Referenced by ats_perf_cb(), ats_perf_mon_cb(), discard_all_from_rung_tail(), end(), meminfo(), parse_pattern(), send_msg_from_cache(), sql_prepare(), and transport_addr_to_str_cb().