summaryrefslogtreecommitdiffhomepage
path: root/proto.c
diff options
context:
space:
mode:
authorFelix Fietkau <nbd@openwrt.org>2012-05-31 18:18:52 +0200
committerFelix Fietkau <nbd@openwrt.org>2012-05-31 18:18:52 +0200
commit9cabaeb8a525ba050fb2dcf1204b6cb56a65a330 (patch)
treea14e5d65d41ae5c9608d5c365892800e815b024a /proto.c
parentb7abfa09bd4c3ecb8936244dcfe0fc720a0e03ee (diff)
add an ubus method for dumping available protocol handlers
Diffstat (limited to 'proto.c')
-rw-r--r--proto.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/proto.c b/proto.c
index c3bd19d..ccc5f25 100644
--- a/proto.c
+++ b/proto.c
@@ -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;