00001 /* 00002 * $Id: hcache.h,v 1.5 2005/06/25 01:37:42 daichik Exp $ 00003 * 00004 * Copyright (c) 2001-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 00026 #ifndef _if_core_hcache_h_ 00027 #define _if_core_hcache_h_ 00028 00029 #include <glib.h> 00030 00031 /*** 00032 *** Gnet host cache 00033 ***/ 00034 00035 typedef enum { 00036 HCACHE_FRESH_ANY = 0, 00038 HCACHE_VALID_ANY, 00041 HCACHE_FRESH_ULTRA, 00043 HCACHE_VALID_ULTRA, 00044 HCACHE_TIMEOUT, 00046 HCACHE_BUSY, 00048 HCACHE_UNSTABLE, 00049 HCACHE_NONE, 00050 HCACHE_MAX 00051 } hcache_type_t; 00052 00053 typedef enum { 00054 HOST_ANY, 00055 HOST_ULTRA, 00056 HOST_MAX 00057 } host_type_t; 00058 00059 typedef struct hcache_stats { 00060 gint32 host_count; 00061 guint32 hits; 00062 guint32 misses; 00063 gboolean reading; 00064 } hcache_stats_t; 00065 00066 /* 00067 * Public interface, visible from the bridge. 00068 */ 00069 00070 #ifdef CORE_SOURCES 00071 00072 void hcache_clear_host_type(host_type_t type); 00073 void hcache_clear(hcache_type_t type); 00074 void hcache_get_stats(hcache_stats_t *stats); 00075 00076 #endif /* CORE_SOURCES */ 00077 #endif /* _if_core_hcache_h_ */ 00078 00079 /* vi: set ts=4 sw=4 cindent: */