fr_skip_whitespace(p);
*out = p;
+ if (type == FR_TYPE_ATTR) {
+ enumv = cc->tmpl_rules.attr.dict_def ?
+ fr_dict_root(cc->tmpl_rules.attr.dict_def) :
+ fr_dict_root(fr_dict_internal());
+ }
+
/*
* As a hack, allow most things to be inside
* double-quoted strings. This is really only for dates,
fr_type_t type;
char const *p, *value, *end;
size_t slen;
+ fr_dict_attr_t const *enumv = NULL;
a = talloc_zero(cc->tmp_ctx, fr_value_box_t);
if (type == FR_TYPE_MAX) RETURN_PARSE_ERROR(0);
fr_value_box_init(out, type, NULL, false);
- if (fr_value_box_cast(out, out, type, NULL, a) < 0) {
+ if (type == FR_TYPE_ATTR) {
+ enumv = cc->tmpl_rules.attr.dict_def ?
+ fr_dict_root(cc->tmpl_rules.attr.dict_def) :
+ fr_dict_root(fr_dict_internal());
+ }
+
+ if (fr_value_box_cast(out, out, type, enumv, a) < 0) {
RETURN_OK_WITH_ERROR();
}
return fr_value_box_cast_in_place(ctx, dst, dst_type, dst_enumv);
#else
case FR_TYPE_ATTR:
+ if (src->type == FR_TYPE_STRING) break;
+
+ FALL_THROUGH;
+
#endif
/*
* Invalid types for casting (were caught earlier)
cast time_delta 1.14285714w -> time_delta
match 691199.998272
+#
+# Attribute tests
+#
+proto-dictionary radius
+tmpl-rules allow_unresolved=no allow_unknown=no
+
+cast attribute ::Vendor-Specific.Cisco.AVPair -> attribute
+match ::Vendor-Specific.Cisco.AVPair
+
+cast string "::26.9.1" -> attribute
+match Vendor-Specific.Cisco.AVPair
+
count
-match 24
+match 28