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

core/parq.h

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

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