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

vmsg.h File Reference


Detailed Description

Vendor-specific messages.

Author:
Raphael Manfredi
Date:
2003

#include <glib.h>
#include "lib/tm.h"

Go to the source code of this file.

Functions

void vmsg_handle (struct gnutella_node *n)
 Main entry point to handle reception of vendor-specific message.

const gchar * vmsg_infostr (gconstpointer data, gint size)
 Decompiles vendor-message name given the data payload of the Gnutella message and its size.

void vmsg_send_messages_supported (struct gnutella_node *n)
 Send a "Messages Supported" message to specified node, telling it which subset of the vendor messages we can understand.

void vmsg_send_hops_flow (struct gnutella_node *n, guint8 hops)
 Send an "Hops Flow" message to specified node.

void vmsg_send_tcp_connect_back (struct gnutella_node *n, guint16 port)
 Send a "TCP Connect Back" message to specified node, telling it to connect back to us on the specified port.

void vmsg_send_udp_connect_back (struct gnutella_node *n, guint16 port)
 Send a "UDP Connect Back" message to specified node, telling it to ping us back via UDP on the specified port.

void vmsg_send_proxy_req (struct gnutella_node *n, const gchar *muid)
 Send a "Push Proxy Request" message to specified node, using supplied `muid' as the message ID (which is our GUID).

void vmsg_send_qstat_req (struct gnutella_node *n, gchar *muid)
 Send a "Query Status Request" message to specified node, using supplied `muid' as the message ID (which is the query ID).

void vmsg_send_qstat_answer (struct gnutella_node *n, gchar *muid, guint16 hits)
 Send a "Query Status Response" message to specified node.

void vmsg_send_proxy_cancel (struct gnutella_node *n)
 Send a "Push Proxy Cancel" message to specified node.

void vmsg_send_oob_reply_ack (struct gnutella_node *n, gchar *muid, guint8 want)
 Send an "OOB Reply Ack" message to specified node, informing it that we want the specified amount of hits delivered for the query identified by the MUID of the message we got (the "OOB Reply Indication").

void vmsg_send_time_sync_req (struct gnutella_node *n, gboolean ntp, tm_t *)
 Send a "Time Sync Request" message, asking them to echo back their own time so that we can compute our clock differences and measure round trip times.

void vmsg_send_time_sync_reply (struct gnutella_node *n, gboolean ntp, tm_t *)
 Send a "Time Sync Reply" message to the node, including the time at which we send back the message in the second half of the MUID.

void vmsg_send_udp_crawler_pong (struct gnutella_node *n, struct pmsg *mb)
pmsgvmsg_build_oob_reply_ind (gchar *muid, guint8 hits)
 Build an "OOB Reply Indication" message.

void vmsg_init (void)
 Initialize vendor messages.


Function Documentation

struct pmsg* vmsg_build_oob_reply_ind gchar *  muid,
guint8  hits
 

Build an "OOB Reply Indication" message.

Parameters:
muid is the query ID
hits is the number of hits we have to deliver for that query

void vmsg_handle struct gnutella_node n  ) 
 

Main entry point to handle reception of vendor-specific message.

const gchar* vmsg_infostr gconstpointer  data,
gint  size
 

Decompiles vendor-message name given the data payload of the Gnutella message and its size.

The leading bytes give us the identification unless it's too short.

Returns:
vendor message name in the form "NAME/1v1 'Known name'" as a static string.

void vmsg_init void   ) 
 

Initialize vendor messages.

void vmsg_send_hops_flow struct gnutella_node n,
guint8  hops
 

Send an "Hops Flow" message to specified node.

void vmsg_send_messages_supported struct gnutella_node n  ) 
 

Send a "Messages Supported" message to specified node, telling it which subset of the vendor messages we can understand.

We don't send information about the "Messages Supported" message itself, since this one is guaranteed to be always understood

void vmsg_send_oob_reply_ack struct gnutella_node n,
gchar *  muid,
guint8  want
 

Send an "OOB Reply Ack" message to specified node, informing it that we want the specified amount of hits delivered for the query identified by the MUID of the message we got (the "OOB Reply Indication").

void vmsg_send_proxy_cancel struct gnutella_node n  ) 
 

Send a "Push Proxy Cancel" message to specified node.

void vmsg_send_proxy_req struct gnutella_node n,
const gchar *  muid
 

Send a "Push Proxy Request" message to specified node, using supplied `muid' as the message ID (which is our GUID).

void vmsg_send_qstat_answer struct gnutella_node n,
gchar *  muid,
guint16  hits
 

Send a "Query Status Response" message to specified node.

Parameters:
n the Gnutella node to sent the message to
muid is the query ID
hits is the number of hits our filters did not drop.

void vmsg_send_qstat_req struct gnutella_node n,
gchar *  muid
 

Send a "Query Status Request" message to specified node, using supplied `muid' as the message ID (which is the query ID).

void vmsg_send_tcp_connect_back struct gnutella_node n,
guint16  port
 

Send a "TCP Connect Back" message to specified node, telling it to connect back to us on the specified port.

void vmsg_send_time_sync_reply struct gnutella_node n,
gboolean  ntp,
tm_t got
 

Send a "Time Sync Reply" message to the node, including the time at which we send back the message in the second half of the MUID.

The time in `got' is the time at which we received their request.

void vmsg_send_time_sync_req struct gnutella_node n,
gboolean  ntp,
tm_t sent
 

Send a "Time Sync Request" message, asking them to echo back their own time so that we can compute our clock differences and measure round trip times.

The time at which we send the message is included in the first half of the MUID.

If the node is an UDP node, its IP and port indicate to whom we shall send the message.

The `sent' parameter holds the initial "T1" timestamp markup.

void vmsg_send_udp_connect_back struct gnutella_node n,
guint16  port
 

Send a "UDP Connect Back" message to specified node, telling it to ping us back via UDP on the specified port.

XXX for now, we only send GTKG/7v1, although GTKG/7v2 is more compact.

void vmsg_send_udp_crawler_pong struct gnutella_node n,
struct pmsg mb
 


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