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

vmsg.h File Reference


Detailed Description

Vendor-specific messages.

Author:
Raphael Manfredi
Date:
2003

#include "common.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, size_t 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_features_supported (struct gnutella_node *n)
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, const 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, const 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, const gchar *muid, guint8 want, const struct array *token)
 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)
void vmsg_send_node_info_ans (struct gnutella_node *n, const struct rnode_info *ri)
void vmsg_send_head_ping (const struct sha1 *sha1, host_addr_t addr, guint16 port, const gchar *guid)
 Send a "HEAD Ping" -- LIME/23v1.
pmsgvmsg_build_oob_reply_ind (const gchar *muid, guint8 hits, gboolean secure)
 Build an "OOB Reply Indication" message.
void vmsg_init (void)
 Initialize vendor messages.
void vmsg_close (void)


Function Documentation

struct pmsg* vmsg_build_oob_reply_ind const gchar *  muid,
guint8  hits,
gboolean  secure
 

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.
secure TRUE -> secure OOB; FALSE -> normal OOB.

void vmsg_close void   ) 
 

void vmsg_handle struct gnutella_node n  ) 
 

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

const gchar* vmsg_infostr gconstpointer  data,
size_t  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_features_supported struct gnutella_node n  ) 
 

void vmsg_send_head_ping const struct sha1 sha1,
host_addr_t  addr,
guint16  port,
const gchar *  guid
 

Send a "HEAD Ping" -- LIME/23v1.

This message is used to gather information about an urn:sha1, such as getting more alternate location, or the list of available ranges.

Parameters:
sha1 the SHA1 we wish to know more about
addr the host to send the Ping to.
port the port to send the Ping to
guid (optional) the GUID of the node to which HEAD ping must be sent
When the optional GUID is set, it means we're sending this message to a push-proxy, so it can relay the message to the leaf bearing that GUID.

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_node_info_ans struct gnutella_node n,
const struct rnode_info ri
 

void vmsg_send_oob_reply_ack struct gnutella_node n,
const gchar *  muid,
guint8  want,
const struct array token
 

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").

We signal that we support "deflated UDP", so that remote servent can compress the query hits if necessary and if supported.

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,
const 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,
const 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 Sat Jun 30 17:53:32 2007 for gtk-gnutella by  doxygen 1.3.9.1