41 #define MIN_CONNECTIONS 4
46 #define MAX_NUMBER_HOSTLISTS 30
51 #define SAVING_INTERVAL \
52 GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_MINUTES, 30)
57 #define TESTING_INTERVAL \
58 GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS, 3)
63 #define WAITING_INTERVAL \
64 GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS, 1)
73 #define HOSTLIST_INITIAL 10000
78 #define HOSTLIST_FAILED_DOWNLOAD 100
83 #define HOSTLIST_SUCCESSFUL_DOWNLOAD 100
88 #define HOSTLIST_SUCCESSFUL_HELLO 1
327 const char *cbuf = ptr;
334 total =
size * nmemb;
343 "# bytes downloaded from hostlist servers"),
365 gettext_noop (
"# invalid HELLOs downloaded from hostlist servers"),
369 _ (
"Invalid `%s' message received from hostlist at `%s'\n"),
384 "Received valid `%s' message from hostlist server.\n",
388 gettext_noop (
"# valid HELLOs downloaded from hostlist servers"),
402 gettext_noop (
"# invalid HELLOs downloaded from hostlist servers"),
406 _ (
"Invalid `%s' message received from hostlist at `%s'\n"),
413 memmove (download_buffer, &download_buffer[msize],
download_pos - msize);
445 if (strlen (servers) > 0)
448 pos = strlen (servers) - 1;
451 if (servers[pos] ==
' ')
466 pos = strlen (servers) - 1;
469 if (servers[pos] ==
' ')
495 unsigned int counter;
501 "Using preconfigured bootstrap server\n");
509 "Testing new advertised hostlist if it is obtainable\n");
517 "Using preconfigured bootstrap server\n");
525 while (counter < index)
531 "Using learned hostlist `%s'\n",
538 #define CURL_EASY_SETOPT(c, a, b) \
541 ret = curl_easy_setopt (c, a, b); \
542 if (CURLE_OK != ret) \
543 GNUNET_log (GNUNET_ERROR_TYPE_WARNING, \
544 _ ("%s failed at %s:%d: `%s'\n"), \
545 "curl_easy_setopt", \
548 curl_easy_strerror (ret)); \
571 static uint64_t temp;
572 static uint64_t maxv;
663 "Removing hostlist with URI `%s' which has the worst quality of all (%llu)\n",
665 (
unsigned long long) lowest_quality->
quality);
696 "Updating hostlist statics for URI `%s'\n",
752 "Advertised hostlist with URI `%s' could not be downloaded. Advertised URI gets dismissed.\n"),
768 mret = curl_multi_remove_handle (
multi,
curl);
769 if (mret != CURLM_OK)
772 _ (
"%s failed at %s:%d: `%s'\n"),
773 "curl_multi_remove_handle",
776 curl_multi_strerror (mret));
778 mret = curl_multi_cleanup (
multi);
779 if (mret != CURLM_OK)
781 _ (
"%s failed at %s:%d: `%s'\n"),
782 "curl_multi_cleanup",
785 curl_multi_strerror (mret));
790 curl_easy_cleanup (
curl);
831 mret = curl_multi_fdset (
multi, &rs, &ws, &es, &
max);
832 if (mret != CURLM_OK)
835 _ (
"%s failed at %s:%d: `%s'\n"),
839 curl_multi_strerror (mret));
844 if (mret != CURLM_OK)
847 _ (
"%s failed at %s:%d: `%s'\n"),
848 "curl_multi_timeout",
851 curl_multi_strerror (mret));
863 "Scheduling task for hostlist download using cURL\n");
886 _ (
"Timeout trying to download hostlist from `%s'\n"),
893 "Ready for processing hostlist client request\n");
901 "Download limit of %u bytes exceeded, stopping download\n"),
906 mret = curl_multi_perform (
multi, &running);
911 msg = curl_multi_info_read (
multi, &running);
918 if ((
msg->data.result != CURLE_OK) &&
919 (
msg->data.result != CURLE_GOT_NOTHING))
921 _ (
"Download of hostlist from `%s' failed: `%s'\n"),
923 curl_easy_strerror (
msg->data.result));
927 _ (
"Download of hostlist `%s' completed.\n"),
935 _ (
"Adding successfully tested hostlist `%s' datastore.\n"),
949 while ((running > 0));
952 while (mret == CURLM_CALL_MULTI_PERFORM);
954 if (mret != CURLM_OK)
957 _ (
"%s failed at %s:%d: `%s'\n"),
958 "curl_multi_perform",
961 curl_multi_strerror (mret));
982 curl = curl_easy_init ();
991 _ (
"Bootstrapping using hostlist at `%s'.\n"),
1015 if (
ret != CURLE_OK)
1021 if (
ret != CURLE_OK)
1028 CURLOPT_REDIR_PROTOCOLS,
1029 CURLPROTO_HTTP | CURLPROTO_HTTPS);
1034 if (
ret != CURLE_OK)
1048 multi = curl_multi_init ();
1055 mret = curl_multi_add_handle (
multi,
curl);
1056 if (mret != CURLM_OK)
1059 _ (
"%s failed at %s:%d: `%s'\n"),
1060 "curl_multi_add_handle",
1063 curl_multi_strerror (mret));
1064 mret = curl_multi_cleanup (
multi);
1065 if (mret != CURLM_OK)
1067 _ (
"%s failed at %s:%d: `%s'\n"),
1068 "curl_multi_cleanup",
1071 curl_multi_strerror (mret));
1094 "Download in progress, have to wait...\n");
1117 curl_global_cleanup ();
1137 "# milliseconds between hostlist downloads"),
1147 _ (
"Have %u/%u connections. Will consider downloading hostlist in %s\n"),
1166 "Testing new hostlist advertisements is allowed again\n");
1182 "Hostlists will be saved to file again in %s\n",
1243 uri_size = strlen (
uri) + 1;
1245 "Hostlist client received advertisement containing URI `%s'\n",
1257 "Currently not accepting new advertisements: interval between to advertisements is not reached\n");
1264 "Currently not accepting new advertisements: we are already testing a hostlist\n");
1283 "Testing new hostlist advertisements is locked for the next %s\n",
1311 "Statistics request done, scheduling hostlist download\n");
1349 "Initial time between hostlist downloads is %s\n",
1367 uint32_t hellos_returned;
1387 _ (
"Loading saved hostlist entries from file `%s' \n"),
1392 _ (
"Hostlist file `%s' does not exist\n"),
1403 "Could not open file `%s' for reading to load hostlists: %s\n"),
1417 (int32_t *) &hellos_returned),
1434 "Added hostlist entry with URI `%s' \n",
1444 _ (
"%u hostlist URIs loaded from file\n"),
1498 "Could not open file `%s' for writing to save hostlists: %s\n"),
1505 _ (
"Writing %u hostlist URIs to `%s'\n"),
1538 _ (
"Error writing hostlist URIs to file `%s'\n"),
1557 _ (
"Error writing hostlist URIs to file `%s'\n"),
1583 char *proxytype_str;
1587 if (0 != curl_global_init (CURL_GLOBAL_WIN32))
1608 "Found proxy username name: `%s'\n",
1619 "Found proxy password name: `%s'\n",
1632 "Unable to convert `%s' to UTF-8 uppercase\n",
1635 if (0 == strcmp (proxytype_str,
"HTTP"))
1637 else if (0 == strcmp (proxytype_str,
"HTTP_1_0"))
1639 else if (0 == strcmp (proxytype_str,
"SOCKS4"))
1641 else if (0 == strcmp (proxytype_str,
"SOCKS5"))
1643 else if (0 == strcmp (proxytype_str,
"SOCKS4A"))
1645 else if (0 == strcmp (proxytype_str,
"SOCKS5_HOSTNAME"))
1652 "Invalid proxy type: `%s', disabling proxy! Check configuration!\n"),
1681 _ (
"Learning is enabled on this peer\n"));
1684 "Hostlists will be saved to file again in %s\n",
1694 _ (
"Learning is not enabled on this peer\n"));
1708 "Since learning is not enabled on this peer, hostlist file `%s' was removed\n"),
1719 "Loading stats value on hostlist download frequency\n");
1723 "# milliseconds between hostlist downloads"),
1730 "Statistics request failed, scheduling hostlist download\n");
1784 curl_global_cleanup ();
struct GNUNET_MQ_Handle * mq
struct GNUNET_MessageHeader * msg
#define gettext_noop(String)
static int once
Global to mark if we've run the initialization.
static int ret
Return value of the commandline.
static struct GNUNET_TIME_Relative timeout
Desired timeout for the lookup (default is no timeout).
static struct GNUNET_CADET_Channel * ch
Channel handle.
static struct GNUNET_SCHEDULER_Task * st
The shutdown task.
common internal definitions for hostlist daemon
#define MAX_URL_LEN
How long can hostlist URLs be?
#define MAX_BYTES_PER_HOSTLISTS
How many bytes do we download at most from a hostlist server?
static void task_download_dispatcher(void *cls)
static unsigned int stat_download_successful
Value saying if hostlist download was successful.
static struct GNUNET_TIME_Absolute end_time
At what time MUST the current hostlist request be done?
#define SAVING_INTERVAL
Time interval hostlists are saved to disk.
static char * proxy
Proxy hostname or ip we are using (can be NULL).
static uint64_t checked_add(uint64_t val1, uint64_t val2)
Add val2 to val1 with overflow check.
#define HOSTLIST_SUCCESSFUL_HELLO
Value added for each valid HELLO received during a hostlist download.
static void handler_disconnect(void *cls, const struct GNUNET_PeerIdentity *peer, void *internal_cls)
Method called whenever a given peer disconnects.
static int process_stat(void *cls, const char *subsystem, const char *name, uint64_t value, int is_persistent)
We've received the previous delay value from statistics.
static void task_check(void *cls)
Task that checks if we should try to download a hostlist.
#define MAX_NUMBER_HOSTLISTS
Maximum number of hostlist that are saved.
static int stat_download_in_progress
Value controlling if a hostlist download is running at the moment.
static void task_hostlist_saving(void *cls)
Task that writes hostlist entries to a file on a regular base.
static int stat_learning
Set if we are allowed to learn new hostlists and use them.
static char * download_get_url()
Method deciding if a preconfigured or advertisied hostlist is used on a 50:50 ratio.
static struct GNUNET_TIME_Relative hostlist_delay
Amount of time we wait between hostlist downloads.
static struct Hostlist * linked_list_head
Head of the linked list used to store hostlists.
#define HOSTLIST_FAILED_DOWNLOAD
Value subtracted each time a hostlist download fails.
static void handler_advertisement(const char *uri)
Method called whenever an advertisement message arrives.
static unsigned int stat_use_bootstrap
Value saying if a preconfigured bootstrap server is used.
int GNUNET_HOSTLIST_client_start(const struct GNUNET_CONFIGURATION_Handle *c, struct GNUNET_STATISTICS_Handle *st, GNUNET_CORE_ConnectEventHandler *ch, GNUNET_CORE_DisconnectEventHandler *dh, GNUNET_HOSTLIST_UriHandler *msgh, int learn)
Start downloading hostlists from hostlist servers as necessary.
static void * handler_connect(void *cls, const struct GNUNET_PeerIdentity *peer, struct GNUNET_MQ_Handle *mq)
Method called whenever a given peer connects.
static struct GNUNET_STATISTICS_Handle * stats
Statistics handle.
static int stat_testing_allowed
Value controlling if a hostlist testing is allowed at the moment.
static const struct GNUNET_CONFIGURATION_Handle * cfg
Our configuration.
static void insert_hostlist()
Method to insert a hostlist into the datastore.
static size_t download_pos
Number of bytes valid in 'download_buffer'.
static CURL * curl
Current CURL handle.
static int stat_testing_hostlist
Value controlling if a hostlist is tested at the moment.
static struct GNUNET_PEERINFO_Handle * pi
Handle to peerinfo service.
static char * current_url
Current URL that we are using.
static char * proxy_password
Proxy password we are using (can be NULL).
static void stat_timeout_task(void *cls)
Continuation called by the statistics code once we go the stat.
static unsigned int linked_list_size
Size of the linked list used to store hostlists.
static struct GNUNET_STATISTICS_GetHandle * sget
Handle for our statistics GET operation.
#define CURL_EASY_SETOPT(c, a, b)
#define WAITING_INTERVAL
Time interval for download dispatcher before a download is re-scheduled.
static void load_hostlist_file()
Method to load persistent hostlist file during hostlist client startup.
static struct GNUNET_SCHEDULER_Task * ti_testing_intervall_task
ID of the task controlling the locking between two hostlist tests.
static unsigned int stat_connection_count
Number of active connections (according to core service).
static int linked_list_contains(const char *uri)
Method to check if a URI is in hostlist linked list.
static CURLM * multi
Current multi-CURL handle.
#define HOSTLIST_INITIAL
Defines concerning the hostlist quality metric.
static size_t callback_download(void *ptr, size_t size, size_t nmemb, void *ctx)
Process downloaded bits by calling callback on each HELLO.
#define TESTING_INTERVAL
Time interval between two hostlist tests.
#define MIN_CONNECTIONS
Number of connections that we must have to NOT download hostlists anymore.
static void update_hostlist()
Method updating hostlist statistics.
static int stat_bogus_url
Set to GNUNET_YES if the current URL had some problems.
static void task_download(void *cls)
Task that is run when we are ready to receive more data from the hostlist server.
static struct Hostlist * hostlist_to_test
Head of the linked list used to store hostlists.
static void download_hostlist()
Main function that will download a hostlist and process its data.
void GNUNET_HOSTLIST_client_stop()
Stop downloading hostlists from hostlist servers as necessary.
static unsigned int stat_hellos_obtained
Value saying how many valid HELLO messages were obtained during download.
static char * get_bootstrap_server()
Obtain a hostlist URL that we should use.
static struct Hostlist * linked_list_tail
Tail of the linked list used to store hostlists.
static struct GNUNET_SCHEDULER_Task * ti_download
ID of the task downloading the hostlist.
static struct Hostlist * current_hostlist
Current hostlist used for downloading.
static struct GNUNET_SCHEDULER_Task * ti_check_download
ID of the task, checking if hostlist download should take plate.
static struct Hostlist * linked_list_get_lowest_quality()
Method returning the hostlist element with the lowest quality in the datastore.
static struct GNUNET_SCHEDULER_Task * ti_saving_task
ID of the task saving the hostlsit in a regular interval.
static void save_hostlist_file(int shutdown)
Method to save hostlist to a file during hostlist client shutdown.
static uint32_t stat_bytes_downloaded
How many bytes did we download from the current hostlist URL?
static char * proxy_username
Proxy username we are using (can be NULL).
#define HOSTLIST_SUCCESSFUL_DOWNLOAD
Value added each time a hostlist download is successful.
static struct GNUNET_SCHEDULER_Task * ti_download_dispatcher_task
ID of the task called to initiate a download.
static void clean_up()
Clean up the state from the task that downloaded the hostlist and schedule the next task.
static uint64_t checked_sub(uint64_t val1, uint64_t val2)
Subtract val2 from val1 with underflow check.
static curl_proxytype proxy_type
Proxy type we are using (can be NULL).
static void task_testing_intervall_reset(void *cls)
This tasks sets hostlist testing to allowed after interval between to testings is reached.
static void primary_task(void *cls, int success)
Continuation called by the statistics code once we go the stat.
static void download_prepare()
Ask CURL for the select set and then schedule the receiving task with the scheduler.
void(* GNUNET_HOSTLIST_UriHandler)(const char *uri)
Function that handles an advertised URI.
static char * value
Value of the record to add/remove.
static int ok
Return value from 'main' (0 == success)
static struct GNUNET_FS_Uri * uri
Value of URI provided on command-line (when not publishing a file but just creating UBlocks to refer ...
static int result
Global testing status.
static struct GNUNET_TIME_Relative delay
When should dkg communication start?
static struct GNUNET_TESTBED_BarrierWaitHandle * wh
Our barrier wait handle.
static char * subsystem
Set to subsystem that we're going to get stats for (or NULL for all).
static struct GNUNET_DNSSTUB_Context * ctx
Context for DNS resolution.
library to make it easy to download JSON replies over HTTP
Helper library for handling HELLOs.
Maintain the list of currently known hosts.
API to create, modify and access statistics.
#define GNUNET_MAX_MESSAGE_SIZE
Largest supported message (to be precise, one byte more than the largest possible message,...
int GNUNET_BIO_read_string(struct GNUNET_BIO_ReadHandle *h, const char *what, char **result, size_t max_length)
Read 0-terminated string.
int GNUNET_BIO_write_spec_commit(struct GNUNET_BIO_WriteHandle *h, struct GNUNET_BIO_WriteSpec *ws)
Execute the write specifications in order.
struct GNUNET_BIO_ReadHandle * GNUNET_BIO_read_open_file(const char *fn)
Open a file for reading.
int GNUNET_BIO_write_close(struct GNUNET_BIO_WriteHandle *h, char **emsg)
Close an IO handle.
struct GNUNET_BIO_WriteSpec GNUNET_BIO_write_spec_string(const char *what, const char *s)
Create the specification to write a 0-terminated string.
#define GNUNET_BIO_read_spec_end()
End of specifications marker.
int GNUNET_BIO_read_spec_commit(struct GNUNET_BIO_ReadHandle *h, struct GNUNET_BIO_ReadSpec *rs)
Execute the read specifications in order.
struct GNUNET_BIO_ReadSpec GNUNET_BIO_read_spec_int32(const char *what, int32_t *i)
Create the specification to read an (u)int32_t.
#define GNUNET_BIO_write_spec_end()
End of specifications marker.
int GNUNET_BIO_read_close(struct GNUNET_BIO_ReadHandle *h, char **emsg)
Close an open handle.
struct GNUNET_BIO_WriteHandle * GNUNET_BIO_write_open_file(const char *fn)
Open a file for writing.
struct GNUNET_BIO_WriteSpec GNUNET_BIO_write_spec_int32(const char *what, int32_t *i)
Create the specification to write an (u)int32_t.
struct GNUNET_BIO_ReadSpec GNUNET_BIO_read_spec_int64(const char *what, int64_t *i)
Create the specification to read an (u)int64_t.
struct GNUNET_BIO_WriteSpec GNUNET_BIO_write_spec_int64(const char *what, int64_t *i)
Create the specification to write an (u)int64_t.
enum GNUNET_GenericReturnValue GNUNET_CONFIGURATION_get_value_filename(const struct GNUNET_CONFIGURATION_Handle *cfg, const char *section, const char *option, char **value)
Get a configuration value that should be the name of a file or directory.
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.
void(* GNUNET_CORE_DisconnectEventHandler)(void *cls, const struct GNUNET_PeerIdentity *peer, void *peer_cls)
Method called whenever a peer disconnects.
void *(* GNUNET_CORE_ConnectEventHandler)(void *cls, const struct GNUNET_PeerIdentity *peer, struct GNUNET_MQ_Handle *mq)
Method called whenever a given peer connects.
uint32_t GNUNET_CRYPTO_random_u32(enum GNUNET_CRYPTO_Quality mode, uint32_t i)
Produce a random value.
@ GNUNET_CRYPTO_QUALITY_WEAK
No good quality of the operation is needed (i.e., random numbers can be pseudo-random).
enum GNUNET_GenericReturnValue GNUNET_DISK_file_test(const char *fil)
Check that fil corresponds to a filename (of a file that exists and that is not a directory).
enum GNUNET_GenericReturnValue GNUNET_DISK_directory_create_for_file(const char *filename)
Create the directory structure for storing a file.
#define GNUNET_CONTAINER_DLL_remove(head, tail, element)
Remove an element from a DLL.
#define GNUNET_CONTAINER_DLL_insert(head, tail, element)
Insert an element at the head of a DLL.
uint16_t GNUNET_HELLO_size(const struct GNUNET_HELLO_Message *hello)
Return the size of the given HELLO message.
#define GNUNET_log(kind,...)
#define GNUNET_memcpy(dst, src, n)
Call memcpy() but check for n being 0 first.
@ GNUNET_SCHEDULER_PRIORITY_DEFAULT
Run with the default priority (normal P2P operations).
#define GNUNET_assert(cond)
Use this for fatal errors that cannot be handled.
#define GNUNET_break(cond)
Use this for internal assertion violations that are not fatal (can be handled) but should not occur.
void GNUNET_log_config_missing(enum GNUNET_ErrorType kind, const char *section, const char *option)
Log error message about missing configuration option.
#define GNUNET_log_strerror_file(level, cmd, filename)
Log an error message at log-level 'level' that indicates a failure of the command 'cmd' with the mess...
@ GNUNET_ERROR_TYPE_WARNING
@ GNUNET_ERROR_TYPE_ERROR
@ GNUNET_ERROR_TYPE_DEBUG
int int GNUNET_asprintf(char **buf, const char *format,...) __attribute__((format(printf
Like asprintf, just portable.
#define GNUNET_strdup(a)
Wrapper around GNUNET_xstrdup_.
#define GNUNET_malloc(size)
Wrapper around malloc.
#define GNUNET_free(ptr)
Wrapper around free.
struct GNUNET_NETWORK_FDSet * GNUNET_NETWORK_fdset_create(void)
Creates an fd set.
void GNUNET_NETWORK_fdset_destroy(struct GNUNET_NETWORK_FDSet *fds)
Releases the associated memory of an fd set.
void GNUNET_NETWORK_fdset_copy_native(struct GNUNET_NETWORK_FDSet *to, const fd_set *from, int nfds)
Copy a native fd set into the GNUnet representation.
struct GNUNET_MQ_Envelope * GNUNET_PEERINFO_add_peer(struct GNUNET_PEERINFO_Handle *h, const struct GNUNET_HELLO_Message *hello, GNUNET_SCHEDULER_TaskCallback cont, void *cont_cls)
Add a host to the persistent list.
struct GNUNET_PEERINFO_Handle * GNUNET_PEERINFO_connect(const struct GNUNET_CONFIGURATION_Handle *cfg)
Connect to the peerinfo service.
void GNUNET_PEERINFO_disconnect(struct GNUNET_PEERINFO_Handle *h)
Disconnect from the peerinfo service.
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.
struct GNUNET_SCHEDULER_Task * GNUNET_SCHEDULER_add_select(enum GNUNET_SCHEDULER_Priority prio, struct GNUNET_TIME_Relative delay, const struct GNUNET_NETWORK_FDSet *rs, const struct GNUNET_NETWORK_FDSet *ws, GNUNET_SCHEDULER_TaskCallback task, void *task_cls)
Schedule a new task to be run with a specified delay or when any of the specified file descriptor set...
void * GNUNET_SCHEDULER_cancel(struct GNUNET_SCHEDULER_Task *task)
Cancel the task with the specified identifier.
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.
void GNUNET_STATISTICS_get_cancel(struct GNUNET_STATISTICS_GetHandle *gh)
Cancel a GNUNET_STATISTICS_get request.
void GNUNET_STATISTICS_set(struct GNUNET_STATISTICS_Handle *handle, const char *name, uint64_t value, int make_persistent)
Set statistic value for the peer.
void GNUNET_STATISTICS_update(struct GNUNET_STATISTICS_Handle *handle, const char *name, int64_t delta, int make_persistent)
Set statistic value for the peer.
struct GNUNET_STATISTICS_GetHandle * GNUNET_STATISTICS_get(struct GNUNET_STATISTICS_Handle *handle, const char *subsystem, const char *name, GNUNET_STATISTICS_Callback cont, GNUNET_STATISTICS_Iterator proc, void *cls)
Get statistic from the peer.
enum GNUNET_GenericReturnValue GNUNET_STRINGS_utf8_toupper(const char *input, char *output)
Convert the utf-8 input string to upper case.
struct GNUNET_TIME_Relative GNUNET_TIME_relative_min(struct GNUNET_TIME_Relative t1, struct GNUNET_TIME_Relative t2)
Return the minimum of two relative time values.
#define GNUNET_TIME_UNIT_HOURS
One hour.
#define GNUNET_TIME_UNIT_SECONDS
One second.
struct GNUNET_TIME_Relative GNUNET_TIME_absolute_get_remaining(struct GNUNET_TIME_Absolute future)
Given a timestamp in the future, how much time remains until then?
#define GNUNET_TIME_UNIT_MILLISECONDS
One millisecond.
struct GNUNET_TIME_Absolute GNUNET_TIME_absolute_get(void)
Get the current time.
#define GNUNET_TIME_UNIT_MINUTES
One minute.
struct GNUNET_TIME_Absolute GNUNET_TIME_relative_to_absolute(struct GNUNET_TIME_Relative rel)
Convert relative time to an absolute time in the future.
struct GNUNET_TIME_Relative GNUNET_TIME_relative_multiply(struct GNUNET_TIME_Relative rel, unsigned long long factor)
Multiply relative time by a given factor.
#define GNUNET_TIME_UNIT_ZERO
Relative time zero.
const char * GNUNET_STRINGS_relative_time_to_string(struct GNUNET_TIME_Relative delta, int do_round)
Give relative time in human-readable fancy format.
static unsigned int size
Size of the "table".
Handle for buffered reading.
Structure specifying a reading operation on an IO handle.
GNUNET_BIO_ReadHandler rh
Function performing data deserialization.
Handle for buffered writing.
Structure specifying a writing operation on an IO handle.
A HELLO message is used to exchange information about transports with other peers.
Handle to a message queue.
collection of IO descriptors
Handle to the peerinfo service.
The identity of the host (wraps the signing key of the peer).
Entry in list of pending tasks.
Linked list of things we still need to do.
Time for absolute times used by GNUnet, in microseconds.
uint64_t abs_value_us
The actual value.
Time for relative time used by GNUnet, in microseconds.
uint64_t rel_value_us
The actual value.
A single hostlist obtained by hostlist advertisements.
struct GNUNET_TIME_Absolute time_last_usage
Last time the hostlist was obtained.
uint64_t quality
Value describing the quality of the hostlist, the bigger the better but (should) never < 0 used for d...
struct Hostlist * prev
previous entry, used to manage entries in a double linked list
uint32_t hello_count
Number of HELLO messages obtained during last download.
struct GNUNET_TIME_Absolute time_creation
Time the hostlist advertisement was received and the entry was created.
uint32_t times_used
Number of times the hostlist was successfully obtained.
struct Hostlist * next
next entry, used to manage entries in a double linked list
const char * hostlist_uri
URI where hostlist can be obtained.
struct GNUNET_TESTBED_Peer * peer
The peer associated with this model.