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

oob_proxy.c File Reference


Detailed Description

Proxified OOB queries.

Author:
Raphael Manfredi
Date:
2004

#include "common.h"
#include "oob_proxy.h"
#include "share.h"
#include "nodes.h"
#include "routing.h"
#include "settings.h"
#include "dq.h"
#include "dh.h"
#include "gnet_stats.h"
#include "vmsg.h"
#include "if/gnet_property_priv.h"
#include "lib/atoms.h"
#include "lib/cq.h"
#include "lib/endian.h"
#include "lib/walloc.h"
#include "lib/override.h"

Data Structures

struct  oob_proxy_rec
 Record keeping track of the MUID remappings happening for the proxied OOB queries. More...


Defines

#define PROXY_EXPIRE_MS   (10*60*1000) /**< 10 minutes at most */
 10 minutes at most


Functions

 RCSID ("$Id:oob_proxy.c, v 1.18 2005/08/27 14:54:27 rmanfredi Exp $")
oob_proxy_recoob_proxy_rec_make (const gchar *leaf_muid, const gchar *proxied_muid, guint32 node_id)
 Allocate new OOB proxy record to keep track of the MUID remapping.

void oob_proxy_rec_free (struct oob_proxy_rec *opr)
 Release the OOB proxy record.

void oob_proxy_rec_free_remove (struct oob_proxy_rec *opr)
 Dispose of the OOB proxy record, removing entry from the `proxied_queries' table.

void oob_proxy_rec_destroy (cqueue_t *unused_cq, gpointer obj)
 Callout queue callback to free OOB proxy record.

void oob_proxy_create (gnutella_node_t *n)
 Create a new OOB-proxied query.

gboolean oob_proxy_pending_results (gnutella_node_t *n, gchar *muid, gint hits, gboolean uu_udp_firewalled)
 Received out-of-band indication of results for search identified by its MUID, on remote node `n'.

gboolean oob_proxy_got_results (gnutella_node_t *n, guint results)
 Called when we parsed successfully a query hit packet.

gboolean oob_proxy_muid_proxied (gchar *muid)
 Check whether MUID is for an OOB-proxied query.

void oob_proxy_init (void)
 Initialize proxied out-of-band queries.

void free_oob_proxy_kv (gpointer uu_key, gpointer value, gpointer uu_udata)
 Cleanup servent -- hash table iterator callback.

void oob_proxy_close (void)
 Cleanup at shutdown time.


Variables

GHashTable * proxied_queries = NULL
 Table recording the proxied OOB query MUID.


Define Documentation

#define PROXY_EXPIRE_MS   (10*60*1000) /**< 10 minutes at most */
 

10 minutes at most


Function Documentation

void free_oob_proxy_kv gpointer  uu_key,
gpointer  value,
gpointer  uu_udata
[static]
 

Cleanup servent -- hash table iterator callback.

void oob_proxy_close void   ) 
 

Cleanup at shutdown time.

void oob_proxy_create gnutella_node_t n  ) 
 

Create a new OOB-proxied query.

gboolean oob_proxy_got_results gnutella_node_t n,
guint  results
 

Called when we parsed successfully a query hit packet.

Look whether the MUID of hit is actually the one of an OOB-proxied query. If it is, then route the hit directly to the leaf.

Parameters:
n the node from which the message came, and where it is held
results the amount of results in the hit.
Returns:
TRUE if we routed the packet, FALSE if we did not recognize the MUID as one of the OOB-proxied queries.

void oob_proxy_init void   ) 
 

Initialize proxied out-of-band queries.

gboolean oob_proxy_muid_proxied gchar *  muid  ) 
 

Check whether MUID is for an OOB-proxied query.

gboolean oob_proxy_pending_results gnutella_node_t n,
gchar *  muid,
gint  hits,
gboolean  uu_udp_firewalled
 

Received out-of-band indication of results for search identified by its MUID, on remote node `n'.

If the dynamic query is still alive, look whether it needs results still, and claim the pending results if necessary.

Parameters:
n the remote node which has results for us
muid the MUID of the search
hits the amount of hits available (255 mean 255+ hits).
uu_udp_firewalled the remote host is UDP-firewalled and cannot receive unsolicited UDP traffic.
Returns:
whether we know about OOB-proxied query `muid'.

void oob_proxy_rec_destroy cqueue_t unused_cq,
gpointer  obj
[static]
 

Callout queue callback to free OOB proxy record.

void oob_proxy_rec_free struct oob_proxy_rec opr  )  [static]
 

Release the OOB proxy record.

void oob_proxy_rec_free_remove struct oob_proxy_rec opr  )  [static]
 

Dispose of the OOB proxy record, removing entry from the `proxied_queries' table.

struct oob_proxy_rec* oob_proxy_rec_make const gchar *  leaf_muid,
const gchar *  proxied_muid,
guint32  node_id
[static]
 

Allocate new OOB proxy record to keep track of the MUID remapping.

RCSID "$Id:oob_proxy.  c,
v 1.18 2005/08/27 14:54:27 rmanfredi Exp $" 
 


Variable Documentation

GHashTable* proxied_queries = NULL [static]
 

Table recording the proxied OOB query MUID.


Generated on Sun Feb 12 10:50:05 2006 for Gtk-Gnutella by doxygen 1.3.6