|  | The FreeRADIUS server $Id: 15bac2a4c627c01d1aa2047687b3418955ac7f00 $
    | 
#include <freeradius-devel/server/tmpl.h>#include <freeradius-devel/util/dcursor.h> Include dependency graph for tmpl_dcursor.h:
 Include dependency graph for tmpl_dcursor.h:Go to the source code of this file.
| Data Structures | |
| struct | tmpl_dcursor_ctx_s | 
| Maintains state between cursor calls.  More... | |
| struct | tmpl_dcursor_nested_s | 
| State for traversing an attribute reference.  More... | |
| Macros | |
| #define | tmpl_dcursor_build_init(_err, _ctx, _cc, _cursor, _request, _vpt, _build, _uctx) _tmpl_dcursor_init(_err, _ctx, _cc, _cursor, _request, _vpt, _build, _uctx) | 
| #define | tmpl_dcursor_init(_err, _ctx, _cc, _cursor, _request, _vpt) _tmpl_dcursor_init(_err, _ctx, _cc, _cursor, _request, _vpt, NULL, NULL) | 
| Typedefs | |
| typedef fr_pair_t *(* | tmpl_dcursor_build_t) (fr_pair_t *parent, fr_dcursor_t *cursor, fr_dict_attr_t const *da, void *uctx) | 
| Callback function for populating missing pair. | |
| typedef struct tmpl_dcursor_ctx_s | tmpl_dcursor_ctx_t | 
| typedef struct tmpl_dcursor_nested_s | tmpl_dcursor_nested_t | 
| Functions | |
| fr_pair_t * | _tmpl_dcursor_init (int *err, TALLOC_CTX *ctx, tmpl_dcursor_ctx_t *cc, fr_dcursor_t *cursor, request_t *request, tmpl_t const *vpt, tmpl_dcursor_build_t build, void *uctx) | 
| Initialise a fr_dcursor_t to the fr_pair_t specified by a tmpl_t. | |
| void | tmpl_dcursor_clear (tmpl_dcursor_ctx_t *cc) | 
| Clear any temporary state allocations. | |
| fr_pair_t * | tmpl_dcursor_init_relative (int *err, TALLOC_CTX *ctx, tmpl_dcursor_ctx_t *cc, fr_dcursor_t *cursor, request_t *request, fr_pair_t *list, tmpl_t const *vpt, tmpl_dcursor_build_t build, void *uctx) | 
| Initialise a fr_dcursor_t at the specified point in a pair tree. | |
| fr_pair_t * | tmpl_dcursor_pair_build (fr_pair_t *parent, fr_dcursor_t *cursor, fr_dict_attr_t const *da, UNUSED void *uctx) | 
| Simple pair building callback for use with tmpl_dcursors. | |
| ssize_t | tmpl_dcursor_print (fr_sbuff_t *out, tmpl_dcursor_ctx_t const *cc) | 
| fr_pair_t * | tmpl_dcursor_value_box_init (int *err, TALLOC_CTX *ctx, fr_value_box_t *vb, request_t *request, tmpl_t const *vpt)) | 
| Initialize a #tmpl_dcursor_t into a fr_value_box_t. | |
| struct tmpl_dcursor_ctx_s | 
Maintains state between cursor calls.
Definition at line 62 of file tmpl_dcursor.h.
 Collaboration diagram for tmpl_dcursor_ctx_s:
 Collaboration diagram for tmpl_dcursor_ctx_s:| Data Fields | ||
