00001 
00002 
00003 
00004 
00005 
00006 
00007 
00008 
00009 
00010 
00011 
00012 
00013 
00014 
00015 
00016 
00017 
00018 
00019 
00020 
00021 
00022 
00023 
00024 
00025 
00026 #ifndef _core_routing_h_
00027 #define _core_routing_h_
00028 
00029 #include <glib.h>
00030 
00035 typedef enum {
00036     ROUTE_NONE = 0,         
00037     ROUTE_ONE,              
00038     ROUTE_ALL_BUT_ONE,      
00039     ROUTE_MULTI,            
00040     ROUTE_NO_DUPS_BUT_ONE,  
00041 } route_type_t;
00042 
00047 struct route_dest {
00048     route_type_t type;
00049     union {
00050         struct gnutella_node *u_node;
00051         GSList *u_nodes;    
00052     } ur;
00053 };
00054 
00055 
00056 
00057 
00058 
00059 struct gnutella_header;
00060 
00061 void routing_init(void);
00062 void routing_close(void);
00063 void message_set_muid(struct gnutella_header *header, guint8 function);
00064 gboolean route_message(struct gnutella_node **, struct route_dest *);
00065 void routing_node_remove(struct gnutella_node *);
00066 void message_add(const gchar *, guint8, struct gnutella_node *);
00067 GSList *route_towards_guid(const gchar *guid);
00068 gboolean route_exists_for_reply(const gchar *muid, guint8 function);
00069 
00070 gboolean route_proxy_add(gchar *guid, struct gnutella_node *n);
00071 void route_proxy_remove(gchar *guid);
00072 struct gnutella_node *route_proxy_find(gchar *guid);
00073 
00074 #endif 
00075