summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorFelix Fietkau <nbd@openwrt.org>2011-03-27 19:12:27 +0200
committerFelix Fietkau <nbd@openwrt.org>2011-03-27 19:12:27 +0200
commit93e1972d5264f5cea97b4d989084cfbc6b323248 (patch)
tree977b30302107351af164d41336c53a5ca5c08b8f
parent530d9f3cb5137a36ad33d86fb52f94dde81208f4 (diff)
implement a dump status call for bridge devices
-rw-r--r--bridge.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/bridge.c b/bridge.c
index 2aa0e68..6b6562c 100644
--- a/bridge.c
+++ b/bridge.c
@@ -292,12 +292,29 @@ bridge_free(struct device *dev)
free(bst);
}
+static void
+bridge_dump_status(struct device *dev, struct blob_buf *b)
+{
+ struct bridge_state *bst;
+ struct bridge_member *bm;
+ void *list;
+
+ bst = container_of(dev, struct bridge_state, dev);
+
+ list = blobmsg_open_array(b, "bridge-members");
+ list_for_each_entry(bm, &bst->members, list) {
+ blobmsg_add_string(b, NULL, bm->dev.dev->ifname);
+ }
+ blobmsg_close_array(b, list);
+}
+
struct device *
bridge_create(const char *name, struct uci_section *s)
{
static const struct device_type bridge_type = {
.name = "Bridge",
.free = bridge_free,
+ .dump_status = bridge_dump_status,
};
struct bridge_state *bst;
struct device *dev;