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

routing.h

Go to the documentation of this file.
00001 /*
00002  * $Id: routing.h,v 1.6 2005/10/20 06:39:19 cbiere Exp $
00003  *
00004  * Copyright (c) 2001-2003, Raphael Manfredi
00005  *
00006  *----------------------------------------------------------------------
00007  * This file is part of gtk-gnutella.
00008  *
00009  *  gtk-gnutella is free software; you can redistribute it and/or modify
00010  *  it under the terms of the GNU General Public License as published by
00011  *  the Free Software Foundation; either version 2 of the License, or
00012  *  (at your option) any later version.
00013  *
00014  *  gtk-gnutella is distributed in the hope that it will be useful,
00015  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
00016  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00017  *  GNU General Public License for more details.
00018  *
00019  *  You should have received a copy of the GNU General Public License
00020  *  along with gtk-gnutella; if not, write to the Free Software
00021  *  Foundation, Inc.:
00022  *      59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
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  * Global Functions
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 /* _core_routing_h_ */
00075 /* vi: set ts=4 sw=4 cindent: */

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