From: John Crispin Date: Mon, 17 Feb 2014 12:12:23 +0000 (+0000) Subject: get_proto_handlers now also dumps the validation info X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=05e0d8f717f16e2076599742191e497cf8d04f0a;p=oweals%2Fnetifd.git get_proto_handlers now also dumps the validation info Signed-off-by: John Crispin --- diff --git a/proto.c b/proto.c index 9121918..e4465eb 100644 --- a/proto.c +++ b/proto.c @@ -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); }