blobmsg_add_u8(&blob, "pointtopoint", ifa_flags & IFF_POINTOPOINT);
blobmsg_close_table(&blob, o2);
+ o2 = blobmsg_open_table(&blob, "link");
+
+ p = readstr("/sys/class/net/%s/speed", name);
+ if (*p)
+ blobmsg_add_u32(&blob, "speed", atoi(p));
+
+ p = readstr("/sys/class/net/%s/duplex", name);
+ if (*p)
+ blobmsg_add_string(&blob, "duplex", p);
+
+ n = atoi(readstr("/sys/class/net/%s/carrier", name));
+ blobmsg_add_u8(&blob, "carrier", n == 1);
+
+ n = atoi(readstr("/sys/class/net/%s/carrier_changes", name));
+ blobmsg_add_u32(&blob, "changes", n);
+
+ n = atoi(readstr("/sys/class/net/%s/carrier_up_count", name));
+ blobmsg_add_u32(&blob, "up_count", n);
+
+ n = atoi(readstr("/sys/class/net/%s/carrier_down_count", name));
+ blobmsg_add_u32(&blob, "down_count", n);
+
+ blobmsg_close_table(&blob, o2);
+
blobmsg_close_table(&blob, o);
}