#include <glib.h>
Go to the source code of this file.
Data Structures | |
struct | extvec |
A public extension descriptor. More... | |
Defines | |
#define | GGEP_NAME(x) ext_ggep_name(CAT2(EXT_T_GGEP_,x)) |
#define | GGEP_GTKG_NAME(x) ext_ggep_name(CAT2(EXT_T_GGEP_GTKG_,x)) |
#define | MAX_EXTVEC 32 /**< Maximum amount of extensions in vector */ |
Maximum amount of extensions in vector. | |
Typedefs | |
typedef enum ext_type | ext_type_t |
Known extension types. | |
typedef enum ext_token | ext_token_t |
Extension tokens. | |
typedef extvec | extvec_t |
A public extension descriptor. | |
Enumerations | |
enum | ext_type { EXT_UNKNOWN = 0, EXT_XML, EXT_HUGE, EXT_GGEP, EXT_NONE, EXT_TYPE_COUNT } |
Known extension types. More... | |
enum | ext_token { EXT_T_UNKNOWN = 0, EXT_T_URN_BITPRINT, EXT_T_URN_SHA1, EXT_T_URN_EMPTY, EXT_T_XML, EXT_T_UNKNOWN_GGEP, EXT_T_OVERHEAD, EXT_T_GGEP_LIME_XML, EXT_T_GGEP_ALT, EXT_T_GGEP_BH, EXT_T_GGEP_CT, EXT_T_GGEP_DU, EXT_T_GGEP_GTKG_IPV6, EXT_T_GGEP_GTKG_TLS, EXT_T_GGEP_GTKGV1, EXT_T_GGEP_GUE, EXT_T_GGEP_H, EXT_T_GGEP_HNAME, EXT_T_GGEP_IP, EXT_T_GGEP_IPP, EXT_T_GGEP_LF, EXT_T_GGEP_LOC, EXT_T_GGEP_PATH, EXT_T_GGEP_PHC, EXT_T_GGEP_PUSH, EXT_T_GGEP_SCP, EXT_T_GGEP_T, EXT_T_GGEP_UDPHC, EXT_T_GGEP_UP, EXT_T_GGEP_VC, EXT_T_GGEP_u, EXT_T_TOKEN_COUNT } |
Extension tokens. More... | |
Functions | |
void | ext_init (void) |
Initialize the extension subsystem. | |
void | ext_close (void) |
Free resources used by the extension subsystem. | |
void | ext_prepare (extvec_t *exv, gint exvcnt) |
Prepare the vector for parsing, by ensuring the `opaque' pointers are all set to NULL. | |
gint | ext_parse (gchar *buf, gint len, extvec_t *exv, gint exvcnt) |
Parse extension block of `len' bytes starting at `buf' and fill the supplied extension vector `exv', whose size is `exvcnt' entries. | |
void | ext_reset (extvec_t *exv, gint exvcnt) |
Reset an extension vector by disposing of the opaque structures and of any allocated "virtual" payload. | |
gboolean | ext_is_printable (const extvec_t *e) |
gboolean | ext_is_ascii (const extvec_t *e) |
gboolean | ext_has_ascii_word (const extvec_t *e) |
void | ext_dump (FILE *fd, const extvec_t *extvec, gint extcnt, const gchar *prefix, const gchar *postfix, gboolean payload) |
Dump all extensions in vector to specified stdio stream. | |
const gchar * | ext_payload (const extvec_t *e) |
guint16 | ext_paylen (const extvec_t *e) |
const gchar * | ext_base (const extvec_t *e) |
guint16 | ext_headlen (const extvec_t *e) |
guint16 | ext_len (const extvec_t *e) |
const gchar * | ext_ggep_id_str (const extvec_t *e) |
const gchar * | ext_ggep_name (ext_token_t id) |
|
|
|
|
|
Maximum amount of extensions in vector.
|
|
Extension tokens.
|
|
Known extension types.
|
|
A public extension descriptor. An extension block is structured thustly:
To be able to transparently handle decompression and COBS decoding of GGEP extensions, the public structure exposes no data fields. Everything must be fetched through accessors, which will make COBS and decompression invisible. Each of the fields shown above can be accessed via ext_xxx(). For instance, access to the payload must be made through ext_payload(), and access to the whole length via ext_len(). |
|
|
Known extension types.
|
|
|
|
Free resources used by the extension subsystem.
|
|
Dump all extensions in vector to specified stdio stream. The `prefix' and `postfix' strings, if non-NULL, are emitted before and after the extension summary. If `payload' is true, the payload is dumped in hexadecimal if it contains non-printable characters, as text otherwise. |
|
|
|
|
|
|
|
|
|
Initialize the extension subsystem.
|
|
|
|
|
|
|
|
Parse extension block of `len' bytes starting at `buf' and fill the supplied extension vector `exv', whose size is `exvcnt' entries.
|
|
|
|
|
|
Prepare the vector for parsing, by ensuring the `opaque' pointers are all set to NULL.
|
|
Reset an extension vector by disposing of the opaque structures and of any allocated "virtual" payload.
|