summaryrefslogtreecommitdiffstats
path: root/api.c
diff options
context:
space:
mode:
authorFelix Fietkau <nbd@openwrt.org>2012-06-01 12:00:55 +0200
committerFelix Fietkau <nbd@openwrt.org>2012-06-01 12:00:55 +0200
commit843fe9bb5b77fd20153816400ce918989730f99d (patch)
tree79d355a7b0dda58e078575de568ec14d3407ffd3 /api.c
parentca808f5c335a873c87359ce024e1a14ebae706b9 (diff)
downloadunitd-843fe9bb5b77fd20153816400ce918989730f99d.tar
unitd-843fe9bb5b77fd20153816400ce918989730f99d.zip
add the service object
Diffstat (limited to 'api.c')
-rw-r--r--api.c29
1 files changed, 29 insertions, 0 deletions
diff --git a/api.c b/api.c
new file mode 100644
index 0000000..623f123
--- /dev/null
+++ b/api.c
@@ -0,0 +1,29 @@
+#include "procd.h"
+
+static int
+service_handle_list(struct ubus_context *ctx, struct ubus_object *obj,
+ struct ubus_request_data *req, const char *method,
+ struct blob_attr *msg)
+{
+ return 0;
+}
+
+static struct ubus_method main_object_methods[] = {
+ { .name = "list", .handler = service_handle_list },
+};
+
+static struct ubus_object_type main_object_type =
+ UBUS_OBJECT_TYPE("service", main_object_methods);
+
+static struct ubus_object main_object = {
+ .name = "service",
+ .type = &main_object_type,
+ .methods = main_object_methods,
+ .n_methods = ARRAY_SIZE(main_object_methods),
+};
+
+
+void procd_register_objects(struct ubus_context *ctx)
+{
+ ubus_add_object(ctx, &main_object);
+}