From 05e0d8f717f16e2076599742191e497cf8d04f0a Mon Sep 17 00:00:00 2001 From: John Crispin Date: Mon, 17 Feb 2014 12:12:23 +0000 Subject: [PATCH] get_proto_handlers now also dumps the validation info Signed-off-by: John Crispin --- proto.c | 10 ++++++++++ 1 file changed, 10 insertions(+) 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); } -- 2.30.2