summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPetr Štetiar <ynezz@true.cz>2023-03-09 14:57:51 +0100
committerPetr Štetiar <ynezz@true.cz>2023-03-29 09:54:51 +0200
commitf55c7c493939850d70a120413733131f487af6e6 (patch)
tree327e344a8b052224594b6e1c58b2aff412c4eb4d
parent24e4ad798279345a462e97427bc94c7304f69c4b (diff)
downloadnetifd-staging/ynezz/fixes-bridge-inspect.tar.gz
bridge: bridge_dump_info: add dumping of bridge attributesstaging/ynezz/fixes-bridge-inspect
There are internal decisions being made using several bridge attributes like for example in bridge_reload(), but those attributes are not available for the outside inspection, thus hard to follow. So lets make inspection easier and simply just add dumping of those bridge attributes as well. Signed-off-by: Petr Štetiar <ynezz@true.cz>
-rw-r--r--bridge.c26
1 files changed, 26 insertions, 0 deletions
diff --git a/bridge.c b/bridge.c
index 0033ab0..cc83329 100644
--- a/bridge.c
+++ b/bridge.c
@@ -968,12 +968,15 @@ bridge_dump_vlan(struct blob_buf *b, struct bridge_vlan *vlan)
static void
bridge_dump_info(struct device *dev, struct blob_buf *b)
{
+ struct bridge_config *cfg;
struct bridge_state *bst;
struct bridge_member *bm;
struct bridge_vlan *vlan;
void *list;
+ void *c;
bst = container_of(dev, struct bridge_state, dev);
+ cfg = &bst->config;
system_if_dump_info(dev, b);
list = blobmsg_open_array(b, "bridge-members");
@@ -987,6 +990,29 @@ bridge_dump_info(struct device *dev, struct blob_buf *b)
blobmsg_close_array(b, list);
+ c = blobmsg_open_table(b, "bridge-attributes");
+
+ blobmsg_add_u8(b, "stp", cfg->stp);
+ blobmsg_add_u32(b, "forward_delay", cfg->forward_delay);
+ blobmsg_add_u32(b, "priority", cfg->priority);
+ blobmsg_add_u32(b, "ageing_time", cfg->ageing_time);
+ blobmsg_add_u32(b, "hello_time", cfg->hello_time);
+ blobmsg_add_u32(b, "max_age", cfg->max_age);
+ blobmsg_add_u8(b, "igmp_snooping", cfg->igmp_snoop);
+ blobmsg_add_u8(b, "bridge_empty", cfg->bridge_empty);
+ blobmsg_add_u8(b, "multicast_querier", cfg->multicast_querier);
+ blobmsg_add_u32(b, "hash_max", cfg->hash_max);
+ blobmsg_add_u32(b, "robustness", cfg->robustness);
+ blobmsg_add_u32(b, "query_interval", cfg->query_interval);
+ blobmsg_add_u32(b, "query_response_interval", cfg->query_response_interval);
+ blobmsg_add_u32(b, "last_member_interval", cfg->last_member_interval);
+ blobmsg_add_u8(b, "vlan_filtering", cfg->vlan_filtering);
+ blobmsg_add_u8(b, "stp_kernel", cfg->stp_kernel);
+ if (cfg->stp_proto)
+ blobmsg_add_string(b, "stp_proto", cfg->stp_proto);
+
+ blobmsg_close_table(b, c);
+
if (avl_is_empty(&dev->vlans.avl))
return;