g_ubus_ctx->connection_lost = ztest_ubus_connection_lost; ubus_add_uloop(g_ubus_ctx); ret = ubus_add_object(g_ubus_ctx, &ztest_object); if (ret) ULOG_ERR("Failed to add zboard object: %s\n", ubus_strerror(ret)); return ret; } 1. 2. 3. 4. 5. 6. 7. 8. 9. 10. 11...
ubus_object *obj) if (obj->type->id) blob_put_int32(&b, UBUS_ATTR_OBJTYPE, obj->type->id); - else if (!ubus_push_object_type(obj->type)) + else if (!ubus_push_object_type(&b, obj->type)) return UBUS_STATUS_INVALID_ARGUMENT; Memory leak, you have to free b here. } -...
voidubus_test(void){uloop_init();ztest_ubus_init();uloop_run();ztest_ubus_clean();uloop_done();} ubus的调用步骤ubus_connect、ubus_add_uloop、ubus_add_object intztest_ubus_init(void){intret;g_ubus_ctx=ubus_connect(NULL);if(!g_ubus_ctx){ULOG_ERR("Failed to connect to ubus\n");...
NETNS_UPDOWN_START, @@ -209,6 +260,7 @@ static struct ubus_method main_object_methods[] = { UBUS_METHOD("add_host_route", netifd_add_host_route, route_policy), { .name = "get_proto_handlers", .handler = netifd_get_proto_handlers }, UBUS_METHOD("add_dynamic", netifd_add_dynami...
returnUBUS_STATUS_INVALID_COMMAND; vlist_delete(&interfaces,&iface->node); returnUBUS_STATUS_OK; } staticstructubus_methodmain_object_methods[]={ { .name="restart", .handler=netifd_handle_restart}, { .name="reload", .handler=netifd_handle_reload}, ...
tb[STUDENT_ATTR_ID]) { printf("Invalid argument\n"); return UBUS_STATUS_INVALID_ARGUMENT; } name = blobmsg_get_string(tb[STUDENT_ATTR_NAME]); id = blobmsg_get_u32(tb[STUDENT_ATTR_ID]); s = student_alloc(name, id); vlist_add(&students, &s->node, s->name); return 0; } ...
return ubus_add_object(ctx, obj); } static int __ubus_subscribe_request(struct ubus_context *ctx, struct ubus_object *obj, uint32_t id, int type) { struct ubus_request req; blob_buf_init(&b, 0); blob_put_int32(&b, UBUS_ATTR_OBJID, obj->id); ...
libubus.h ubus_common.h ubusd.c ubusd.h ubusd_acl.c ubusd_acl.h ubusd_event.c ubusd_id.c ubusd_id.h ubusd_monitor.c ubusd_obj.c ubusd_obj.h ubusd_proto.c ubusmsg.h Latest commit Felix Fietkau ubusd: add monitor support Nov 20, 2015 ...
struct ubus_object *obj; void *d, *a; if (!attr[UBUS_ATTR_OBJID]) return UBUS_STATUS_INVALID_ARGUMENT; obj = ubusd_find_object(blob_get_u32(attr[UBUS_ATTR_OBJID])); if (!obj) return UBUS_STATUS_NOT_FOUND; blob_buf_init(&b, 0); ...
Available add-ons Advanced Security Enterprise-grade security features GitHub Copilot Enterprise-grade AI features Premium Support Enterprise-grade 24/7 support Pricing Search or jump to... Search code, repositories, users, issues, pull requests... Provide feedback We read every piece of ...