Add support for brotli compression.
More...
#include <talloc.h>
#include <brotli/encode.h>
#include <brotli/decode.h>
#include <freeradius-devel/util/atexit.h>
#include <freeradius-devel/util/value.h>
#include <freeradius-devel/server/module_rlm.h>
#include <freeradius-devel/server/cf_parse.h>
#include <freeradius-devel/unlang/xlat.h>
#include <freeradius-devel/unlang/xlat_func.h>
Go to the source code of this file.
|
static int | block_bits_parse (TALLOC_CTX *ctx, void *out, void *parent, CONF_ITEM *ci, conf_parser_t const *rule) |
|
static TALLOC_CTX * | brotli_pool_get (void) |
|
static void * | brotli_talloc_alloc (void *uctx, size_t size) |
|
static void | brotli_talloc_free (UNUSED void *uctx, void *to_free) |
|
static xlat_action_t | brotli_xlat_compress (TALLOC_CTX *ctx, fr_dcursor_t *out, xlat_ctx_t const *xctx, request_t *request, fr_value_box_list_t *args) |
| Produce a brotli compressed string. More...
|
|
static xlat_action_t | brotli_xlat_decompress (TALLOC_CTX *ctx, fr_dcursor_t *out, xlat_ctx_t const *xctx, request_t *request, fr_value_box_list_t *args) |
| Decompress a brotli string. More...
|
|
static int | mod_bootstrap (module_inst_ctx_t const *mctx) |
|
static int | quality_parse (TALLOC_CTX *ctx, void *out, void *parent, CONF_ITEM *ci, conf_parser_t const *rule) |
|
static int | window_bits_parse (TALLOC_CTX *ctx, void *out, void *parent, CONF_ITEM *ci, conf_parser_t const *rule) |
|
Add support for brotli compression.
- Id
- 7b3928c13189dbc7d818be506d729cc2f74c4811
- Copyright
- 2024 The FreeRADIUS server project
-
2024 Arran Cudbard-Bell a.cud.nosp@m.bard.nosp@m.b@fre.nosp@m.erad.nosp@m.ius.o.nosp@m.rg
Definition in file rlm_brotli.c.
◆ rlm_brotli_compress_t
struct rlm_brotli_compress_t |
Definition at line 47 of file rlm_brotli.c.
Data Fields |
int |
block_bits |
Default block bits to use when compressing data. |
bool |
block_bits_is_set |
Whether block_bits has been set. |
BrotliEncoderMode |
mode |
Default mode to use when compressing data. |
int |
quality |
Default quality to use when compressing data. |
int |
window_bits |
Default window bits to use when compressing data. |
◆ rlm_brotli_decompress_t
struct rlm_brotli_decompress_t |
Definition at line 55 of file rlm_brotli.c.
Data Fields |
size_t |
max_size |
Maximum amount we attempt to decode. |
◆ rlm_brotli_t
◆ LOG_PREFIX
◆ block_bits_parse()
static int block_bits_parse |
( |
TALLOC_CTX * |
ctx, |
|
|
void * |
out, |
|
|
void * |
parent, |
|
|
CONF_ITEM * |
ci, |
|
|
conf_parser_t const * |
rule |
|
) |
| |
|
static |
◆ brotli_pool_get()
static TALLOC_CTX* brotli_pool_get |
( |
void |
| ) |
|
|
inlinestatic |
◆ brotli_talloc_alloc()
static void* brotli_talloc_alloc |
( |
void * |
uctx, |
|
|
size_t |
size |
|
) |
| |
|
static |
◆ brotli_talloc_free()
static void brotli_talloc_free |
( |
UNUSED void * |
uctx, |
|
|
void * |
to_free |
|
) |
| |
|
static |
◆ mod_bootstrap()
◆ quality_parse()
static int quality_parse |
( |
TALLOC_CTX * |
ctx, |
|
|
void * |
out, |
|
|
void * |
parent, |
|
|
CONF_ITEM * |
ci, |
|
|
conf_parser_t const * |
rule |
|
) |
| |
|
static |
◆ window_bits_parse()
static int window_bits_parse |
( |
TALLOC_CTX * |
ctx, |
|
|
void * |
out, |
|
|
void * |
parent, |
|
|
CONF_ITEM * |
ci, |
|
|
conf_parser_t const * |
rule |
|
) |
| |
|
static |
◆ brotli_mode
Initial value:= {
{
L(
"font"), BROTLI_MODE_FONT },
{
L(
"generic"), BROTLI_MODE_GENERIC },
{
L(
"text"), BROTLI_MODE_TEXT },
}
#define L(_str)
Helper for initialising arrays of string literals.
Definition at line 65 of file rlm_brotli.c.
◆ brotli_mode_len
◆ brotli_pool
_Thread_local TALLOC_CTX* brotli_pool |
|
static |
Thread-local pool for brotli state.
Definition at line 94 of file rlm_brotli.c.
◆ brotli_xlat_compress_args
Initial value:= {
}
@ FR_TYPE_OCTETS
Raw octets.
#define XLAT_ARG_PARSER_TERMINATOR
Definition at line 171 of file rlm_brotli.c.
◆ brotli_xlat_decompress_args
◆ module_compress_config
Initial value:= {
}
int cf_table_parse_int(UNUSED TALLOC_CTX *ctx, void *out, UNUSED void *parent, CONF_ITEM *ci, conf_parser_t const *rule)
Generic function for parsing conf pair values as int.
#define CONF_PARSER_TERMINATOR
#define FR_CONF_OFFSET(_name, _struct, _field)
conf_parser_t which parses a single CONF_PAIR, writing the result to a field in a struct
#define FR_CONF_OFFSET_IS_SET(_name, _type, _flags, _struct, _field)
conf_parser_t which parses a single CONF_PAIR, writing the result to a field in a struct,...
@ FR_TYPE_INT32
32 Bit signed integer.
static int block_bits_parse(TALLOC_CTX *ctx, void *out, void *parent, CONF_ITEM *ci, conf_parser_t const *rule)
static fr_table_num_sorted_t const brotli_mode[]
static int window_bits_parse(TALLOC_CTX *ctx, void *out, void *parent, CONF_ITEM *ci, conf_parser_t const *rule)
static int quality_parse(TALLOC_CTX *ctx, void *out, void *parent, CONF_ITEM *ci, conf_parser_t const *rule)
Definition at line 72 of file rlm_brotli.c.
◆ module_config
Initial value:= {
}
#define FR_CONF_OFFSET_SUBSECTION(_name, _flags, _struct, _field, _subcs)
conf_parser_t which populates a sub-struct using a CONF_SECTION
static const conf_parser_t module_decompress_config[]
static const conf_parser_t module_compress_config[]
Definition at line 86 of file rlm_brotli.c.
◆ module_decompress_config
Initial value:= {
}
#define FR_CONF_OFFSET_TYPE_FLAGS(_name, _type, _flags, _struct, _field)
conf_parser_t which parses a single CONF_PAIR, writing the result to a field in a struct
@ FR_TYPE_SIZE
Unsigned integer capable of representing any memory address on the local system.
Definition at line 81 of file rlm_brotli.c.
◆ rlm_brotli
Initial value:= {
.common = {
.name = "brotli",
}
}
#define MODULE_MAGIC_INIT
Stop people using different module/library/server versions together.
static const conf_parser_t config[]
static int mod_bootstrap(module_inst_ctx_t const *mctx)
static const conf_parser_t module_config[]
Definition at line 407 of file rlm_brotli.c.