fix whitespaces
[project/rpcd.git] / iwinfo.c
index d3866cb..78c48e8 100644 (file)
--- a/iwinfo.c
+++ b/iwinfo.c
@@ -1,7 +1,7 @@
 /*
- * luci-rpcd - LuCI UBUS RPC server
+ * rpcd - UBUS RPC server
  *
- *   Copyright (C) 2013 Jo-Philipp Wich <jow@openwrt.org>
+ *   Copyright (C) 2013-2014 Jo-Philipp Wich <jow@openwrt.org>
  *
  * Permission to use, copy, modify, and/or distribute this software for any
  * purpose with or without fee is hereby granted, provided that the above
 
 #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;
@@ -377,14 +381,14 @@ rpc_iwinfo_assoclist(struct ubus_context *ctx, struct ubus_object *obj,
 
                        e = blobmsg_open_table(&buf, "rx");
                        blobmsg_add_u32(&buf, "rate", a->rx_rate.rate);
-                       blobmsg_add_u32(&buf, "mcs",  a->rx_rate.mcs);
+                       blobmsg_add_u32(&buf, "mcs", a->rx_rate.mcs);
                        blobmsg_add_u8(&buf, "40mhz", a->rx_rate.is_40mhz);
                        blobmsg_add_u8(&buf, "short_gi", a->rx_rate.is_short_gi);
                        blobmsg_close_table(&buf, e);
 
                        e = blobmsg_open_table(&buf, "tx");
                        blobmsg_add_u32(&buf, "rate", a->tx_rate.rate);
-                       blobmsg_add_u32(&buf, "mcs",  a->tx_rate.mcs);
+                       blobmsg_add_u32(&buf, "mcs", a->tx_rate.mcs);
                        blobmsg_add_u8(&buf, "40mhz", a->tx_rate.is_40mhz);
                        blobmsg_add_u8(&buf, "short_gi", a->tx_rate.is_short_gi);
                        blobmsg_close_table(&buf, e);
@@ -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
+};