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

dq.h File Reference


Detailed Description

Dynamic querying.

Author:
Raphael Manfredi
Date:
2004

#include <glib.h>
#include "pmsg.h"
#include "qrp.h"
#include "search.h"

Go to the source code of this file.

Functions

void dq_init (void)
 Initialize dynamic querying.

void dq_close (void)
 Cleanup data structures used by dynamic querying.

void dq_launch_net (struct gnutella_node *n, struct query_hashvec *qhv)
void dq_node_removed (guint32 node_id)
 Tells us a node ID has been removed.

gboolean dq_got_results (gchar *muid, guint count)
 Called every time we successfully parsed a query hit from the network.

gboolean dq_oob_results_ind (gchar *muid, gint count)
 Called every time we get notified about the presence of some OOB hits.

void dq_oob_results_got (const gchar *muid, guint count)
 Called when OOB results were received, after dq_got_results() was called to record them.

void dq_got_query_status (gchar *muid, guint32 node_id, guint16 kept)
 Called when we get a "Query Status Response" message where the querying node informs us about the amount of results he kept after filtering.

void dq_launch_local (gnet_search_t handle, pmsg_t *mb, query_hashvec_t *qhv)
 Start new dynamic query for a local search.

void dq_search_closed (gnet_search_t handle)
 Invoked when a local search is closed.

gboolean dq_get_results_wanted (gchar *muid, guint32 *wanted)
 Called for OOB-proxied queries when we get an "OOB Reply Indication" from remote hosts.


Function Documentation

void dq_close void   ) 
 

Cleanup data structures used by dynamic querying.

gboolean dq_get_results_wanted gchar *  muid,
guint32 *  wanted
 

Called for OOB-proxied queries when we get an "OOB Reply Indication" from remote hosts.

The aim is to determine whether the query still needs results, to decide whether we'll claim the advertised results or not.

Parameters:
muid the message ID of the query
wanted where the amount of results still expected is written
Returns:
TRUE if the query is still active, FALSE if it does not exist any more, in which case nothing is returned into `wanted'.

void dq_got_query_status gchar *  muid,
guint32  node_id,
guint16  kept
 

Called when we get a "Query Status Response" message where the querying node informs us about the amount of results he kept after filtering.

Parameters:
muid is the search MUID.
node_id is the ID of the node that sent us the status response. we check that it is the one for the query, to avoid a neighbour telling us about a search it did not issue!
kept is the amount of results they kept. The special value 0xffff is a request to stop the query immediately.

gboolean dq_got_results gchar *  muid,
guint  count
 

Called every time we successfully parsed a query hit from the network.

If we have a dynamic query registered for the MUID, increase the result count.

Returns:
FALSE if the query was explicitly cancelled by the user and results should be dropped, TRUE otherwise. In other words, returns whether we should forward the results.

void dq_init void   ) 
 

Initialize dynamic querying.

void dq_launch_local gnet_search_t  handle,
pmsg_t mb,
query_hashvec_t qhv
 

Start new dynamic query for a local search.

We become the owner of the `mb' and `qhv' pointers.

void dq_launch_net struct gnutella_node n,
struct query_hashvec qhv
 

void dq_node_removed guint32  node_id  ) 
 

Tells us a node ID has been removed.

Get rid of all the queries registered for that node.

void dq_oob_results_got const gchar *  muid,
guint  count
 

Called when OOB results were received, after dq_got_results() was called to record them.

We need to undo the accounting made when dq_oob_results_ind() was called (to register unclaimed hits, which were finally claimed and parsed).

gboolean dq_oob_results_ind gchar *  muid,
gint  count
 

Called every time we get notified about the presence of some OOB hits.

The hits have not yet been claimed.

Returns:
FALSE if the query was explicitly cancelled by the user and results should not be claimed.

void dq_search_closed gnet_search_t  handle  ) 
 

Invoked when a local search is closed.


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