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

hcache.h

Go to the documentation of this file.
00001 /*
00002  * $Id: hcache.h,v 1.9 2005/11/09 19:16:53 cbiere Exp $
00003  *
00004  * Copyright (c) 2002-2003, Raphael Manfredi, Richard Eckart
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 
00037 #ifndef _core_hcache_h_
00038 #define _core_hcache_h_
00039 
00040 #include "common.h"
00041 
00042 #include "if/core/hcache.h"
00043 #include "if/core/hosts.h"
00044 
00045 /*
00046  * Global Functions
00047  */
00048 
00049 void hcache_init(void);
00050 void hcache_shutdown(void);
00051 void hcache_close(void);
00052 void hcache_retrieve_all(void);
00053 
00054 void hcache_timer(time_t now);
00055 
00056 const gchar *host_type_to_string(host_type_t type);
00057 const gchar *hcache_type_to_string(hcache_type_t type);
00058 
00059 gboolean hcache_add(
00060     hcache_type_t type, const host_addr_t addr, guint16 port,
00061     const gchar *what);
00062 
00063 gboolean hcache_add_caught(
00064     host_type_t type, const host_addr_t addr, guint16 port,
00065     const gchar *what);
00066 
00067 gboolean hcache_add_valid(
00068     host_type_t type, const host_addr_t addr, guint16 port,
00069     const gchar *what);
00070 
00071 gboolean hcache_node_is_bad(const host_addr_t addr);
00072 
00073 void hcache_prune(hcache_type_t type);
00074 
00075 gboolean hcache_read_finished(void);
00076 gint hcache_size(host_type_t type);
00077 gboolean hcache_is_low(host_type_t type);
00078 
00079 gint hcache_fill_caught_array(
00080     host_type_t type, gnet_host_t *hosts, gint hcount);
00081 
00082 void hcache_get_caught(host_type_t type, host_addr_t *addr, guint16 *port);
00083 gboolean hcache_find_nearby(host_type_t type,
00084     host_addr_t *addr, guint16 *port);
00085 
00086 void hcache_store_if_dirty(host_type_t type);
00087 
00088 #endif /* _core_hcache_h_ */
00089 

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