add the service object
[project/procd.git] / api.c
1 #include "procd.h"
2
3 static int
4 service_handle_list(struct ubus_context *ctx, struct ubus_object *obj,
5 struct ubus_request_data *req, const char *method,
6 struct blob_attr *msg)
7 {
8 return 0;
9 }
10
11 static struct ubus_method main_object_methods[] = {
12 { .name = "list", .handler = service_handle_list },
13 };
14
15 static struct ubus_object_type main_object_type =
16 UBUS_OBJECT_TYPE("service", main_object_methods);
17
18 static struct ubus_object main_object = {
19 .name = "service",
20 .type = &main_object_type,
21 .methods = main_object_methods,
22 .n_methods = ARRAY_SIZE(main_object_methods),
23 };
24
25
26 void procd_register_objects(struct ubus_context *ctx)
27 {
28 ubus_add_object(ctx, &main_object);
29 }