[Olsr-dev] [PATCH v1 058/115] jsoninfo: rename info_plugin_config to config

Ferry Huberts (spam-protected)
Wed Dec 2 21:28:31 CET 2015


From: Ferry Huberts <(spam-protected)>

Signed-off-by: Ferry Huberts <(spam-protected)>
---
 lib/jsoninfo/src/olsrd_plugin.c | 34 +++++++++++++++++-----------------
 lib/jsoninfo/src/olsrd_plugin.h |  2 +-
 2 files changed, 18 insertions(+), 18 deletions(-)

diff --git a/lib/jsoninfo/src/olsrd_plugin.c b/lib/jsoninfo/src/olsrd_plugin.c
index acf6757..5f86bc2 100644
--- a/lib/jsoninfo/src/olsrd_plugin.c
+++ b/lib/jsoninfo/src/olsrd_plugin.c
@@ -76,7 +76,7 @@ static info_plugin_functions_t functions = { //
     };
 
 
-info_plugin_config_t info_plugin_config;
+info_plugin_config_t config;
 char uuidfile[FILENAME_MAX];
 
 static void my_init(void) __attribute__ ((constructor));
@@ -90,21 +90,21 @@ static void my_init(void) {
   printf("%s\n", MOD_DESC);
 
   /* defaults for parameters */
-  info_plugin_config.ipc_port = 9090;
-  info_plugin_config.http_headers = true;
-  info_plugin_config.allow_localhost = false;
-  info_plugin_config.ipv6_only = false;
+  config.ipc_port = 9090;
+  config.http_headers = true;
+  config.allow_localhost = false;
+  config.ipv6_only = false;
 
   if (olsr_cnf->ip_version == AF_INET) {
-    info_plugin_config.accept_ip.v4.s_addr = htonl(INADDR_LOOPBACK);
-    info_plugin_config.listen_ip.v4.s_addr = htonl(INADDR_ANY);
+    config.accept_ip.v4.s_addr = htonl(INADDR_LOOPBACK);
+    config.listen_ip.v4.s_addr = htonl(INADDR_ANY);
   } else {
-    info_plugin_config.accept_ip.v6 = in6addr_loopback;
-    info_plugin_config.listen_ip.v6 = in6addr_any;
+    config.accept_ip.v6 = in6addr_loopback;
+    config.listen_ip.v6 = in6addr_any;
   }
 
   /* highlite neighbours by default */
-  info_plugin_config.nompr = 0;
+  config.nompr = 0;
 
   memset(uuidfile, 0, sizeof(uuidfile));
 }
@@ -129,7 +129,7 @@ static void my_fini(void) {
  *function in uolsrd_plugin.c
  */
 int olsrd_plugin_init(void) {
-  return info_plugin_init(PLUGIN_NAME, &functions, &info_plugin_config);
+  return info_plugin_init(PLUGIN_NAME, &functions, &config);
 }
 
 /**
@@ -145,12 +145,12 @@ int olsrd_plugin_interface_version(void) {
 
 static const struct olsrd_plugin_parameters plugin_parameters[] = { //
     //
-        { .name = "port", .set_plugin_parameter = &set_plugin_port, .data = &info_plugin_config.ipc_port }, //
-        { .name = "accept", .set_plugin_parameter = &set_plugin_ipaddress, .data = &info_plugin_config.accept_ip }, //
-        { .name = "listen", .set_plugin_parameter = &set_plugin_ipaddress, .data = &info_plugin_config.listen_ip }, //
-        { .name = "httpheaders", .set_plugin_parameter = &set_plugin_boolean, .data = &info_plugin_config.http_headers }, //
-        { .name = "allowlocalhost", .set_plugin_parameter = &set_plugin_boolean, .data = &info_plugin_config.allow_localhost }, //
-        { .name = "ipv6only", .set_plugin_parameter = &set_plugin_boolean, .data = &info_plugin_config.ipv6_only }, //
+        { .name = "port", .set_plugin_parameter = &set_plugin_port, .data = &config.ipc_port }, //
+        { .name = "accept", .set_plugin_parameter = &set_plugin_ipaddress, .data = &config.accept_ip }, //
+        { .name = "listen", .set_plugin_parameter = &set_plugin_ipaddress, .data = &config.listen_ip }, //
+        { .name = "httpheaders", .set_plugin_parameter = &set_plugin_boolean, .data = &config.http_headers }, //
+        { .name = "allowlocalhost", .set_plugin_parameter = &set_plugin_boolean, .data = &config.allow_localhost }, //
+        { .name = "ipv6only", .set_plugin_parameter = &set_plugin_boolean, .data = &config.ipv6_only }, //
         { .name = "uuidfile", .set_plugin_parameter = &set_plugin_string, .data = uuidfile, .addon = { .ui = FILENAME_MAX - 1 } } //
     };
 
diff --git a/lib/jsoninfo/src/olsrd_plugin.h b/lib/jsoninfo/src/olsrd_plugin.h
index dde9bc6..c3b0ed6 100644
--- a/lib/jsoninfo/src/olsrd_plugin.h
+++ b/lib/jsoninfo/src/olsrd_plugin.h
@@ -51,7 +51,7 @@
 #include "plugin_util.h"
 #include "../../info/info_types.h"
 
-extern info_plugin_config_t info_plugin_config;
+extern info_plugin_config_t config;
 
 int olsrd_plugin_interface_version(void);
 int olsrd_plugin_init(void);
-- 
2.5.0




More information about the Olsr-dev mailing list