|---|---|---|
| tmpl_dcursor_build_t | build | Callback to build missing pairs. | 
| TALLOC_CTX * | ctx | Temporary allocations go here. | 
| tmpl_dcursor_nested_t | leaf | Pre-allocated leaf state. We always need one of these so it doesn't make sense to allocate it later. | 
| fr_dlist_head_t | nested | Nested state. These are allocated when we need to maintain state between multiple cursor calls for a particular attribute reference. This forms a stack of tmpl_dcursor_nested_t and tracks where we are in evaluation at all levels. | 
| TALLOC_CTX * | pool | Temporary pool. | 
| fr_pair_list_t * | rel_list | List we're starting at. This could be a group deep in the request. | 
| TALLOC_CTX * | rel_list_ctx | When we need to allocate pairs in our the rel_list, we use this as the ctx. | 
| request_t * | request | Result of following the request references. | 
| void * | uctx | Context for building new pairs. | 
| tmpl_t const * | vpt | tmpl we're evaluating. | 
| struct tmpl_dcursor_nested_s | 
State for traversing an attribute reference.
Definition at line 44 of file tmpl_dcursor.h.
 Collaboration diagram for tmpl_dcursor_nested_s:
 Collaboration diagram for tmpl_dcursor_nested_s:| Data Fields | ||
|---|---|---|
| tmpl_attr_t const * | ar | Attribute reference this state entry is associated with. Mainly for debugging. | 
| fr_dcursor_t | cursor | Cursor to track where we are in the list in case we're doing counts. | 
| fr_dlist_t | entry | Entry in the dlist that forms the evaluation stack. | 
| TALLOC_CTX * | list_ctx | Track where we should be allocating attributes. | 
| size_t | num | which attribute number we are looking at | 
| bool | seen | Whether we've seen an attribute at this level of evaluation already. This is mainly used where the build cursor is used. | 
| #define tmpl_dcursor_build_init | ( | _err, | |
| _ctx, | |||
| _cc, | |||
| _cursor, | |||
| _request, | |||
| _vpt, | |||
| _build, | |||
| _uctx | |||
| ) | _tmpl_dcursor_init(_err, _ctx, _cc, _cursor, _request, _vpt, _build, _uctx) | 
Definition at line 107 of file tmpl_dcursor.h.
| #define tmpl_dcursor_init | ( | _err, | |
| _ctx, | |||
| _cc, | |||
| _cursor, | |||
| _request, | |||
| _vpt | |||
| ) | _tmpl_dcursor_init(_err, _ctx, _cc, _cursor, _request, _vpt, NULL, NULL) | 
Definition at line 104 of file tmpl_dcursor.h.
| typedef fr_pair_t *(* tmpl_dcursor_build_t) (fr_pair_t *parent, fr_dcursor_t *cursor, fr_dict_attr_t const *da, void *uctx) | 
Callback function for populating missing pair.
| [in] | parent | to allocate the new pair in. | 
| [in] | cursor | to append the pair to. | 
| [in] | da | of the attribute to create. | 
| [in] | uctx | context data. | 
Definition at line 39 of file tmpl_dcursor.h.
| typedef struct tmpl_dcursor_ctx_s tmpl_dcursor_ctx_t | 
Definition at line 28 of file tmpl_dcursor.h.
| typedef struct tmpl_dcursor_nested_s tmpl_dcursor_nested_t | 
Definition at line 29 of file tmpl_dcursor.h.
| fr_pair_t * _tmpl_dcursor_init | ( | int * | err, | 
| TALLOC_CTX * | ctx, | ||
| tmpl_dcursor_ctx_t * | cc, | ||
| fr_dcursor_t * | cursor, | ||
| request_t * | request, | ||
| tmpl_t const * | vpt, | ||
| tmpl_dcursor_build_t | build, | ||
| void * | uctx | ||
| ) | 
Initialise a fr_dcursor_t to the fr_pair_t specified by a tmpl_t.
This makes iterating over the one or more fr_pair_t specified by a tmpl_t significantly easier.
| [out] | err | May be NULL if no error code is required. Will be set to: | 
| [in] | ctx | to make temporary allocations under. | 
| [in] | cc | to initialise. Tracks evaluation state. Must be explicitly cleared with tmpl_cursor_state_clear otherwise we will leak memory. | 
| [in] | cursor | to store iterator position. | 
| [in] | request | The current request_t. | 
| [in] | vpt | specifying the fr_pair_t type or list to iterate over. | 
| [in] | build | Callback to build missing pairs. | 
| [in] | uctx | for building new pairs. | 
Definition at line 452 of file tmpl_dcursor.c.
 Here is the call graph for this function:
 Here is the call graph for this function:| void tmpl_dcursor_clear | ( | tmpl_dcursor_ctx_t * | cc | ) | 
