diff options
author | Felix Fietkau <nbd@openwrt.org> | 2012-05-31 18:18:52 +0200 |
---|---|---|
committer | Felix Fietkau <nbd@openwrt.org> | 2012-05-31 18:18:52 +0200 |
commit | 9cabaeb8a525ba050fb2dcf1204b6cb56a65a330 (patch) | |
tree | a14e5d65d41ae5c9608d5c365892800e815b024a /proto.c | |
parent | b7abfa09bd4c3ecb8936244dcfe0fc720a0e03ee (diff) |
add an ubus method for dumping available protocol handlers
Diffstat (limited to 'proto.c')
-rw-r--r-- | proto.c | 13 |
1 files changed, 13 insertions, 0 deletions
@@ -450,6 +450,19 @@ get_proto_handler(const char *name) } void +proto_dump_handlers(struct blob_buf *b) +{ + struct proto_handler *p; + void *c; + + avl_for_each_element(&handlers, p, avl) { + c = blobmsg_open_table(b, p->name); + blobmsg_add_u8(b, "no_device", !!(p->flags & PROTO_FLAG_NODEV)); + blobmsg_close_table(b, c); + } +} + +void proto_init_interface(struct interface *iface, struct blob_attr *attr) { const struct proto_handler *proto = iface->proto_handler; |