Skip to content
Snippets Groups Projects
Commit 1058b814 authored by Jakob Olsson's avatar Jakob Olsson
Browse files

add timer debugging and dynamic upgrade ubus methods

parent 5790862a
Branches
Tags
No related merge requests found
Pipeline #45130 failed
...@@ -895,6 +895,39 @@ static int cmd(struct ubus_context *ctx, struct ubus_object *obj, ...@@ -895,6 +895,39 @@ static int cmd(struct ubus_context *ctx, struct ubus_object *obj,
return UBUS_STATUS_OK; return UBUS_STATUS_OK;
} }
static int agent_timers(struct ubus_context *ctx, struct ubus_object *obj,
struct ubus_request_data *req, const char *method,
struct blob_attr *msg)
{
struct blob_buf bb;
struct agent *a = container_of(obj, struct agent, obj);
memset(&bb, 0, sizeof(bb));
blob_buf_init(&bb, 0);
blobmsg_add_u32(&bb, "autoconfig_trigger", uloop_timeout_remaining(&a->autocfg_dispatcher));
blobmsg_add_u32(&bb, "dynamic_backhaul_upgrade", uloop_timeout_remaining(&a->upgrade_backhaul_scheduler));
blobmsg_add_u32(&bb, "disconnect_timer", uloop_timeout_remaining(&a->disconnect_timer));
blobmsg_add_u32(&bb, "disable_unconnected_bstas_scheduler", uloop_timeout_remaining(&a->disable_unconnected_bstas_scheduler));
blobmsg_add_u32(&bb, "onboarding_scheduler", uloop_timeout_remaining(&a->onboarding_scheduler));
ubus_send_reply(ctx, req, bb.head);
blob_buf_free(&bb);
return UBUS_STATUS_OK;
}
static int agent_trigger_dynamic_upgrade(struct ubus_context *ctx, struct ubus_object *obj,
struct ubus_request_data *req, const char *method,
struct blob_attr *msg)
{
struct blob_buf bb;
struct agent *a = container_of(obj, struct agent, obj);
if (uloop_timeout_remaining(&a->upgrade_backhaul_scheduler) > 0)
uloop_timeout_set(&a->upgrade_backhaul_scheduler, 0);
return UBUS_STATUS_OK;
}
static int agent_status(struct ubus_context *ctx, struct ubus_object *obj, static int agent_status(struct ubus_context *ctx, struct ubus_object *obj,
struct ubus_request_data *req, const char *method, struct ubus_request_data *req, const char *method,
struct blob_attr *msg) struct blob_attr *msg)
...@@ -1188,6 +1221,8 @@ int agent_publish_object(struct agent *a, const char *objname) ...@@ -1188,6 +1221,8 @@ int agent_publish_object(struct agent *a, const char *objname)
#ifdef AGENT_SYNC_DYNAMIC_CNTLR_CONFIG #ifdef AGENT_SYNC_DYNAMIC_CNTLR_CONFIG
UBUS_METHOD_NOARG("sync", sync_dyn_controller_config), UBUS_METHOD_NOARG("sync", sync_dyn_controller_config),
#endif #endif
UBUS_METHOD_NOARG("timers", agent_timers),
UBUS_METHOD_NOARG("dynamic_backhaul_upgrade", agent_trigger_dynamic_upgrade),
}; };
int num_methods = ARRAY_SIZE(m); int num_methods = ARRAY_SIZE(m);
struct ubus_object_type *obj_type; struct ubus_object_type *obj_type;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment