projects
/
project
/
netifd.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
69b2dcb
)
change the status information provided via ubus
author
Felix Fietkau
<nbd@openwrt.org>
Thu, 8 Sep 2011 07:09:49 +0000
(09:09 +0200)
committer
Felix Fietkau
<nbd@openwrt.org>
Thu, 8 Sep 2011 07:09:49 +0000
(09:09 +0200)
ubus.c
patch
|
blob
|
history
diff --git
a/ubus.c
b/ubus.c
index
2c4e4e6
..
6eba0b0
100644
(file)
--- a/
ubus.c
+++ b/
ubus.c
@@
-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)
{
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);
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) {
blobmsg_add_u8(&b, "active", iface->active);
blobmsg_add_u8(&b, "autostart", iface->autostart);
if (iface->main_dev.dev) {