The FreeRADIUS server
$Id: 15bac2a4c627c01d1aa2047687b3418955ac7f00 $
|
'compositing' using talloced structures More...
#include <freeradius-devel/util/debug.h>
#include <freeradius-devel/util/ext.h>
#include <freeradius-devel/util/misc.h>
#include <freeradius-devel/util/syserror.h>
Go to the source code of this file.
Functions | |
void * | fr_ext_alloc_size (fr_ext_t const *def, void **chunk_p, int ext, size_t ext_len) |
Add a variable length extension to a talloc chunk. More... | |
void * | fr_ext_copy (fr_ext_t const *def, TALLOC_CTX **chunk_dst, TALLOC_CTX const *chunk_src, int ext) |
Copy extension data from one attribute to another. More... | |
int | fr_ext_copy_all (fr_ext_t const *def, TALLOC_CTX **chunk_dst, TALLOC_CTX const *chunk_src) |
Copy all the extensions from one attribute to another. More... | |
void | fr_ext_debug (fr_ext_t const *def, char const *name, void const *chunk) |
Print out all extensions and hexdump their contents. More... | |
size_t | fr_ext_len (fr_ext_t const *def, TALLOC_CTX const *chunk, int ext) |
Return the length of an extension. More... | |
'compositing' using talloced structures
Definition in file ext.c.
Add a variable length extension to a talloc chunk.
This is used to build a structure from a primary struct type and one or more extension structures. The memory for the composed structure is contiguous which has performance benefits, and means we don't have the overhead of talloc headers for each of the extensions.
[in] | def | Extension definitions. |
[in,out] | chunk_p | The chunk to add an extension for. Under certain circumstances the value of *chunk_p will be changed to point to a new memory block. All cached copies of the previous pointer should be updated. |
[in] | ext | to alloc. |
[in] | ext_len | The length of the extension. |
Definition at line 55 of file ext.c.
void* fr_ext_copy | ( | fr_ext_t const * | def, |
TALLOC_CTX ** | chunk_dst, | ||
TALLOC_CTX const * | chunk_src, | ||
int | ext | ||
) |
Copy extension data from one attribute to another.
[in] | def | Extension definitions. |
[in,out] | chunk_dst | to copy extension to. Under certain circumstances the value of *chunk_dst will be changed to point to a new memory block. All cached copies of the previous pointer should be updated. |
[in] | chunk_src | to copy extension from. |
[in] | ext | to copy. |
Definition at line 160 of file ext.c.
int fr_ext_copy_all | ( | fr_ext_t const * | def, |
TALLOC_CTX ** | chunk_dst, | ||
TALLOC_CTX const * | chunk_src | ||
) |
Copy all the extensions from one attribute to another.
[in] | def | Extension definitions. |
[in,out] | chunk_dst | to copy extensions to. Under certain circumstances the value of *chunk_dst will be changed to point to a new memory block. All cached copies of the previous pointer should be updated. |
[in] | chunk_src | to copy extensions from. |
Definition at line 245 of file ext.c.
void fr_ext_debug | ( | fr_ext_t const * | def, |
char const * | name, | ||
void const * | chunk | ||
) |
Print out all extensions and hexdump their contents.
This function is intended to be called from interactive debugging sessions only. It does not use the normal logging infrastructure.
[in] | def | Extension definitions. |
[in] | name | the identifier of the structure being debugged i.e da->name. |
[in] | chunk | to debug. |
Definition at line 336 of file ext.c.
Return the length of an extension.
[in] | def | Extension definitions. |
[in] | chunk | to return extension length for. |
[in] | ext | to return length for. |
Definition at line 128 of file ext.c.