#include "common.h"
#include "gnutella.h"
#include "guid.h"
#include "hcache.h"
#include "hosts.h"
#include "nodes.h"
#include "pcache.h"
#include "sockets.h"
#include "udp.h"
#include "uhc.h"
#include "lib/adns.h"
#include "lib/atoms.h"
#include "lib/cq.h"
#include "lib/endian.h"
#include "lib/glib-missing.h"
#include "lib/misc.h"
#include "if/gnet_property_priv.h"
#include "if/bridge/c2ui.h"
#include "if/core/settings.h"
#include "lib/override.h"
Data Structures | |
| struct | uhc_context |
| Request context, used when we decide to get hosts via the UDP host caches. More... | |
| struct | used_uhc |
Defines | |
| #define | UHC_MAX_ATTEMPTS 3 |
| Maximum connection / resolution attempts. | |
| #define | UHC_TIMEOUT 20000 |
| Host cache timeout, milliseconds. | |
| #define | UHC_RETRY_AFTER 3600 |
| Frequency of contacts for an UHC (secs). | |
Functions | |
| void | uhc_host_resolved (const host_addr_t *addr, size_t n, gpointer uu_udata) |
| Callback for adns_resolve(), invoked when the resolution is complete. | |
| gboolean | uhc_get_host_port (const gchar *hp, const gchar **host, guint16 *port) |
| Parse hostname:port and return the hostname and port parts. | |
| void | add_available_uhc (const gchar *hc) |
| used_uhc * | used_uhc_new (const gchar *host) |
| void | used_uhc_free (struct used_uhc **ptr) |
| gboolean | uhc_pick (void) |
| Pick host at random among the host array. | |
| void | uhc_try_random (void) |
| Try a random host cache. | |
| void | uhc_ping_timeout (cqueue_t *unused_cq, gpointer unused_obj) |
| Callout queue callback, invoked when the ping was sent and we did not get a reply within the specified timeout. | |
| void | uhc_send_ping (void) |
| Send an UDP ping to the host cache. | |
| gboolean | uhc_is_waiting (void) |
| Check whether we're waiting for some UDP host cache pongs. | |
| void | uhc_get_hosts (void) |
| Get more hosts to connect to from UDP host caches, asynchronously. | |
| void | uhc_ipp_extract (gnutella_node_t *n, const gchar *payload, gint paylen) |
| Called when a pong with an "IPP" extension was received. | |
| void | uhc_init (void) |
| Initializations. | |
| void | uhc_close (void) |
| Cleanup during process termination. | |
Variables | |
| uhc_context | uhc_ctx |
| Request context, used when we decide to get hosts via the UDP host caches. | |
| GList * | uhc_avail |
| List of UHCs as string. | |
| GList * | uhc_used |
| List of used UHCs as ``struct used_uhc''. | |
| struct { | |
| const gchar * uhc | |
| } | boot_hosts [] |
| The following hosts are there for bootstrapping purposes only. | |
| gboolean | uhc_connecting = FALSE |
|
|
Maximum connection / resolution attempts.
|
|
|
Frequency of contacts for an UHC (secs).
|
|
|
Host cache timeout, milliseconds.
|
|
|
|
|
|
Cleanup during process termination.
|
|
||||||||||||||||
|
Parse hostname:port and return the hostname and port parts.
|
|
|
Get more hosts to connect to from UDP host caches, asynchronously.
|
|
||||||||||||||||
|
Callback for adns_resolve(), invoked when the resolution is complete.
|
|
|
Initializations.
|
|
||||||||||||||||
|
Called when a pong with an "IPP" extension was received.
|
|
|
Check whether we're waiting for some UDP host cache pongs.
|
|
|
Pick host at random among the host array.
|
|
||||||||||||
|
Callout queue callback, invoked when the ping was sent and we did not get a reply within the specified timeout.
|
|
|
Send an UDP ping to the host cache.
|
|
|
Try a random host cache.
|
|
|
|
|
|
|
|
|
The following hosts are there for bootstrapping purposes only.
|
|
|
|
|
|
List of UHCs as string.
|
|
|
|
|
|
Request context, used when we decide to get hosts via the UDP host caches. It keeps track of the amount of messages we sent, and which GUID we used in the pings. |
|
|
List of used UHCs as ``struct used_uhc''.
|
1.3.9.1