qosify_iface_check_device(iface);
vlist_for_each_element(&interfaces, iface, node)
qosify_iface_check_interface(iface);
+ qosify_ubus_update_bridger(false);
}
void qosify_iface_check(void)
c = blobmsg_open_table(b, qosify_iface_name(iface));
blobmsg_add_u8(b, "active", iface->active);
- if (iface->ifname)
+ if (iface->ifname[0])
blobmsg_add_string(b, "ifname", iface->ifname);
blobmsg_add_u8(b, "egress", iface->config.egress);
blobmsg_add_u8(b, "ingress", iface->config.ingress);
return NL_STOP;
}
+static void
+__qosify_iface_get_device(struct blob_buf *b, struct qosify_iface *iface)
+{
+ if (!iface->ifname[0] || !iface->active)
+ return;
+
+ blobmsg_add_string(b, NULL, iface->ifname);
+}
+
+void qosify_iface_get_devices(struct blob_buf *b)
+{
+ struct qosify_iface *iface;
+
+ vlist_for_each_element(&devices, iface, node)
+ __qosify_iface_get_device(b, iface);
+ vlist_for_each_element(&interfaces, iface, node)
+ __qosify_iface_get_device(b, iface);
+}
+
int qosify_iface_init(void)
{
int fd, opt;