[OpenWrt-Devel] [PATCH v2 3/5 netifd] proto: Display proto flags when dumping the protocol handlers in ubus

Hans Dedecker dedeckeh at gmail.com
Thu Aug 11 09:53:27 EDT 2016


Signed-off-by: Hans Dedecker <dedeckeh at gmail.com>
---

Changes in v2:
    -Display flag PROTO_FLAG_TEARDOWN_ON_L3_LINK_DOWN

 proto.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/proto.c b/proto.c
index 45eeb4b..3b973d9 100644
--- a/proto.c
+++ b/proto.c
@@ -567,7 +567,14 @@ proto_dump_handlers(struct blob_buf *b)
 				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, "immediate", !!(p->flags & PROTO_FLAG_IMMEDIATE));
 		blobmsg_add_u8(b, "no_device", !!(p->flags & PROTO_FLAG_NODEV));
+		blobmsg_add_u8(b, "init_available", !!(p->flags & PROTO_FLAG_INIT_AVAILABLE));
+		blobmsg_add_u8(b, "renew_available", !!(p->flags & PROTO_FLAG_RENEW_AVAILABLE));
+		blobmsg_add_u8(b, "force_link_default", !!(p->flags & PROTO_FLAG_FORCE_LINK_DEFAULT));
+		blobmsg_add_u8(b, "last_error", !!(p->flags & PROTO_FLAG_LASTERROR));
+		blobmsg_add_u8(b, "teardown_on_l3_link_down", !!(p->flags & PROTO_FLAG_TEARDOWN_ON_L3_LINK_DOWN));
+		blobmsg_add_u8(b, "no_task", !!(p->flags & PROTO_FLAG_NO_TASK));
 		blobmsg_close_table(b, c);
 	}
 }
-- 
1.9.1
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


More information about the openwrt-devel mailing list