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

pcache.h

Go to the documentation of this file.
00001 /*
00002  * $Id: pcache.h 13834 2007-06-16 01:30:05Z cbiere $
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 
00036 #ifndef _core_pcache_h_
00037 #define _core_pcache_h_
00038 
00039 #include "common.h"
00040 #include "hcache.h"
00041 #include "if/core/nodes.h"
00042 #include "gnutella.h"
00043 
00044 struct gnutella_node;
00045 
00049 typedef struct pong_meta {
00050     guchar vendor[4];     
00051     guchar language[2];   
00052     guchar country[2];    
00053     guint8 guess;         
00055     host_addr_t ipv6_addr;      
00057     host_addr_t sender_addr;    
00058     guint16 sender_port;        
00060     guint32 daily_uptime; 
00061     guint8 up_slots;      
00062     guint8 leaf_slots;    
00063     guint8 version_up;    
00064     guint8 version_ua;    
00065     guint8 flags;         
00066 } pong_meta_t;
00067 
00068 enum {
00069     PONG_META_HAS_VC    = (1 << 0), 
00070     PONG_META_HAS_GUE   = (1 << 1), 
00071     PONG_META_HAS_UP    = (1 << 2), 
00072     PONG_META_HAS_LOC   = (1 << 3), 
00073     PONG_META_HAS_DU    = (1 << 4), 
00074     PONG_META_HAS_IPV6  = (1 << 5), 
00075     PONG_META_HAS_TLS   = (1 << 6)  
00076 };
00077 
00082 gnutella_msg_init_t *build_ping_msg(
00083     const gchar *muid, guint8 ttl, gboolean uhc, guint32 *size);
00084 
00085 /*
00086  * Public interface.
00087  */
00088 
00089 void pcache_init(void);
00090 void pcache_close(void);
00091 void pcache_set_peermode(node_peer_t mode);
00092 void pcache_possibly_expired(time_t now);
00093 void pcache_outgoing_connection(struct gnutella_node *n);
00094 void pcache_ping_received(struct gnutella_node *n);
00095 void pcache_pong_received(struct gnutella_node *n);
00096 void pcache_pong_fake(struct gnutella_node *n,
00097     const host_addr_t addr, guint16 port);
00098 gboolean pcache_get_recent(host_type_t type, host_addr_t *addr, guint16 *port);
00099 void pcache_clear_recent(host_type_t type);
00100 
00101 #endif /* _core_pcache_h_ */
00102 /* vi: set ts=4 sw=4 cindent: */

Generated on Sat Jun 30 17:53:23 2007 for gtk-gnutella by  doxygen 1.3.9.1