uci: add state call to retrieve uci state variables
[project/rpcd.git] / iwinfo.c
index d3866cb..3faf662 100644 (file)
--- a/iwinfo.c
+++ b/iwinfo.c
@@ -1,5 +1,5 @@
 /*
- * luci-rpcd - LuCI UBUS RPC server
+ * rpcd - UBUS RPC server
  *
  *   Copyright (C) 2013 Jo-Philipp Wich <jow@openwrt.org>
  *
 
 #include <sys/types.h>
 #include <dirent.h>
+#include <libubus.h>
+#include <iwinfo.h>
+#include <iwinfo/utils.h>
+
+#include <rpcd/plugin.h>
 
-#include "iwinfo.h"
 
 static struct blob_buf buf;
 static const struct iwinfo_ops *iw;
@@ -622,7 +626,8 @@ rpc_iwinfo_devices(struct ubus_context *ctx, struct ubus_object *obj,
 }
 
 
-int rpc_iwinfo_api_init(struct ubus_context *ctx)
+static int
+rpc_iwinfo_api_init(const struct rpc_daemon_ops *o, struct ubus_context *ctx)
 {
        static const struct ubus_method iwinfo_methods[] = {
                { .name = "devices", .handler = rpc_iwinfo_devices },
@@ -646,3 +651,7 @@ int rpc_iwinfo_api_init(struct ubus_context *ctx)
 
        return ubus_add_object(ctx, &obj);
 }
+
+const struct rpc_plugin rpc_plugin = {
+       .init = rpc_iwinfo_api_init
+};