libyang-YANG Modules

libyang库用于处理YANG数据实例,它存储并使用解析函数加载YANG模块。lys_module代表任何YANG模块,分为已解析和已编译两种形式。已编译模块用于验证/操作YANG数据,而已解析模块则用于源YANG模块的转换。libyang上下文中的模块形成YANG数据实例的模式。可以通过lys_set_implemented()将导入模块标记为已实现。lys_getnext()等函数用于访问和操作模式树信息。
摘要由CSDN通过智能技术生成

To be able to work with YANG data instances, libyang has to represent YANG data models. All the processed modules are stored in libyang context and loaded using parser functions. It means, that there is no way to create/change YANG module programmatically. However, all the YANG model definitions are available and can be examined through the C structures. All the context's modules together form YANG Schema for the data being instantiated.

Any YANG module is represented as lys_module. In fact, the module is represented in two different formats. As lys_module.parsed, there is a parsed schema reflecting the source YANG module. It is exactly what is read from the input. This format is good for converting from one format to another (YANG to YIN and vice versa), but it is not very useful for validating/manipulating YANG data. Therefore, there is lys_module.compiled storing the compiled YANG module. It is based on the parsed module, but all the references are resolved. It means that, for example, there are no groupings or typedefs since they are supposed to be placed instead of uses or type references. This split also means, that the YANG module is fully validated after compilation of the parsed representation of the module. YANG submodules are available only in the parsed representation. When a submodule is compiled, it is fully

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值