+ /*
+ * Parse extended attributes.
+ */
+ if (p) {
+ int sub;
+ char *q;
+ DICT_ATTR *da;
+
+ *p = '.'; /* reset forlater printing */
+
+ /*
+ * Does the parent attribute exist?
+ */
+ da = dict_attrbyvalue(value, VENDORPEC_EXTENDED);
+ if (!da) {
+ fr_strerror_printf("dict_init: %s[%d]: Entry refers to unknown attribute %d", fn, line, value);
+ return -1;
+ }
+
+ /*
+ * 241.1 means 241 is of type "extended".
+ * Otherwise, die.
+ */
+ if (!da->flags.extended && !da->flags.extended_flags) {
+ fr_strerror_printf("dict_init: %s[%d]: Entry refers to a non-extended attribute %d", fn, line, value);
+ return -1;
+ }
+
+ /*
+ * Look for sub-TLVs
+ */
+ q = strchr(p + 1, '.');
+ if (q) *q = '\0';
+
+ /*
+ * Parse error.
+ */
+ if (!sscanf_i(p + 1, &sub)) {
+ fr_strerror_printf("dict_init: %s[%d]: Parse error in value \"%s\"", fn, line, argv[1]);
+ return -1;
+ }
+
+ /*
+ * Value is out of bounds.
+ */
+ if ((sub == 0) || (sub > 255)) {
+ fr_strerror_printf("dict_init: %s[%d]: Entry has value out of range 0..255: %d", fn, line, sub);
+ return -1;
+ }
+
+ value |= (sub << fr_wimax_shift[1]);
+
+ /*
+ * If this is defining the contents of a TLV,
+ * look for the parent, and check it.
+ */
+ if (q) {
+ DICT_ATTR *tlv;
+
+ tlv = dict_attrbyvalue(value, VENDORPEC_EXTENDED);
+ if (!tlv || !tlv->flags.has_tlv ||
+ (!tlv->flags.extended && !tlv->flags.extended_flags)) {
+ fr_strerror_printf("dict_init: %s[%d]: Entry refers to Attribute \"%s\", which is not an extended attribute TLV", fn, line, argv[1]);
+ return -1;
+
+ }
+
+ flags.is_tlv = 1;
+
+ /*
+ * Parse error.
+ */
+ if (!sscanf_i(q + 1, &sub)) {
+ fr_strerror_printf("dict_init: %s[%d]: Parse error in value \"%s\"", fn, line, argv[1]);
+ return -1;
+ }
+
+ /*
+ * Value is out of bounds.
+ */
+ if ((sub == 0) || (sub > 255)) {
+ fr_strerror_printf("dict_init: %s[%d]: Entry has value out of range 0..255: %d", fn, line, sub);
+ return -1;
+ }
+
+ value |= (sub << fr_wimax_shift[2]);
+ }
+
+ /*
+ * Set which type of attribute this is.
+ */
+ flags.extended = da->flags.extended;
+ flags.extended_flags = da->flags.extended_flags;
+ }
+