![]() |
The FreeRADIUS server $Id: 15bac2a4c627c01d1aa2047687b3418955ac7f00 $
|
AVP parsing. More...
#include <freeradius-devel/util/skip.h>#include <freeradius-devel/util/pair.h>#include <freeradius-devel/util/proto.h>#include <freeradius-devel/util/regex.h>#include <freeradius-devel/protocol/radius/rfc2865.h>#include <freeradius-devel/protocol/freeradius/freeradius.internal.h>
Include dependency graph for pair_tokenize.c:Go to the source code of this file.
Functions | |
| static fr_pair_t * | fr_pair_afrom_fields (TALLOC_CTX *ctx, fr_dict_attr_t const *da, fr_token_t op, char const *value, size_t value_len, fr_sbuff_unescape_rules_t const *uerules) |
| Allocate a fr_pair_t based on pre-parsed fields. | |
| static ssize_t | fr_pair_afrom_str (fr_pair_ctx_t *pair_ctx, char const *start, char const *in, size_t inlen) |
| Allocate one fr_pair_t from a string, and add it to the pair_ctx cursor. | |
| ssize_t | fr_pair_ctx_afrom_str (fr_pair_ctx_t *pair_ctx, char const *in, size_t inlen) |
| Parse a pair context from a string. | |
| void | fr_pair_ctx_reset (fr_pair_ctx_t *pair_ctx, fr_dict_t const *dict) |
| Reset a pair_ctx to the dictionary root. | |
| static ssize_t | fr_pair_ctx_set (fr_pair_ctx_t *pair_ctx, char const *in, size_t inlen) |
| Set a new DA context based on the input string. | |
| static ssize_t | op_to_token (fr_token_t *token, char const *op, size_t oplen) |
AVP parsing.
Definition in file pair_tokenize.c.
|
static |
Allocate a fr_pair_t based on pre-parsed fields.
| ctx | the talloc ctx |
| da | the da for the vp |
| op | the operator |
| value | the value to parse |
| value_len | length of the value string |
| uerules | used for unescaping. |
It's just better for this function to take the broken-out / pre-parsed fields. That way the caller can do any necessary parsing.
Definition at line 144 of file pair_tokenize.c.
Here is the call graph for this function:
Here is the caller graph for this function:
|
static |
Allocate one fr_pair_t from a string, and add it to the pair_ctx cursor.
| [in,out] | pair_ctx | the parsing context |
| [in] | start | Where to create relative error offsets in relation to. |
| in | String to parse | |
| inlen | length of string to parse |
Definition at line 177 of file pair_tokenize.c.
Here is the call graph for this function:
Here is the caller graph for this function:| ssize_t fr_pair_ctx_afrom_str | ( | fr_pair_ctx_t * | pair_ctx, |
| char const * | in, | ||
| size_t | inlen | ||
| ) |
Parse a pair context from a string.
| pair_ctx | the parsing context |
| in | String to parse |
| inlen | length of string to parse |
This function will parse fr_pair_ts, or context changes, up to end of string, or a trailing ','. The caller is responsible for parsing the comma.
It accepts the following syntax:
Definition at line 375 of file pair_tokenize.c.
Here is the call graph for this function:| void fr_pair_ctx_reset | ( | fr_pair_ctx_t * | pair_ctx, |
| fr_dict_t const * | dict | ||
| ) |
Reset a pair_ctx to the dictionary root.
| pair_ctx | the parsing context |
| dict | the dictionary to reset to the root |
This function is used in order to reset contexts when parsing strings that change attribute lists. i.e. &request.foo, &reply.bar
This function is simple for now, but will get complex once we start using vp->vp_children
Definition at line 495 of file pair_tokenize.c.
Here is the call graph for this function:
|
static |
Set a new DA context based on the input string.
| [in,out] | pair_ctx | the parsing context |
| [in] | in | String to parse |
| [in] | inlen | length of string to parse |
pair_ctx->da is set to the new parsing context.
fr_dlist_t of pair_ctx, and we always operate on the last one. When we change contexts to an attributes parent, we also change pair_ctx to a parent context. This is like the da stack, but with child cursors, too.We also want to emulate the previous behavior of group attributes based on parent, and increasing child_num. i.e. if we're parsing a series of "attr-foo = bar", then we watch the parent context, and create a new parent VP if this child has a SMALLER attribute number than the previous child. This allows the previous configurations to "just work".
Definition at line 291 of file pair_tokenize.c.
Here is the call graph for this function:
Here is the caller graph for this function:
|
static |
1.9.8