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

pcache.h

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

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