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

routing.h File Reference

#include <glib.h>

Go to the source code of this file.

Data Structures

struct  route_dest
 Routing destination, as determined by route_message(). More...


Enumerations

enum  route_type_t {
  ROUTE_NONE = 0, ROUTE_ONE, ROUTE_ALL_BUT_ONE, ROUTE_MULTI,
  ROUTE_NO_DUPS_BUT_ONE
}
 Route destination types. More...


Functions

void routing_init (void)
 Init function.

void routing_close (void)
 Destroy routing data structures.

void message_set_muid (struct gnutella_header *header, guint8 function)
 Generate a new muid and put it in a message header.

gboolean route_message (struct gnutella_node **, struct route_dest *)
 Main route computation function.

void routing_node_remove (struct gnutella_node *)
 Erase a node from the routing tables.

void message_add (const gchar *, guint8, struct gnutella_node *)
 Adds a new message in the routing tables.

GSList * route_towards_guid (const gchar *guid)
 Check whether we have a route to the given GUID, in order to send pushes.

gboolean route_exists_for_reply (const gchar *muid, guint8 function)
 Check whether we have a route for the reply that would be generated for this request.

gboolean route_proxy_add (gchar *guid, struct gnutella_node *n)
 Add push-proxy route to GUID `guid', which is node `n'.

void route_proxy_remove (gchar *guid)
 Remove push-proxy entry indexed by GUID.

gnutella_noderoute_proxy_find (gchar *guid)
 Find node to which we are connected with supplied GUID and who requested that we act as its push-proxy.


Enumeration Type Documentation

enum route_type_t
 

Route destination types.

Enumeration values:
ROUTE_NONE  No route, message stops here.
ROUTE_ONE  Route to single node.
ROUTE_ALL_BUT_ONE  Route to all nodes but one.
ROUTE_MULTI  Route to list of nodes.
ROUTE_NO_DUPS_BUT_ONE  Temporary: watch out broken GTKGs.


Function Documentation

void message_add const gchar *  muid,
guint8  function,
struct gnutella_node node
 

Adds a new message in the routing tables.

Parameters:
muid is the message MUID
function is the message type
node is the node from which we got the message, NULL if we are the node emitting it.

void message_set_muid struct gnutella_header header,
guint8  function
 

Generate a new muid and put it in a message header.

gboolean route_exists_for_reply const gchar *  muid,
guint8  function
 

Check whether we have a route for the reply that would be generated for this request.

Returns:
boolean indicating whether we have such a route.

gboolean route_message struct gnutella_node **  node,
struct route_dest dest
 

Main route computation function.

Source of message is passed by reference as `node', because it can be nullified when the node is disconnected from.

The destination of the message is computed in `dest', but the message is not physically sent. The gmsg_sendto_route() will have to be called for that.

Returns:
whether the message is to be handled locally.

gboolean route_proxy_add gchar *  guid,
struct gnutella_node n
 

Add push-proxy route to GUID `guid', which is node `n'.

Returns:
TRUE on success, FALSE if there is a GUID conflict.
Attention:
NB: assumes `guid' is already an atom linked somehow to `n'.

struct gnutella_node* route_proxy_find gchar *  guid  ) 
 

Find node to which we are connected with supplied GUID and who requested that we act as its push-proxy.

Returns:
node address if we found it, or NULL if we aren't connected to that node directly.

void route_proxy_remove gchar *  guid  ) 
 

Remove push-proxy entry indexed by GUID.

GSList* route_towards_guid const gchar *  guid  ) 
 

Check whether we have a route to the given GUID, in order to send pushes.

Returns:
NULL if we have no such route, or a list of node to which we should send the packet otherwise. It is up to the caller to free that list.

void routing_close void   ) 
 

Destroy routing data structures.

void routing_init void   ) 
 

Init function.

void routing_node_remove struct gnutella_node  ) 
 

Erase a node from the routing tables.


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