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

ggep_type.h File Reference


Detailed Description

GGEP type-specific routines.

Author:
Raphael Manfredi
Date:
2002-2003

#include <glib.h>
#include "lib/host_addr.h"

Go to the source code of this file.

Data Structures

struct  ggep_gtkgv1
 Decompiled payload of "GTKGV1". More...


Typedefs

typedef enum ggept_status ggept_status_t
 Extraction interface return types.


Enumerations

enum  ggept_status { GGEP_OK = 0, GGEP_NOT_FOUND = 1, GGEP_INVALID = 2, GGEP_BAD_SIZE = 3 }
 Extraction interface return types. More...


Functions

ggept_status_t ggept_h_sha1_extract (extvec_t *exv, gchar *buf, gint len)
 Extract the SHA1 hash of the "H" extension into the supplied buffer.

ggept_status_t ggept_gtkgv1_extract (extvec_t *exv, struct ggep_gtkgv1 *info)
 Extract payload information from "GTKGV1" into `info'.

ggept_status_t ggept_hname_extract (extvec_t *exv, gchar *buf, gint len)
 Extract hostname of the "HNAME" extension into the supplied buffer.

ggept_status_t ggept_lf_extract (extvec_t *exv, guint64 *fs)
 Extract filesize length into `filesize' from GGEP "LF" extension.

ggept_status_t ggept_du_extract (extvec_t *exv, guint32 *uptime)
 Extract daily uptime into `uptime', from the GGEP "DU" extensions.

ggept_status_t ggept_gtkg_ipv6_extract (extvec_t *exv, host_addr_t *addr)
 Extract IPv6 address into `addr' from GGEP "GTKG.IPV6" extension.

ggept_status_t ggept_alt_extract (extvec_t *exv, struct gnutella_host **hvec, gint *hvcnt)
 Extract vector of IP:port alternate locations.

ggept_status_t ggept_push_extract (extvec_t *exv, struct gnutella_host **hvec, gint *hvcnt)
 Extract vector of IP:port push proxy locations.

gint ggept_lf_encode (guint64 filesize, gchar *data)
 Encode `filesize' for the GGEP "LF" extension into `data'.

gint ggept_du_encode (guint32 uptime, gchar *data)
 Encode `uptime' for the GGEP "DU" extension into `data'.


Typedef Documentation

typedef enum ggept_status ggept_status_t
 

Extraction interface return types.


Enumeration Type Documentation

enum ggept_status
 

Extraction interface return types.

Enumeration values:
GGEP_OK  OK, extracted what was asked.
GGEP_NOT_FOUND  OK, but did not find it.
GGEP_INVALID  Error, found something invalid.
GGEP_BAD_SIZE  Error, buffer not correctly sized.


Function Documentation

ggept_status_t ggept_alt_extract extvec_t exv,
struct gnutella_host **  hvec,
gint *  hvcnt
 

Extract vector of IP:port alternate locations.

Parameters:
`exv' no brief description.
`hvec' pointer is filled with a dynamically allocated vector.
`hvcnt' is filled with the size of the allocated vector (number of items).
Unless GGEP_OK is returned, no memory allocation takes place.

gint ggept_du_encode guint32  uptime,
gchar *  data
 

Encode `uptime' for the GGEP "DU" extension into `data'.

Returns:
the amount of chars written.

ggept_status_t ggept_du_extract extvec_t exv,
guint32 *  uptime
 

Extract daily uptime into `uptime', from the GGEP "DU" extensions.

ggept_status_t ggept_gtkg_ipv6_extract extvec_t exv,
host_addr_t addr
 

Extract IPv6 address into `addr' from GGEP "GTKG.IPV6" extension.

A zero length indicates IPv6 support, a length of 16 or more indicates that the first 16 bytes are a IPv6 address.

ggept_status_t ggept_gtkgv1_extract extvec_t exv,
struct ggep_gtkgv1 info
 

Extract payload information from "GTKGV1" into `info'.

ggept_status_t ggept_h_sha1_extract extvec_t exv,
gchar *  buf,
gint  len
 

Extract the SHA1 hash of the "H" extension into the supplied buffer.

Returns:
extraction status: only when GGEP_OK is returned will we have the SHA1 in buf.

< XXX temporary, until we implement tiger

ggept_status_t ggept_hname_extract extvec_t exv,
gchar *  buf,
gint  len
 

Extract hostname of the "HNAME" extension into the supplied buffer.

Returns:
extraction status: only when GGEP_OK is returned will we have extracted something in the supplied buffer.

gint ggept_lf_encode guint64  filesize,
gchar *  data
 

Encode `filesize' for the GGEP "LF" extension into `data'.

Returns:
the amount of chars written.

ggept_status_t ggept_lf_extract extvec_t exv,
guint64 *  fs
 

Extract filesize length into `filesize' from GGEP "LF" extension.

ggept_status_t ggept_push_extract extvec_t exv,
struct gnutella_host **  hvec,
gint *  hvcnt
 

Extract vector of IP:port push proxy locations.

The `hvec' pointer is filled with a dynamically allocated vector, and the `hvcnt' is filled with the size of the allocated vector (number of items).

Unless GGEP_OK is returned, no memory allocation takes place.


Generated on Sun Feb 12 10:50:01 2006 for Gtk-Gnutella by doxygen 1.3.6