yin parser FEATURE in YANG 1.1 support enumeration and bits restrictions
Allow restriction on derived types from some other enumeration/bits based
type.
diff --git a/src/parser_yang.c b/src/parser_yang.c
index 5008d38..3dc30e9 100644
--- a/src/parser_yang.c
+++ b/src/parser_yang.c
@@ -1279,7 +1279,8 @@
for (i = 0; i < j; i++) {
if (typ->type->info.enums.enm[i].value == typ->type->info.enums.enm[j].value) {
LOGVAL(LYE_ENUM_DUPVAL, LY_VLOG_NONE, NULL,
- typ->type->info.enums.enm[j].value, typ->type->info.enums.enm[j].name);
+ typ->type->info.enums.enm[j].value, typ->type->info.enums.enm[j].name,
+ typ->type->info.enums.enm[i].name);
goto error;
}
}
@@ -1339,7 +1340,7 @@
/* check that the value is unique */
for (i = 0; i < j; i++) {
if (typ->type->info.bits.bit[i].pos == bit->pos) {
- LOGVAL(LYE_BITS_DUPVAL, LY_VLOG_NONE, NULL, bit->pos, bit->name);
+ LOGVAL(LYE_BITS_DUPVAL, LY_VLOG_NONE, NULL, bit->pos, bit->name, typ->type->info.bits.bit[i].name);
goto error;
}
}