diff --git a/file.c b/file.c index b0bdd99..2d33272 100644 --- a/file.c +++ b/file.c @@ -16,17 +16,8 @@ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -#include -#include -#include -#include -#include -#include -#include -#include -#include - #include "file.h" +#include "plugin.h" static struct blob_buf buf; @@ -546,7 +537,8 @@ rpc_file_exec(struct ubus_context *ctx, struct ubus_object *obj, } -int rpc_file_api_init(struct ubus_context *ctx) +static int +rpc_file_api_init(const struct rpc_daemon_ops *o, struct ubus_context *ctx) { static const struct ubus_method file_methods[] = { UBUS_METHOD("read", rpc_file_read, rpc_file_policy), @@ -568,3 +560,7 @@ int rpc_file_api_init(struct ubus_context *ctx) return ubus_add_object(ctx, &obj); } + +const struct rpc_plugin rpc_plugin = { + .init = rpc_file_api_init +}; diff --git a/file.h b/file.h index c4cb0d8..870e267 100644 --- a/file.h +++ b/file.h @@ -19,6 +19,15 @@ #ifndef __RPC_FILE_H #define __RPC_FILE_H +#include +#include +#include +#include +#include +#include +#include +#include +#include #include #include #include @@ -57,6 +66,4 @@ struct rpc_file_exec_context { int stat; }; -int rpc_file_api_init(struct ubus_context *ctx); - #endif diff --git a/main.c b/main.c index 4b8956f..e8d6805 100644 --- a/main.c +++ b/main.c @@ -24,7 +24,6 @@ #include #include "session.h" -#include "file.h" #include "uci.h" #include "luci2.h" #include "plugin.h" @@ -62,7 +61,6 @@ int main(int argc, char **argv) ubus_add_uloop(ctx); rpc_session_api_init(ctx); - rpc_file_api_init(ctx); rpc_uci_api_init(ctx); rpc_luci2_api_init(ctx); rpc_plugin_api_init(ctx);