.Return: _string_
-### %dict.attr.by.num(_<uint32>_)
+### %dict.attr.by_num(_<uint32>_)
Takes an attribute number, and returns the canonicalized name of the attribute.
If the attribute does not exist, nothing is returned.
This function is useful only for "top level" attributes such as `link:https://freeradius.org/rfc/rfc2865.html#User-Name[User-Name]`.
-Where the attribute is nested, use `%dict.attr.by.oid()` instead.
+Where the attribute is nested, use `%dict.attr.by_oid()` instead.
.Return: _string_
-### %dict.attr.by.oid(_<string>_)
+### %dict.attr.by_oid(_<string>_)
Takes a full OID reference (e.g. `26.9.1`), and returns the name of
the attribute.
#
# .Return: _string_
#
-# ### %dict.attr.by.num(_<uint32>_)
+# ### %dict.attr.by_num(_<uint32>_)
#
# Takes an attribute number, and returns the canonicalized name of the attribute.
#
# If the attribute does not exist, nothing is returned.
#
# This function is useful only for "top level" attributes such as `User-Name`.
-# Where the attribute is nested, use `%dict.attr.by.oid()` instead.
+# Where the attribute is nested, use `%dict.attr.by_oid()` instead.
#
# .Return: _string_
#
-# ### %dict.attr.by.oid(_<string>_)
+# ### %dict.attr.by_oid(_<string>_)
#
# Takes a full OID reference (e.g. `26.9.1`), and returns the name of
# the attribute.
{
xlat_t *xlat;
- XLAT_REGISTER("dict.attr.by.num", xlat_dict_attr_by_num, FR_TYPE_STRING, xlat_dict_attr_by_num_args);
- XLAT_REGISTER("dict.attr.by.oid", xlat_dict_attr_by_oid, FR_TYPE_STRING, xlat_dict_attr_by_oid_args);
+ XLAT_REGISTER("dict.attr.by_num", xlat_dict_attr_by_num, FR_TYPE_STRING, xlat_dict_attr_by_num_args);
+ XLAT_REGISTER("dict.attr.by_oid", xlat_dict_attr_by_oid, FR_TYPE_STRING, xlat_dict_attr_by_oid_args);
XLAT_REGISTER("dict.vendor", xlat_vendor, FR_TYPE_STRING, xlat_vendor_args);
XLAT_REGISTER("dict.vendor.num", xlat_vendor_num, FR_TYPE_UINT32, xlat_vendor_num_args);
XLAT_REGISTER("dict.attr", xlat_attr, FR_TYPE_STRING, xlat_attr_args);
static void mod_unload(void)
{
- xlat_func_unregister("dict.attr.by.num");
- xlat_func_unregister("dict.attr.by.oid");
+ xlat_func_unregister("dict.attr.by_num");
+ xlat_func_unregister("dict.attr.by_oid");
xlat_func_unregister("dict.vendor");
xlat_func_unregister("dict.vendor.num");
xlat_func_unregister("dict.attr");
# PRE: map-2arg-error map-empty-error map-module-error map-field-error
#
map csv &User-Name {
- &reply.Result-Status := 'field3'
+ &reply.Result-Status := field3
}
-&control.Auth-Type := 'Accept'
+&control.Auth-Type := Accept
&reply.Reply-Message := 'pass'
&Reply-Message := 'foo'
-if (%dict.attr.by.num(1) != 'User-Name') {
+if (%dict.attr.by_num(1) != 'User-Name') {
test_fail
}
-if (%dict.attr.by.oid(1) != 'User-Name') {
+if (%dict.attr.by_oid(1) != 'User-Name') {
test_fail
}
# Should fail
-if (%dict.attr.by.oid(26) != 'Vendor-Specific') {
+if (%dict.attr.by_oid(26) != 'Vendor-Specific') {
test_fail
}
# Should fail
-if (%dict.attr.by.oid(26.11344) != 'FreeRADIUS') {
+if (%dict.attr.by_oid(26.11344) != 'FreeRADIUS') {
test_fail
}
-if (%dict.attr.by.oid(26.11344.1) != 'Proxied-To') {
+if (%dict.attr.by_oid(26.11344.1) != 'Proxied-To') {
test_fail
}