diff --git a/iwinfo.c b/iwinfo.c index d3866cb..893da01 100644 --- a/iwinfo.c +++ b/iwinfo.c @@ -16,10 +16,8 @@ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -#include -#include - #include "iwinfo.h" +#include "plugin.h" static struct blob_buf buf; static const struct iwinfo_ops *iw; @@ -622,7 +620,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 +645,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 +}; diff --git a/iwinfo.h b/iwinfo.h index 0464815..bc1a8bb 100644 --- a/iwinfo.h +++ b/iwinfo.h @@ -19,10 +19,10 @@ #ifndef __RPC_IWINFO_H #define __RPC_IWINFO_H +#include +#include #include #include #include -int rpc_iwinfo_api_init(struct ubus_context *ctx); - #endif diff --git a/main.c b/main.c index c8b6d41..4b8956f 100644 --- a/main.c +++ b/main.c @@ -26,7 +26,6 @@ #include "session.h" #include "file.h" #include "uci.h" -#include "iwinfo.h" #include "luci2.h" #include "plugin.h" @@ -65,7 +64,6 @@ int main(int argc, char **argv) rpc_session_api_init(ctx); rpc_file_api_init(ctx); rpc_uci_api_init(ctx); - rpc_iwinfo_api_init(ctx); rpc_luci2_api_init(ctx); rpc_plugin_api_init(ctx);