2
* $Id: hcache.h,v 1.5 2005/06/25 01:37:42 daichik Exp $
4
* Copyright (c) 2001-2003, Raphael Manfredi, Richard Eckart
6
*----------------------------------------------------------------------
7
* This file is part of gtk-gnutella.
9
* gtk-gnutella is free software; you can redistribute it and/or modify
10
* it under the terms of the GNU General Public License as published by
11
* the Free Software Foundation; either version 2 of the License, or
12
* (at your option) any later version.
14
* gtk-gnutella is distributed in the hope that it will be useful,
15
* but WITHOUT ANY WARRANTY; without even the implied warranty of
16
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17
* GNU General Public License for more details.
19
* You should have received a copy of the GNU General Public License
20
* along with gtk-gnutella; if not, write to the Free Software
22
* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
23
*----------------------------------------------------------------------
26
#ifndef _if_core_hcache_h_
27
#define _if_core_hcache_h_
36
HCACHE_FRESH_ANY = 0, /**< Fresh hosts to which we did not
37
yet try to connect. */
38
HCACHE_VALID_ANY, /**< All the Gnet nodes to which we were able to
39
connect and transmit at least one packet
40
(indicating a successful handshake). */
41
HCACHE_FRESH_ULTRA, /**< Fresh ultra nodes to which we did not
42
yet try to connect. (X-Try-Ultrapeer)*/
43
HCACHE_VALID_ULTRA, /**< Valid ultra nodes */
44
HCACHE_TIMEOUT, /**< We put in this list all the Gnet nodes which
45
gave us a timeout during connection. */
46
HCACHE_BUSY, /**< We put in this list all the Gnet nodes which
47
gave us a 503 (busy) during connection. */
59
typedef struct hcache_stats {
60
gint32 host_count; /**< Number of hosts in cache */
61
guint32 hits; /**< Hits to known hosts */
62
guint32 misses; /**< Total number of misses (added hosts) */
63
gboolean reading; /**< TRUE if currently reading from disk */
67
* Public interface, visible from the bridge.
72
void hcache_clear_host_type(host_type_t type);
73
void hcache_clear(hcache_type_t type);
74
void hcache_get_stats(hcache_stats_t *stats);
76
#endif /* CORE_SOURCES */
77
#endif /* _if_core_hcache_h_ */
79
/* vi: set ts=4 sw=4 cindent: */