Main Page | Modules | Alphabetical List | Data Structures | Directories | 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 "sockets.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   (11*60*1000)
 11 minutes at most

Typedefs

typedef enum oob_proxy_rec_magic oob_proxy_rec_magic_t

Enumerations

enum  oob_proxy_rec_magic { OOB_PROXY_REC_MAGIC = 0xe3c9bc13U }

Functions

void oob_proxy_rec_check (const struct oob_proxy_rec *const opr)
oob_proxy_recoob_proxy_rec_make (const gchar *leaf_muid, const gchar *proxied_muid, const node_id_t 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, const gchar *muid, gint hits, gboolean uu_udp_firewalled, const struct array *token)
 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.
const gchar * oob_proxy_muid_proxied (const 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
 Table recording the proxied OOB query MUID.


Define Documentation

#define PROXY_EXPIRE_MS   (11*60*1000)
 

11 minutes at most


Typedef Documentation

typedef enum oob_proxy_rec_magic oob_proxy_rec_magic_t
 


Enumeration Type Documentation

enum oob_proxy_rec_magic
 

Enumeration values:
OOB_PROXY_REC_MAGIC 


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.

const gchar* oob_proxy_muid_proxied const gchar *  muid  ) 
 

Check whether MUID is for an OOB-proxied query.

Returns:
NULL if the MUID is unknown, otherwise the original leaf MUID.

gboolean oob_proxy_pending_results gnutella_node_t n,
const gchar *  muid,
gint  hits,
gboolean  uu_udp_firewalled,
const struct array token
 

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_check const struct oob_proxy_rec *const   opr  )  [static]
 

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,
const node_id_t  node_id
[static]
 

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


Variable Documentation

GHashTable* proxied_queries [static]
 

Table recording the proxied OOB query MUID.


Generated on Sat Jun 30 17:53:29 2007 for gtk-gnutella by  doxygen 1.3.9.1