#include "extensions.h"
#include "lib/cobs.h"
#include "lib/zlib_util.h"
#include <glib.h>
Go to the source code of this file.
Data Structures | |
| struct | ggep_stream |
| Structure keeping track of incremental GGEP writes. More... | |
Defines | |
| #define | GGEP_MAGIC '\xc3' /**< GGEP extension prefix */ |
| GGEP extension prefix. | |
| #define | GGEP_F_LAST 0x80U /**< Last extension in GGEP block */ |
| Last extension in GGEP block. | |
| #define | GGEP_F_COBS 0x40U /**< Whether COBS was used on payload */ |
| Whether COBS was used on payload. | |
| #define | GGEP_F_DEFLATE 0x20U /**< Whether payload was deflated */ |
| Whether payload was deflated. | |
| #define | GGEP_F_MBZ 0x10U /**< Bits that Must Be Zero */ |
| Bits that Must Be Zero. | |
| #define | GGEP_F_IDLEN 0x0fU /**< Where ID length is stored */ |
| Where ID length is stored. | |
| #define | GGEP_L_CONT '\x80' /**< Continuation present */ |
| Continuation present. | |
| #define | GGEP_L_LAST '\x40' /**< Last byte */ |
| Last byte. | |
| #define | GGEP_L_VALUE '\x3f' /**< Value */ |
| Value. | |
| #define | GGEP_L_VSHIFT 6 |
| #define | GGEP_L_XFLAGS (GGEP_L_CONT | GGEP_L_LAST) |
| #define | GGEP_H_SHA1 0x01 /**< Binary SHA1 */ |
| Binary SHA1. | |
| #define | GGEP_H_BITPRINT 0x02 /**< Bitprint (SHA1 + Tiger tree root) */ |
| Bitprint (SHA1 + Tiger tree root). | |
| #define | GGEP_H_MD5 0x03 /**< Binary MD5 */ |
| Binary MD5. | |
| #define | GGEP_H_UUID 0x04 /**< Binary UUID (GUID-like) */ |
| Binary UUID (GUID-like). | |
| #define | GGEP_H_MD4 0x05 /**< Binary MD4 */ |
| Binary MD4. | |
| #define | GGEP_W_LAST 0x00000001 /**< This is the last extension */ |
| This is the last extension. | |
| #define | GGEP_W_COBS 0x00000002 /**< Attempt COBS encoding, if needed */ |
| Attempt COBS encoding, if needed. | |
| #define | GGEP_W_DEFLATE 0x00000004 /**< Attempt payload compression */ |
| Attempt payload compression. | |
| #define | GGEP_W_FIRST 0x00000008 /**< First extension, write GGEP_MAGIC */ |
| First extension, write GGEP_MAGIC. | |
Typedefs | |
| typedef ggep_stream | ggep_stream_t |
| Structure keeping track of incremental GGEP writes. | |
Enumerations | |
| enum | ggep_magic { GGEP_MAGIC_ID = 0x62961da4U } |
Functions | |
| gint | ggep_decode_into (extvec_t *exv, gchar *buf, size_t len) |
| void | ggep_stream_init (ggep_stream_t *gs, gpointer data, size_t len) |
| Initialize a GGEP stream object, capable of receiving multiple GGEP extensions, written into the supplied buffer. | |
| gboolean | ggep_stream_begin (ggep_stream_t *gs, const char *id, guint32 wflags) |
| gboolean | ggep_stream_writev (ggep_stream_t *gs, const struct iovec *iov, gint iovcnt) |
| The vectorized version of ggep_stream_write(). | |
| gboolean | ggep_stream_write (ggep_stream_t *gs, gconstpointer data, size_t len) |
| Write data into the payload of the extension begun with ggep_stream_begin(). | |
| gboolean | ggep_stream_end (ggep_stream_t *gs) |
| End the extension begun with ggep_stream_begin(). | |
| size_t | ggep_stream_close (ggep_stream_t *gs) |
| We're done with the stream, close it. | |
| gboolean | ggep_stream_packv (ggep_stream_t *gs, const gchar *id, const struct iovec *iov, gint iovcnt, guint32 wflags) |
| The vectorized version of ggep_stream_pack(). | |
| gboolean | ggep_stream_pack (ggep_stream_t *gs, const gchar *id, gconstpointer payload, size_t plen, guint32 wflags) |
| Pack extension data in initialized stream. | |
| gboolean | ggep_stream_is_valid (ggep_stream_t *gs) |
| Check whether a GGEP stream descriptor is valid. | |
|
|
Whether COBS was used on payload.
|
|
|
Whether payload was deflated.
|
|
|
Where ID length is stored.
|
|
|
Last extension in GGEP block.
|
|
|
Bits that Must Be Zero.
|
|
|
Bitprint (SHA1 + Tiger tree root).
|
|
|
Binary MD4.
|
|
|
Binary MD5.
|
|
|
Binary SHA1.
|
|
|
Binary UUID (GUID-like).
|
|
|
Continuation present.
|
|
|
Last byte.
|
|
|
Value.
|
|
|
|
|
|
|
|
|
GGEP extension prefix.
|
|
|
Attempt COBS encoding, if needed.
|
|
|
Attempt payload compression.
|
|
|
First extension, write GGEP_MAGIC.
|
|
|
This is the last extension.
|
|
|
Structure keeping track of incremental GGEP writes.
|
|
|
|
|
||||||||||||||||
|
|
|
||||||||||||||||
|
|
|
|
We're done with the stream, close it.
|
|
|
End the extension begun with ggep_stream_begin().
|
|
||||||||||||||||
|
Initialize a GGEP stream object, capable of receiving multiple GGEP extensions, written into the supplied buffer.
|
|
|
Check whether a GGEP stream descriptor is valid.
|
|
||||||||||||||||||||||||
|
Pack extension data in initialized stream. The extension's name is `id' and its payload is represented by `plen' bytes starting at `payload'. If `GGEP_W_COBS' is set, COBS encoding is attempted if there is a NUL byte within the payload. If `GGEP_W_DEFLATE' is set, we attempt to deflate the payload. If the output is larger than the initial size, we emit the original payload instead.
|
|
||||||||||||||||||||||||
|
The vectorized version of ggep_stream_pack().
|
|
||||||||||||||||
|
Write data into the payload of the extension begun with ggep_stream_begin().
|
|
||||||||||||||||
|
The vectorized version of ggep_stream_write().
|
1.3.6