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

ggep_type.h

Go to the documentation of this file.
00001 /*
00002  * $Id: ggep_type.h,v 1.10 2005/08/17 13:44:05 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_ggep_type_h_
00037 #define _core_ggep_type_h_
00038 
00039 #include <glib.h>
00040 #include "lib/host_addr.h"
00041 
00046 typedef enum ggept_status {
00047     GGEP_OK = 0,                    
00048     GGEP_NOT_FOUND = 1,             
00049     GGEP_INVALID = 2,               
00050     GGEP_BAD_SIZE = 3               
00051 } ggept_status_t;
00052 
00053 /*
00054  * Public interface.
00055  */
00056 
00057 struct gnutella_host;
00058 
00059 ggept_status_t ggept_h_sha1_extract(extvec_t *exv, gchar *buf, gint len);
00060 
00062 struct ggep_gtkgv1 {
00063     guint8 major;
00064     guint8 minor;
00065     guint8 patch;
00066     guint8 revchar;
00067     guint32 release;
00068     guint32 start;
00069 };
00070 
00071 ggept_status_t ggept_gtkgv1_extract(extvec_t *exv, struct ggep_gtkgv1 *info);
00072 ggept_status_t ggept_hname_extract(extvec_t *exv, gchar *buf, gint len);
00073 ggept_status_t ggept_lf_extract(extvec_t *exv, guint64 *fs);
00074 ggept_status_t ggept_du_extract(extvec_t *exv, guint32 *uptime);
00075 ggept_status_t ggept_gtkg_ipv6_extract(extvec_t *exv, host_addr_t *addr);
00076 
00077 ggept_status_t ggept_alt_extract(extvec_t *exv,
00078     struct gnutella_host **hvec, gint *hvcnt);
00079 
00080 ggept_status_t ggept_push_extract(extvec_t *exv,
00081     struct gnutella_host **hvec, gint *hvcnt);
00082 
00083 gint ggept_lf_encode(guint64 filesize, gchar *data);
00084 gint ggept_du_encode(guint32 uptime, gchar *data);
00085 
00086 #endif  /* _core_ggep_type_h_ */
00087 
00088 /* vi: set ts=4 sw=4 cindent: */

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