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

parq.h

Go to the documentation of this file.
00001 /*
00002  * $Id: parq.h,v 1.13 2005/09/10 08:17:29 daichik Exp $
00003  *
00004  * Copyright (c) 2003, Jeroen Asselman
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_parq_h_
00037 #define _core_parq_h_
00038 
00039 #include "lib/header.h"
00040 #include "downloads.h"
00041 #include "uploads.h"
00042 
00043 #include "if/core/parq.h"
00044 
00045 #define PARQ_MAX_UL_RETRY_DELAY 1200    
00046 #define PARQ_GRACE_TIME         90      
00048 /*
00049  * Public interface.
00050  */
00051 
00052 void parq_init(void);
00053 void parq_close(void);
00054 
00055 const gchar *get_parq_dl_id(const struct download *d);
00056 void parq_dl_reparent_id(struct download *d, struct download *cd);
00057 
00058 gpointer parq_dl_create(struct download *d);
00059 void parq_dl_add_id(struct download *d, const gchar *new_id);
00060 void parq_dl_remove(struct download *d);
00061 void parq_dl_free(struct download *d);
00062 
00063 void parq_download_retry_active_queued(struct download *d);
00064 gboolean parq_download_supports_parq(header_t *header);
00065 gboolean parq_download_parse_queue_status(struct download *d, header_t *header);
00066 gboolean parq_download_is_active_queued(struct download *d);
00067 void parq_download_add_header(
00068         gchar *buf, size_t len, size_t *rw, struct download *d);
00069 gboolean parq_download_is_passive_queued(struct download *d);
00070 void parq_download_queue_ack(struct gnutella_socket *s);
00071 
00072 void parq_upload_timer(time_t now);
00073 void parq_upload_add_header(
00074     gchar *buf, gint *retval, gpointer arg, guint32 flags);
00075 void parq_upload_add_header_id(
00076     gchar *buf, gint *retval, gpointer arg, guint32 flags);
00077 gpointer parq_upload_get(
00078     gnutella_upload_t *u, header_t *header, gboolean replacing);
00079 gboolean parq_upload_request(gnutella_upload_t *u, guint used_slots);
00080 gboolean parq_upload_request_force(gnutella_upload_t *u, gpointer handle,
00081       guint used_slots);
00082 guint parq_upload_lookup_position(const gnutella_upload_t *u);
00083 const gchar * parq_upload_lookup_id(const gnutella_upload_t *u);
00084 gboolean parq_upload_queue_full(gnutella_upload_t *u);
00085 guint parq_upload_lookup_size(const gnutella_upload_t *u);
00086 gboolean parq_upload_addr_can_proceed(const gnutella_upload_t *u);
00087 
00088 time_t parq_upload_lookup_lifetime(const gnutella_upload_t *u);
00089 time_t parq_upload_lookup_retry(const gnutella_upload_t *u);
00090 guint parq_upload_lookup_eta(const gnutella_upload_t *u);
00091 guint parq_upload_lookup_queue_no(const gnutella_upload_t *u);
00092 gboolean parq_upload_lookup_quick(const gnutella_upload_t *u);
00093 
00094 gboolean parq_upload_queued(gnutella_upload_t *u);
00095 gboolean parq_upload_remove(gnutella_upload_t *u);
00096 void parq_upload_collect_stats(const gnutella_upload_t *u);
00097 void parq_upload_upload_got_freed(gnutella_upload_t *u);
00098 void parq_upload_upload_got_cloned(gnutella_upload_t *u, gnutella_upload_t *cu);
00099 void parq_upload_force_remove(gnutella_upload_t *u);
00100 void parq_upload_add(gnutella_upload_t *u);
00101 void parq_upload_busy(gnutella_upload_t *u, gpointer handle);
00102 void parq_upload_save_queue(void);
00103 void parq_upload_send_queue_conf(gnutella_upload_t *u);
00104 
00105 gboolean parq_ul_id_sent(const gnutella_upload_t *u);
00106 
00107 time_t parq_banned_source_expire(const host_addr_t addr);
00108 
00109 #endif /* _core_parq_h_ */

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