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

pproxy.h

Go to the documentation of this file.
00001 /*
00002  * $Id: pproxy.h,v 1.5 2005/08/16 04:20:26 cbiere Exp $
00003  *
00004  * Copyright (c) 2002-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_pproxy_h_
00037 #define _core_pproxy_h_
00038 
00039 #include <glib.h>
00040 
00041 #include "if/core/pproxy.h"
00042 
00043 /***
00044  *** Server side
00045  ***/
00046 
00050 struct pproxy {
00051     struct gnutella_socket *socket;
00052     gint error_sent;        
00053     time_t last_update;
00054 
00055     host_addr_t addr;       
00056     guint16 port;           
00057     gchar *user_agent;      
00058     gchar *guid;            
00059     guint32 file_idx;       
00060     guint32 flags;
00061     gpointer io_opaque;     
00062 };
00063 
00064 #define pproxy_vendor_str(p)    ((p)->user_agent ? (p)->user_agent : "")
00065 
00066 void pproxy_add(struct gnutella_socket *s);
00067 void pproxy_remove(struct pproxy *pp,
00068     const gchar *reason, ...) G_GNUC_PRINTF(2, 3);
00069 void pproxy_timer(time_t now);
00070 void pproxy_close(void);
00071 
00072 /***
00073  *** Client side
00074  ***/
00075 
00076 struct cproxy *cproxy_create(struct download *d,
00077     const host_addr_t addr, guint16 port, gchar *guid, guint32 file_idx);
00078 void cproxy_free(struct cproxy *cp);
00079 void cproxy_reparent(struct download *d, struct download *cd);
00080 
00081 const gchar *build_push(size_t *size_ptr, guint8 ttl, guint8 hops,
00082     const gchar *guid, host_addr_t addr, guint16 port, guint32 file_idx);
00083 
00084 #endif  /* _core_pproxy_h_ */
00085 
00086 /* vi: set ts=4 sw=4 cindent: */

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