Main Page | Modules | Alphabetical List | Data Structures | File List | Data Fields | Globals | Related Pages

alive.c File Reference


Detailed Description

Alive status checking ping/pongs.

Author:
Raphael Manfredi
Date:
2002-2003

#include "common.h"
#include "alive.h"
#include "nodes.h"
#include "guid.h"
#include "gmsg.h"
#include "pmsg.h"
#include "mq.h"
#include "pcache.h"
#include "lib/atoms.h"
#include "lib/tm.h"
#include "lib/walloc.h"
#include "if/gnet_property_priv.h"
#include "lib/override.h"

Data Structures

struct  alive
 Structure used to keep track of the alive pings we sent, and stats. More...

struct  alive_ping

Defines

#define INFINITY   0xffffffff

Functions

 RCSID ("$Id:alive.c, v 1.17 2005/10/21 00:55:14 cbiere Exp $")
void alive_trim_upto (struct alive *a, GSList *item)
 Trim list of pings upto the specified linkable `item', included.

alive_pingap_make (gchar *muid)
 Create an alive_ping, with proper message ID.

void ap_free (struct alive_ping *ap)
 Free an alive_ping.

gpointer alive_make (struct gnutella_node *n, gint max)
 Create the alive structure.

void alive_free (gpointer obj)
 Dispose the alive structure.

void alive_remove_link (struct alive *a, GSList *item)
 Remove and free specified "alive ping" list entry.

void alive_ping_drop (struct alive *a, const gchar *muid)
 Drop alive ping record when message is dropped.

gboolean alive_ping_can_send (pmsg_t *mb, const mqueue_t *q)
 Test whether an alive ping can be sent.

void alive_pmsg_free (pmsg_t *mb, gpointer arg)
 Free routine for extended "alive ping" message block.

gboolean alive_send_ping (gpointer obj)
 Send new "alive" ping to node.

void ap_ack (const struct alive_ping *ap, struct alive *a)
 Acknowledge alive_ping `ap', and update roundtrip statistics in `a'.

gboolean alive_ack_ping (gpointer obj, gchar *muid)
 Got a pong that could be an acknowledge to one of our alive pings.

void alive_ack_first (gpointer obj, gchar *muid)
 Got a ping with TTL=0, that some servents decided to use when replying to an alive ping.

void alive_get_roundtrip_ms (gconstpointer obj, guint32 *avg, guint32 *last)


Define Documentation

#define INFINITY   0xffffffff
 


Function Documentation

void alive_ack_first gpointer  obj,
gchar *  muid
 

Got a ping with TTL=0, that some servents decided to use when replying to an alive ping.

gboolean alive_ack_ping gpointer  obj,
gchar *  muid
 

Got a pong that could be an acknowledge to one of our alive pings.

Returns:
TRUE if it was indeed an ACK for a ping we sent.

void alive_free gpointer  obj  ) 
 

Dispose the alive structure.

void alive_get_roundtrip_ms gconstpointer  obj,
guint32 *  avg,
guint32 *  last
 

Returns:
the average/last ping/pong roundtrip time into supplied pointers. Values are expressed in milliseconds.

gpointer alive_make struct gnutella_node n,
gint  max
 

Create the alive structure.

Returned as an opaque pointer.

gboolean alive_ping_can_send pmsg_t mb,
const mqueue_t q
[static]
 

Test whether an alive ping can be sent.

We send only the LATEST registered one.

void alive_ping_drop struct alive a,
const gchar *  muid
[static]
 

Drop alive ping record when message is dropped.

void alive_pmsg_free pmsg_t mb,
gpointer  arg
[static]
 

Free routine for extended "alive ping" message block.

void alive_remove_link struct alive a,
GSList *  item
[static]
 

Remove and free specified "alive ping" list entry.

gboolean alive_send_ping gpointer  obj  ) 
 

Send new "alive" ping to node.

Returns:
TRUE if we sent it, FALSE if there are too many ACK-pending pings.

void alive_trim_upto struct alive a,
GSList *  item
[static]
 

Trim list of pings upto the specified linkable `item', included.

void ap_ack const struct alive_ping ap,
struct alive a
[static]
 

Acknowledge alive_ping `ap', and update roundtrip statistics in `a'.

< Between sending and reception, in ms

void ap_free struct alive_ping ap  )  [static]
 

Free an alive_ping.

struct alive_ping* ap_make gchar *  muid  )  [static]
 

Create an alive_ping, with proper message ID.

RCSID "$Id:alive.  c,
v 1.17 2005/10/21 00:55:14 cbiere Exp $" 
 


Generated on Sun Feb 12 10:49:59 2006 for Gtk-Gnutella by doxygen 1.3.6