Clear any temporary state allocations.
Definition at line 478 of file tmpl_dcursor.c.
 Here is the call graph for this function:
 Here is the call graph for this function: Here is the caller graph for this function:
 Here is the caller graph for this function:| fr_pair_t * tmpl_dcursor_init_relative | ( | int * | err, | 
| TALLOC_CTX * | ctx, | ||
| tmpl_dcursor_ctx_t * | cc, | ||
| fr_dcursor_t * | cursor, | ||
| request_t * | request, | ||
| fr_pair_t * | list, | ||
| tmpl_t const * | vpt, | ||
| tmpl_dcursor_build_t | build, | ||
| void * | uctx | ||
| ) | 
Initialise a fr_dcursor_t at the specified point in a pair tree.
This makes iterating over the one or more fr_pair_t specified by a tmpl_t significantly easier.
| [out] | err | May be NULL if no error code is required. Will be set to: | 
| [in] | ctx | to make temporary allocations under. | 
| [in] | cc | to initialise. Tracks evaluation state. Must be explicitly cleared with tmpl_cursor_state_clear otherwise we will leak memory. | 
| [in] | cursor | to store iterator position. | 
| [in] | request | the current request. | 
| [in] | list | a nested list to start evaluating from. May be the child list of a pair in the request's pair tree. | 
| [in] | vpt | specifying the fr_pair_t type or list to iterate over. | 
| [in] | build | Callback to build missing pairs. | 
| [in] | uctx | to pass to build. | 
Definition at line 371 of file tmpl_dcursor.c.
 Here is the call graph for this function:
 Here is the call graph for this function: Here is the caller graph for this function:
 Here is the caller graph for this function:| fr_pair_t * tmpl_dcursor_pair_build | ( | fr_pair_t * | parent, | 
| fr_dcursor_t * | cursor, | ||
| fr_dict_attr_t const * | da, | ||
| UNUSED void * | uctx | ||
| ) | 
Simple pair building callback for use with tmpl_dcursors.
Which always appends the new pair to the tail of the list since it is only called when no matching pairs were found when walking the list.
| [in] | parent | to allocate new pair within. | 
| [in,out] | cursor | to append new pair to. | 
| [in] | da | of new pair. | 
| [in] | uctx | unused. | 
Definition at line 562 of file tmpl_dcursor.c.
 Here is the call graph for this function:
 Here is the call graph for this function: Here is the caller graph for this function:
 Here is the caller graph for this function:| ssize_t tmpl_dcursor_print | ( | fr_sbuff_t * | out, | 
| tmpl_dcursor_ctx_t const * | cc | ||
| ) | 
Definition at line 820 of file tmpl_dcursor.c.
 Here is the call graph for this function:
 Here is the call graph for this function: Here is the caller graph for this function:
 Here is the caller graph for this function:| fr_pair_t * tmpl_dcursor_value_box_init | ( | int * | err, | 
| TALLOC_CTX * | ctx, | ||
| fr_value_box_t * | vb, | ||
| request_t * | request, | ||
| tmpl_t const * | vpt | ||
| ) | 
Initialize a #tmpl_dcursor_t into a fr_value_box_t.
The tmpl_dcursor_ctx_t and #tmpl_dcursor_t are associated with the input value-box, and will be freed when the value-box is freed.
| [out] | err | May be NULL if no error code is required. Will be set to: | 
| [in] | ctx | Where the cursor will be allocated from | 
| [in] | vb | Where the #tmpl_dursor_t is stored. | 
| [in] | request | the current request. | 
| [in] | vpt | specifying the fr_pair_t type or list to iterate over. | 
Definition at line 513 of file tmpl_dcursor.c.
 Here is the call graph for this function:
 Here is the call graph for this function: Here is the caller graph for this function:
 Here is the caller graph for this function: 1.9.8
 1.9.8