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

search.h File Reference


Detailed Description

Search handling (core side).

Author:
Raphael Manfredi
Date:
2001-2003

#include "nodes.h"

Go to the source code of this file.

Defines

#define QUERY_SPEED_MARK   0x0080 /**< Field is special: not a speed */
 Field is special: not a speed.

#define QUERY_SPEED_FIREWALLED   0x0040 /**< Issuing servent is firewalled */
 Issuing servent is firewalled.

#define QUERY_SPEED_NO_XML   0x0020 /**< No XML in result set, please */
 No XML in result set, please.

#define QUERY_SPEED_LEAF_GUIDED   0x0010 /**< Leaf-guided query */
 Leaf-guided query.

#define QUERY_SPEED_GGEP_H   0x0008 /**< Recipient understands GGEP "H" */
 Recipient understands GGEP "H".

#define QUERY_SPEED_OOB_REPLY   0x0004 /**< Out-of-band reply possible */
 Out-of-band reply possible.

#define QUERY_SPEED_FW_TO_FW   0x0002 /**< Can do fw to fw transfers */
 Can do fw to fw transfers.

#define QUERY_FW2FW_FILE_INDEX   0x7FFFFFFD /**< Magic index for fw-fw reqs */
 Magic index for fw-fw reqs.


Functions

void search_init (void)
void search_shutdown (void)
gboolean search_results (gnutella_node_t *n, gint *results)
 This routine is called for each Query Hit packet we receive.

gboolean search_query_allowed (gnet_search_t sh)
 Check whether we can send another query for this search.

guint32 search_get_id (gnet_search_t sh, gpointer *search)
void search_notify_sent (gpointer search, guint32 id, guint32 node_id)
 Notification from sq that a query for this search was sent to the specified node ID.

void search_add_kept (gnet_search_t sh, guint32 kept)
 The filtering side lets us know the amount of items we "kept", which are either things we display to the user or entries we used for auto-download.

gboolean search_get_kept_results (gchar *muid, guint32 *kept)
 Get amount of results we displayed for the search identified by its MUID.

guint32 search_get_kept_results_by_handle (gnet_search_t sh)
void search_oob_pending_results (gnutella_node_t *n, gchar *muid, gint hits, gboolean udp_firewalled)
 Received out-of-band indication of results for search identified by its MUID, on remote node `n'.

void search_dissociate_browse (gnet_search_t sh, gpointer download)
 Notification from the download layer that a browse-host download is being removed.

void search_browse_results (gnutella_node_t *n, gnet_search_t sh)
 This routine is called for each Query Hit packet we receive out of a browse-host request, since we know the target search result, and we don't need to bother with forwarding that message.


Define Documentation

#define QUERY_FW2FW_FILE_INDEX   0x7FFFFFFD /**< Magic index for fw-fw reqs */
 

Magic index for fw-fw reqs.

#define QUERY_SPEED_FIREWALLED   0x0040 /**< Issuing servent is firewalled */
 

Issuing servent is firewalled.

#define QUERY_SPEED_FW_TO_FW   0x0002 /**< Can do fw to fw transfers */
 

Can do fw to fw transfers.

#define QUERY_SPEED_GGEP_H   0x0008 /**< Recipient understands GGEP "H" */
 

Recipient understands GGEP "H".

#define QUERY_SPEED_LEAF_GUIDED   0x0010 /**< Leaf-guided query */
 

Leaf-guided query.

#define QUERY_SPEED_MARK   0x0080 /**< Field is special: not a speed */
 

Field is special: not a speed.

#define QUERY_SPEED_NO_XML   0x0020 /**< No XML in result set, please */
 

No XML in result set, please.

#define QUERY_SPEED_OOB_REPLY   0x0004 /**< Out-of-band reply possible */
 

Out-of-band reply possible.


Function Documentation

void search_add_kept gnet_search_t  sh,
guint32  kept
 

The filtering side lets us know the amount of items we "kept", which are either things we display to the user or entries we used for auto-download.

void search_browse_results gnutella_node_t n,
gnet_search_t  sh
 

This routine is called for each Query Hit packet we receive out of a browse-host request, since we know the target search result, and we don't need to bother with forwarding that message.

void search_dissociate_browse gnet_search_t  sh,
gpointer  download
 

Notification from the download layer that a browse-host download is being removed.

This closes the relationship between the given search and the removed download.

guint32 search_get_id gnet_search_t  sh,
gpointer *  search
 

Returns:
unique ID associated with search with given handle, and return the address of the search object as well.

gboolean search_get_kept_results gchar *  muid,
guint32 *  kept
 

Get amount of results we displayed for the search identified by its MUID.

We assume it is the last MUID we used for requerying if we find a search that sent a query with the MUID.

Returns:
TRUE if we found a search having sent this MUID, along with the amount of results we kept sofar for the last requery, via "kept", or FALSE if we did not find any search.

guint32 search_get_kept_results_by_handle gnet_search_t  sh  ) 
 

Returns:
amount of hits kept by the search, identified by its handle

void search_init void   ) 
 

void search_notify_sent gpointer  search,
guint32  id,
guint32  node_id
 

Notification from sq that a query for this search was sent to the specified node ID.

void search_oob_pending_results gnutella_node_t n,
gchar *  muid,
gint  hits,
gboolean  udp_firewalled
 

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

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).
udp_firewalled the remote host is UDP-firewalled and cannot receive unsolicited UDP traffic.

gboolean search_query_allowed gnet_search_t  sh  ) 
 

Check whether we can send another query for this search.

Returns:
TRUE if we can send, with the emitted counter incremented, or FALSE if the query should just be ignored.

gboolean search_results gnutella_node_t n,
gint *  results
 

This routine is called for each Query Hit packet we receive.

Returns:
whether the message should be dropped, i.e. FALSE if OK. If the message should not be dropped, `results' is filled with the amount of results contained in the query hit.

void search_shutdown void   ) 
 


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