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)