diff options
author | Felix Fietkau <nbd@openwrt.org> | 2011-09-08 09:09:49 +0200 |
---|---|---|
committer | Felix Fietkau <nbd@openwrt.org> | 2011-09-08 09:09:49 +0200 |
commit | d24673d0f2fbb5b8a38f3e3fec9b06ce9a3dec3f (patch) | |
tree | ade6843947428063c70ca7994af8d3ae23005c1b | |
parent | 69b2dcb92b8402b9c6df4d6a041a890fe6468e18 (diff) |
change the status information provided via ubus
-rw-r--r-- | ubus.c | 9 |
1 files changed, 2 insertions, 7 deletions
@@ -147,18 +147,13 @@ netifd_handle_status(struct ubus_context *ctx, struct ubus_object *obj, struct ubus_request_data *req, const char *method, struct blob_attr *msg) { - static const char *iface_state[] = { - [IFS_SETUP] = "setup", - [IFS_UP] = "up", - [IFS_TEARDOWN] = "teardown", - [IFS_DOWN] = "down", - }; struct interface *iface; iface = container_of(obj, struct interface, ubus); blob_buf_init(&b, 0); - blobmsg_add_string(&b, "state", iface_state[iface->state]); + blobmsg_add_u8(&b, "up", iface->state == IFS_UP); + blobmsg_add_u8(&b, "pending", iface->state == IFS_SETUP); blobmsg_add_u8(&b, "active", iface->active); blobmsg_add_u8(&b, "autostart", iface->autostart); if (iface->main_dev.dev) { |