da = dict->root;
}
+ /*
+ * ref=.foo is a ref from the current parent.
+ *
+ * ref=@foo is a ref from the root of the tree.
+ */
+
if (!fr_sbuff_next_if_char(in, '.')) {
- fr_strerror_printf("Attribute %s has reference '%s' which does not begin with '.' or '@'",
- rel->name, fr_sbuff_start(in));
+ fr_strerror_printf("Invalid reference '%s' - it should start with '@' (from the root), or '.' (from the parent)",
+ fr_sbuff_start(in));
return -1;
}
/*
- * First '.' makes it reletive, subsequent ones traverse up the tree.
+ * First '.' makes it relative, subsequent ones traverse up the tree.
*
* No '.' means use the root.
*/
(void) fr_dict_protocol_reference(&da, fixup->da->parent, &FR_SBUFF_IN_STR(fixup->ref));
if (!da) {
- fr_strerror_printf_push("Failed resolving reference for attribute at %s[%d]",
- fr_cwd_strip(fixup->da->filename), fixup->da->line);
+ fr_strerror_printf_push("Failed resolving reference for attribute %s at %s[%d]",
+ fixup->da->name, fr_cwd_strip(fixup->da->filename), fixup->da->line);
return -1;
}
(void) fr_dict_protocol_reference(&src, fixup->da->parent, &FR_SBUFF_IN_STR(fixup->ref));
if (!src) {
- fr_strerror_printf_push("Failed resolving reference for attribute at %s[%d]",
- fr_cwd_strip(fixup->da->filename), fixup->da->line);
+ fr_strerror_printf_push("Failed resolving reference for attribute %s at %s[%d]",
+ fixup->da->name, fr_cwd_strip(fixup->da->filename), fixup->da->line);
return -1;
}
(void) fr_dict_protocol_reference(&src, fixup->da->parent, &FR_SBUFF_IN_STR(fixup->ref));
if (!src) {
- fr_strerror_printf_push("Failed resolving reference for attribute at %s[%d]",
- fr_cwd_strip(fixup->da->filename), fixup->da->line);
+ fr_strerror_printf_push("Failed resolving reference for attribute %s at %s[%d]",
+ fixup->da->name, fr_cwd_strip(fixup->da->filename), fixup->da->line);
return -1;
}
VALUE base-enum-uint64 two 2
VALUE base-enum-uint64 three 3
-ATTRIBUTE Base-Integer64 19 uint64 enum=base-enum-uint64
+ATTRIBUTE Base-Integer64 19 uint64 enum=.base-enum-uint64
ATTRIBUTE Base-IPv4-Prefix 20 ipv4prefix
# and this casting should work
-ATTRIBUTE Base-Integer32 21 uint32 enum=base-enum-uint64
+ATTRIBUTE Base-Integer32 21 uint32 enum=.base-enum-uint64
# Ignore VSA, VENDOR, timeval, boolean, combo-ip-prefix, decimal... for now
END-PROTOCOL TEST