#include "hcache.h"
#include "if/core/nodes.h"
Go to the source code of this file.
Data Structures | |
struct | pong_meta |
Pong metadata that we try to preserve when present. More... | |
Typedefs | |
typedef pong_meta | pong_meta_t |
Pong metadata that we try to preserve when present. | |
Enumerations | |
enum | { PONG_META_HAS_VC = (1 << 0), PONG_META_HAS_GUE = (1 << 1), PONG_META_HAS_UP = (1 << 2), PONG_META_HAS_LOC = (1 << 3), PONG_META_HAS_DU = (1 << 4), PONG_META_HAS_IPV6 = (1 << 5) } |
Functions | |
gnutella_msg_init * | build_ping_msg (const gchar *muid, guint8 ttl, gboolean uhc, guint32 *size) |
Global Functions. | |
void | pcache_init (void) |
Initialization. | |
void | pcache_close (void) |
Final shutdown. | |
void | pcache_set_peermode (node_peer_t mode) |
Called when peer mode is changed to recompute the pong cache lifetime. | |
void | pcache_possibly_expired (time_t now) |
Check pong cache for expiration. | |
void | pcache_outgoing_connection (struct gnutella_node *n) |
Called when a new outgoing connection has been made. | |
void | pcache_ping_received (struct gnutella_node *n) |
Called when a ping is received from a node. | |
void | pcache_pong_received (struct gnutella_node *n) |
Called when a pong is received from a node. | |
void | pcache_pong_fake (struct gnutella_node *n, const host_addr_t addr, guint16 port) |
Fake a pong for a node from which we received an incoming connection, using the supplied IP/port. | |
gboolean | pcache_get_recent (host_type_t type, host_addr_t *addr, guint16 *port) |
Get a recent pong from the list, updating `last_returned_pong' as we go along, so that we never return twice the same pong instance. | |
void | pcache_clear_recent (host_type_t type) |
Clear the whole recent pong list. |
|
Pong metadata that we try to preserve when present.
|
|
|
|
Global Functions. By construction, hops=0 for all pings.
|
|
Clear the whole recent pong list.
|
|
Final shutdown.
|
|
Get a recent pong from the list, updating `last_returned_pong' as we go along, so that we never return twice the same pong instance. Fills `addr' and `port' with the pong value and return TRUE if we got a pong. Otherwise return FALSE. |
|
Initialization.
|
|
Called when a new outgoing connection has been made. Here needs brief description for the following list:
|
|
Called when a ping is received from a node. Here needs brief description for the following list:
|
|
Fake a pong for a node from which we received an incoming connection, using the supplied IP/port. This pong is not multiplexed to neighbours, but is used to populate our cache, so we can return its address to others, assuming that if it is making an incoming connection to us, it is really in need for other connections as well. |
|
Called when a pong is received from a node. Here needs brief description for the following list:
|
|
Check pong cache for expiration. If expiration time is reached, flush it and ping all our neighbours. |
|
Called when peer mode is changed to recompute the pong cache lifetime.
|