diff options
author | Jo-Philipp Wich <jow@openwrt.org> | 2012-06-29 13:27:27 +0200 |
---|---|---|
committer | Jo-Philipp Wich <jow@openwrt.org> | 2012-06-29 13:32:44 +0200 |
commit | 4b284038e226b4deace501eae66c67737c7f324c (patch) | |
tree | 064bc91d6bc8fc0fdd61d44cf40971ebd2f317fb | |
parent | 55c7d8f55b6bdb264a52410467a7e8cff3bec3a9 (diff) |
ubus.c: expose metric and mtu values if applicable
-rw-r--r-- | ubus.c | 7 |
1 files changed, 7 insertions, 0 deletions
@@ -432,6 +432,12 @@ interface_ip_dump_route_list(struct interface_ip_settings *ip) inet_ntop(af, &route->nexthop, buf, buflen); blobmsg_add_string_buffer(&b); + if (route->flags & DEVROUTE_MTU) + blobmsg_add_u32(&b, "mtu", route->mtu); + + if (route->flags & DEVROUTE_METRIC) + blobmsg_add_u32(&b, "metric", route->metric); + blobmsg_add_u8(&b, "enabled", route->enabled); blobmsg_close_table(&b, r); @@ -494,6 +500,7 @@ netifd_handle_status(struct ubus_context *ctx, struct ubus_object *obj, blobmsg_add_string(&b, "device", dev->ifname); if (iface->state == IFS_UP) { + blobmsg_add_u32(&b, "metric", iface->metric); a = blobmsg_open_array(&b, "ipv4-address"); interface_ip_dump_address_list(&iface->config_ip, false); interface_ip_dump_address_list(&iface->proto_ip, false); |