diff options
author | John Crispin <blogic@openwrt.org> | 2014-02-17 12:12:23 +0000 |
---|---|---|
committer | Felix Fietkau <nbd@openwrt.org> | 2014-02-17 15:10:11 +0100 |
commit | 05e0d8f717f16e2076599742191e497cf8d04f0a (patch) | |
tree | 7262cd03243f33ffa9c9930aee8e858e0c6a31cb | |
parent | d5d6da8b108c61172ee72e65b86827a850d1be1d (diff) |
get_proto_handlers now also dumps the validation info
Signed-off-by: John Crispin <blogic@openwrt.org>
-rw-r--r-- | proto.c | 10 |
1 files changed, 10 insertions, 0 deletions
@@ -535,7 +535,17 @@ proto_dump_handlers(struct blob_buf *b) void *c; avl_for_each_element(&handlers, p, avl) { + void *v; + c = blobmsg_open_table(b, p->name); + if (p->config_params->validate) { + int i; + + v = blobmsg_open_table(b, "validate"); + for (i = 0; i < p->config_params->n_params; i++) + blobmsg_add_string(b, p->config_params->params[i].name, uci_get_validate_string(p->config_params, i)); + blobmsg_close_table(b, v); + } blobmsg_add_u8(b, "no_device", !!(p->flags & PROTO_FLAG_NODEV)); blobmsg_close_table(b, c); } |