uci 使用

uci 使用

uci_ctx_router = uci_alloc_context();      //创建操作句柄
uci_foreach_element(&local_ctx->root, e)  //遍历句柄,已经uci_load的package。入参为root,找到后需要转换成package:p = uci_to_package(e);
uci_load(local_ctx, DDNS, &p);            //加载一个package,返回操作句柄&p
uci_foreach_element(&p->sections, e)      //遍历section,找到后需要执行数据转换,uci_sec = uci_to_section(e);。
uci_free_context(uci_ctx_router);

获取uci option数据:uci_lookup_option_string  uci_lookup_option 
获取uic section: uci_lookup_section 

保存package:uci_save uci_commit

删除 section或者option: uci_delete
删除 list: uci_del_list

创建element option :uci_set
创建 无名 section:uci_add_section

三元组查找选项:uci_lookup_ptr
 * Examples:
 *   network.@interface[0].ifname ('ifname' option of the first interface section)
 *   network.@interface[-1]       (last interface section)

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值