00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00036 #ifndef _if_bridge_ui2c_h_
00037 #define _if_bridge_ui2c_h_
00038
00039
00040
00041
00042
00043 #include "lib/adns.h"
00044
00045 #include "if/core/downloads.h"
00046 #include "if/core/fileinfo.h"
00047 #include "if/core/net_stats.h"
00048 #include "if/core/hcache.h"
00049 #include "if/core/hsep.h"
00050 #include "if/core/search.h"
00051 #include "if/core/share.h"
00052 #include "if/core/uploads.h"
00053 #include "if/core/bitzi.h"
00054
00055
00056 #include "if/gnet_property.h"
00057
00058
00059 #include <glib.h>
00060
00061
00062 gboolean guc_adns_resolve(
00063 const gchar *hostname, adns_callback_t user_callback, gpointer user_data);
00064
00065
00066 const gchar *guc_build_url_from_download(const struct download *d);
00067 gint guc_download_get_http_req_percent(const struct download *d);
00068 void guc_download_fallback_to_push
00069 (struct download *d, gboolean on_timeout, gboolean user_request);
00070 gint guc_download_remove_all_from_peer(gchar *guid, const host_addr_t addr,
00071 guint16 port, gboolean unavailable);
00072 gint guc_download_remove_all_named(const gchar *name);
00073 gint guc_download_remove_all_with_sha1(const gchar *sha1);
00074 void guc_download_remove_file
00075 (struct download *d, gboolean reset);
00076 gboolean guc_download_file_exists(const struct download *d);
00077 void guc_download_requeue(struct download *d);
00078 void guc_download_start
00079 (struct download *d, gboolean check_allowed);
00080 gboolean guc_download_remove(struct download *d);
00081 void guc_download_abort(struct download *d);
00082 void guc_download_resume(struct download *d);
00083 void guc_download_freeze_queue(void);
00084 void guc_download_thaw_queue(void);
00085 gint guc_download_queue_is_frozen(void);
00086 void guc_download_clear_stopped(gboolean complete,
00087 gboolean failed, gboolean unavailable, gboolean now);
00088 void guc_download_auto_new(gchar *file, filesize_t size,
00089 guint32 record_index, const host_addr_t addr, guint16 port,
00090 const gchar *guid, gchar *hostname, gchar *sha1, time_t stamp,
00091 gboolean push, gboolean file_size_known, fileinfo_t *fi,
00092 gnet_host_vec_t *proxies, guint32 flags);
00093 gboolean guc_download_new(gchar *file, filesize_t size,
00094 guint32 record_index, const host_addr_t addr, guint16 port,
00095 const gchar *guid, gchar *hostname, gchar *sha1, time_t stamp,
00096 gboolean push, fileinfo_t *fi, gnet_host_vec_t *proxies,
00097 guint32 flags);
00098 gboolean guc_download_new_uri(gchar *file, const gchar *uri, filesize_t size,
00099 const host_addr_t addr, guint16 port,
00100 const gchar *guid, gchar *hostname, gchar *sha1, time_t stamp,
00101 gboolean push, fileinfo_t *fi, gnet_host_vec_t *proxies,
00102 guint32 flags);
00103 gboolean guc_download_new_unknown_size(gchar *file,
00104 guint32 record_index, const host_addr_t addr, guint16 port,
00105 const gchar *guid, gchar *hostname, gchar *sha1, time_t stamp,
00106 gboolean push, fileinfo_t *fi, gnet_host_vec_t *proxies,
00107 guint32 flags);
00108 const gchar *guc_download_get_hostname(const struct download *d);
00109 const gchar *guc_download_get_country(const struct download *d);
00110 gdouble guc_download_source_progress(const struct download *d);
00111 gdouble guc_download_total_progress(const struct download *d);
00112 gboolean guc_download_something_to_clear(void);
00113 void guc_download_index_changed(const host_addr_t addr, guint16 port,
00114 gchar *guid, filesize_t from, filesize_t to);
00115 struct download *guc_src_get_download(gnet_src_t src_handle);
00116 void guc_src_add_listener(src_listener_t cb, gnet_src_ev_t ev,
00117 frequency_t t, guint32 interval);
00118 void guc_src_remove_listener(src_listener_t cb,
00119 gnet_src_ev_t ev);
00120
00121
00122 const gchar *guc_file_info_readable_filename(fileinfo_t *fi);
00123 gnet_fi_info_t *guc_fi_get_info(gnet_fi_t fih);
00124 void guc_fi_free_info(gnet_fi_info_t *info);
00125 void guc_fi_get_status(gnet_fi_t fih, gnet_fi_status_t *s);
00126 gchar **guc_fi_get_aliases(gnet_fi_t fih);
00127 void guc_fi_purge_by_handle_list(const GSList *list);
00128 void guc_fi_add_listener(fi_listener_t cb, gnet_fi_ev_t ev,
00129 frequency_t t, guint32 interval);
00130 void guc_fi_remove_listener(fi_listener_t cb, gnet_fi_ev_t ev);
00131 GSList *guc_fi_get_chunks(gnet_fi_t fih);
00132 void guc_fi_free_chunks(GSList *chunks);
00133 GSList *guc_fi_get_ranges(gnet_fi_t fih);
00134 void guc_fi_free_ranges(GSList *ranges);
00135 void guc_fi_add_listener(fi_listener_t cb, gnet_fi_ev_t ev,
00136 frequency_t t, guint32 interval);
00137 void guc_fi_remove_listener(fi_listener_t cb, gnet_fi_ev_t ev);
00138
00139
00140 void guc_gnet_stats_get(gnet_stats_t *stats);
00141 void guc_gnet_stats_tcp_get(gnet_stats_t *stats);
00142 void guc_gnet_stats_udp_get(gnet_stats_t *stats);
00143 void guc_gnet_get_bw_stats
00144 (gnet_bw_source type, gnet_bw_stats_t *stats);
00145
00146
00147 void guc_hcache_clear_host_type(host_type_t type);
00148 void guc_hcache_clear(hcache_type_t type);
00149 void guc_hcache_get_stats(hcache_stats_t *stats);
00150
00151
00152 gint guc_hsep_get_table_size(void);
00153 void guc_hsep_get_non_hsep_triple(hsep_triple *tripledest);
00154 const gchar *guc_hsep_get_static_str(gint row, gint column);
00155 void guc_hsep_add_global_table_listener(GCallback cb,
00156 frequency_t t, guint32 interval);
00157 void guc_hsep_remove_global_table_listener(GCallback cb);
00158
00159
00160 const gchar *guc_http_range_to_string(const GSList *list);
00161 GSList * guc_http_range_merge(GSList *old_list, GSList *new_list);
00162
00163
00164 void guc_node_add_node_added_listener
00165 (node_added_listener_t l);
00166 void guc_node_add_node_removed_listener
00167 (node_removed_listener_t l);
00168 void guc_node_add_node_info_changed_listener
00169 (node_info_changed_listener_t l);
00170 void guc_node_add_node_flags_changed_listener
00171 (node_flags_changed_listener_t l);
00172 void guc_node_remove_node_added_listener
00173 (node_added_listener_t l);
00174 void guc_node_remove_node_removed_listener
00175 (node_removed_listener_t l);
00176 void guc_node_remove_node_info_changed_listener
00177 (node_info_changed_listener_t l);
00178 void guc_node_remove_node_flags_changed_listener
00179 (node_flags_changed_listener_t l);
00180 void guc_node_add(const host_addr_t addr, guint16 port, guint32 flags);
00181 void guc_node_remove_by_handle(gnet_node_t n);
00182 void guc_node_remove_nodes_by_handle(GSList *node_list);
00183 void guc_node_get_status
00184 (const gnet_node_t n, gnet_node_status_t *s);
00185 gnet_node_info_t *guc_node_get_info(const gnet_node_t n);
00186 void guc_node_clear_info(gnet_node_info_t *info);
00187 void guc_node_free_info(gnet_node_info_t *info);
00188 void guc_node_fill_flags
00189 (gnet_node_t n, gnet_node_flags_t *flags);
00190 void guc_node_fill_info
00191 (const gnet_node_t n, gnet_node_info_t *info);
00192 void guc_node_udp_gui_show(void);
00193 void guc_node_udp_gui_remove(void);
00194
00195
00196 gint guc_get_parq_dl_position(const struct download *d);
00197 gint guc_get_parq_dl_queue_length(const struct download *d);
00198 gint guc_get_parq_dl_eta(const struct download *d);
00199 gint guc_get_parq_dl_retry_delay(const struct download *d);
00200
00201
00202 void guc_search_update_items(gnet_search_t sh, guint32 items);
00203 guint guc_search_get_lifetime(gnet_search_t sh);
00204 time_t guc_search_get_create_time(gnet_search_t sh);
00205 void guc_search_set_create_time(gnet_search_t sh, time_t t);
00206 guint32 guc_search_get_reissue_timeout(gnet_search_t sh);
00207 void guc_search_set_reissue_timeout(gnet_search_t sh, guint32 timeout);
00208 gboolean guc_search_is_passive(gnet_search_t sh);
00209 gboolean guc_search_is_active(gnet_search_t sh);
00210 gboolean guc_search_is_frozen(gnet_search_t sh);
00211 gboolean guc_search_is_expired(gnet_search_t sh);
00212 gnet_search_t guc_search_new(const gchar *query,
00213 time_t create_time, guint lifetime,
00214 guint32 reissue_timeout, flag_t flags);
00215 gboolean guc_search_browse(gnet_search_t sh,
00216 const gchar *hostname, host_addr_t addr, guint16 port,
00217 const gchar *guid, gboolean push, const gnet_host_vec_t *proxies);
00218 void guc_search_reissue(gnet_search_t sh);
00219 void guc_search_close(gnet_search_t sh);
00220 void guc_search_start(gnet_search_t sh);
00221 void guc_search_stop(gnet_search_t sh);
00222 void guc_search_add_kept(gnet_search_t sh, guint32 kept);
00223
00224
00225 const gchar *guc_settings_home_dir(void);
00226 const gchar *guc_settings_config_dir(void);
00227
00228
00229 void guc_shared_dir_add(const gchar * path);
00230 void guc_share_scan(void);
00231 guint64 guc_shared_files_scanned(void);
00232 guint64 guc_shared_kbytes_scanned(void);
00233 void guc_share_add_search_request_listener
00234 (search_request_listener_t l);
00235 void guc_share_remove_search_request_listener
00236 (search_request_listener_t l);
00237
00238
00239 gnet_upload_info_t *guc_upload_get_info(gnet_upload_t uh);
00240 void guc_upload_free_info(gnet_upload_info_t *info);
00241 void guc_upload_get_status
00242 (gnet_upload_t uh, gnet_upload_status_t *si);
00243 void guc_upload_kill(gnet_upload_t upload);
00244 void guc_upload_add_upload_added_listener
00245 (upload_added_listener_t l);
00246 void guc_upload_remove_upload_added_listener
00247 (upload_added_listener_t l);
00248 void guc_upload_add_upload_removed_listener
00249 (upload_removed_listener_t l);
00250 void guc_upload_remove_upload_removed_listener
00251 (upload_removed_listener_t l);
00252 void guc_upload_add_upload_info_changed_listener
00253 (upload_info_changed_listener_t l);
00254 void guc_upload_remove_upload_info_changed_listener
00255 (upload_info_changed_listener_t l);
00256
00257
00258 void guc_upload_stats_prune_nonexistent(void);
00259 void guc_upload_stats_clear_all(void);
00260
00262 const gchar *guc_version_get_version_string(void);
00263
00264
00265 void guc_query_bitzi_by_urn(const gchar *urnsha1);
00266 bitzi_data_t * guc_querycache_bitzi_by_urn(const gchar *urnsha1);
00267
00269 void guc_gtk_gnutella_exit(gint code);
00270
00271 #endif
00272