* corresponding section properties.
*/
static void
-rpc_uci_dump_section(struct uci_section *s, const char *name)
+rpc_uci_dump_section(struct uci_section *s, const char *name, int index)
{
void *c;
struct uci_option *o;
blobmsg_add_string(&buf, ".type", s->type);
blobmsg_add_string(&buf, ".name", s->e.name);
+ if (index >= 0)
+ blobmsg_add_u32(&buf, ".index", index);
+
uci_foreach_element(&s->options, e)
{
o = uci_to_option(e);
{
void *c;
struct uci_element *e;
+ int i = -1;
c = blobmsg_open_table(&buf, name);
uci_foreach_element(&p->sections, e)
{
+ i++;
+
if (!rpc_uci_match_section(uci_to_section(e), type, matches))
continue;
- rpc_uci_dump_section(uci_to_section(e), e->name);
+ rpc_uci_dump_section(uci_to_section(e), e->name, i);
}
blobmsg_close_table(&buf, c);
break;
case UCI_TYPE_SECTION:
- rpc_uci_dump_section(ptr.s, "values");
+ rpc_uci_dump_section(ptr.s, "values", -1);
break;
case UCI_TYPE_OPTION: