The FreeRADIUS server
$Id: 15bac2a4c627c01d1aa2047687b3418955ac7f00 $
|
Deal with 'unknown' attributes, creating ephemeral dictionary attributes for them. More...
#include <freeradius-devel/util/dict_priv.h>
Go to the source code of this file.
Functions | |
static fr_dict_attr_t * | dict_unknown_alloc (TALLOC_CTX *ctx, fr_dict_attr_t const *da, fr_type_t type) |
Allocate an unknown DA. More... | |
fr_dict_attr_t const * | fr_dict_attr_unknown_add (fr_dict_t *dict, fr_dict_attr_t const *unknown) |
Converts an unknown to a known by adding it to the internal dictionaries. More... | |
fr_dict_attr_t * | fr_dict_attr_unknown_afrom_da (TALLOC_CTX *ctx, fr_dict_attr_t const *da) |
Copy a known or unknown attribute to produce an unknown attribute with the specified name. More... | |
fr_slen_t | fr_dict_attr_unknown_afrom_oid_substr (TALLOC_CTX *ctx, fr_dict_attr_t const **out, fr_dict_attr_t const *parent, fr_sbuff_t *in, fr_type_t type) |
Create a fr_dict_attr_t from an ASCII attribute and value. More... | |
void | fr_dict_attr_unknown_free (fr_dict_attr_t const **da) |
Free dynamically allocated (unknown attributes) More... | |
int | fr_dict_attr_unknown_parent_to_known (fr_dict_attr_t *da, fr_dict_attr_t const *parent) |
Fixup the parent of an unknown attribute using an equivalent known attribute. More... | |
fr_dict_attr_t * | fr_dict_attr_unknown_raw_afrom_da (TALLOC_CTX *ctx, fr_dict_attr_t const *da) |
Initialise an octets type attribute from a da. More... | |
fr_dict_attr_t const * | fr_dict_attr_unknown_resolve (fr_dict_t const *dict, fr_dict_attr_t const *da) |
Check to see if we can convert a nested TLV structure to known attributes. More... | |
fr_dict_attr_t * | fr_dict_attr_unknown_typed_afrom_num_raw (TALLOC_CTX *ctx, fr_dict_attr_t const *parent, unsigned int num, fr_type_t type, bool raw) |
Initialise a fr_dict_attr_t from a number and a data type. More... | |
Deal with 'unknown' attributes, creating ephemeral dictionary attributes for them.
Definition in file dict_unknown.c.
|
static |
Allocate an unknown DA.
Definition at line 165 of file dict_unknown.c.
fr_dict_attr_t const* fr_dict_attr_unknown_add | ( | fr_dict_t * | dict, |
fr_dict_attr_t const * | unknown | ||
) |
Converts an unknown to a known by adding it to the internal dictionaries.
Does not free old fr_dict_attr_t, that is left up to the caller.
[in] | dict | of protocol context we're operating in. If NULL the internal dictionary will be used. |
[in] | unknown | attribute to add. |
Definition at line 38 of file dict_unknown.c.
fr_dict_attr_t* fr_dict_attr_unknown_afrom_da | ( | TALLOC_CTX * | ctx, |
fr_dict_attr_t const * | da | ||
) |
Copy a known or unknown attribute to produce an unknown attribute with the specified name.
Will copy the complete hierarchy down to the first known attribute.
Definition at line 229 of file dict_unknown.c.
fr_slen_t fr_dict_attr_unknown_afrom_oid_substr | ( | TALLOC_CTX * | ctx, |
fr_dict_attr_t const ** | out, | ||
fr_dict_attr_t const * | parent, | ||
fr_sbuff_t * | in, | ||
fr_type_t | type | ||
) |
Create a fr_dict_attr_t from an ASCII attribute and value.
Where the attribute name is in the form:
[in] | ctx | to alloc new attribute in. |
[out] | out | Where to write the head of the chain unknown dictionary attributes. |
[in] | parent | Attribute to use as the root for resolving OIDs in. Usually the root of a protocol dictionary. |
[in] | in | OID string to parse |
[in] | type | data type of the unknown attribute |
Definition at line 378 of file dict_unknown.c.
void fr_dict_attr_unknown_free | ( | fr_dict_attr_t const ** | da | ) |
Free dynamically allocated (unknown attributes)
If the da was dynamically allocated it will be freed, else the function will return without doing anything.
[in] | da | to free. |
Definition at line 148 of file dict_unknown.c.
int fr_dict_attr_unknown_parent_to_known | ( | fr_dict_attr_t * | da, |
fr_dict_attr_t const * | parent | ||
) |
Fixup the parent of an unknown attribute using an equivalent known attribute.
This can be useful where an unknown attribute's ancestors are added to a dictionary but not the unknown attribute itself.
[in] | da | to fixup. |
[in] | parent | to assign. If NULL, we will attempt to resolve the parent in the dictionary the current unknown attribute extends. |
Definition at line 511 of file dict_unknown.c.
fr_dict_attr_t* fr_dict_attr_unknown_raw_afrom_da | ( | TALLOC_CTX * | ctx, |
fr_dict_attr_t const * | da | ||
) |
Initialise an octets type attribute from a da.
[in] | ctx | to allocate the attribute in. |
[in] | da | of the unknown attribute. |
Definition at line 352 of file dict_unknown.c.
fr_dict_attr_t const* fr_dict_attr_unknown_resolve | ( | fr_dict_t const * | dict, |
fr_dict_attr_t const * | da | ||
) |
Check to see if we can convert a nested TLV structure to known attributes.
[in] | dict | to search in. |
[in] | da | Nested tlv structure to convert. |
Definition at line 564 of file dict_unknown.c.
fr_dict_attr_t* fr_dict_attr_unknown_typed_afrom_num_raw | ( | TALLOC_CTX * | ctx, |
fr_dict_attr_t const * | parent, | ||
unsigned int | num, | ||
fr_type_t | type, | ||
bool | raw | ||
) |
Initialise a fr_dict_attr_t from a number and a data type.
[in] | ctx | to allocate the attribute in. |
[in] | parent | of the unknown attribute (may also be unknown). |
[in] | num | of the unknown attribute. |
[in] | type | data type |
[in] | raw | is it raw, i.e. bad value, versus unknown? |
Definition at line 271 of file dict_unknown.c.