[sysrepo-devel] YANG extensions in libyang

Radek Krejčí rkrejci at cesnet.cz
Mon Dec 12 13:19:50 UTC 2016


Hi,
some of the users already showed their willing to have YANG extensions support in libyang. Current code in master as well as in devel does not support extensions at all and they are removed from the module which makes input and output modules different.

I already have code supporting extensions in a separate branch. But the problem with YANG extension is that they can contain anything and can appear anywhere. The current code limit this which helps quite a lot, but now I seen some modules used by confd (formely tail-f, now cisco) and they use extension in statements we didn't expect - e.g. path or argument, simply in usually text nodes which are currently represented in libyang as 'const char*'. So the question is if keep some limitations about the place where the extension can be instantiated or if we should have more generic implementation.

The issue with the generic approach is
a) more space for schema tree, but because the data tree space is more critical, this shouldn't be a big issue
b) we would have to change a lot in lys_* structures, e.g. description or module prefix, now being represented as 'const char *' would have to change to a structure which would contain the value and pointer to the possible extension instances.

So the question is if to do a big change in libyang API/ABI, or limit extensions support.

I've created an issue about this at libyang issue tracker, and actually because there can be users not subscribed into the sysrepo-devel mailing list, I would prefer to keep this discussion in the issue tracker, thanks - https://github.com/CESNET/libyang/issues/220

Regards,
Radek




More information about the sysrepo-devel mailing list