[Olsr-dev] [PATCH v1 103/115] jsoninfo: use the function to initialise the config

Ferry Huberts (spam-protected)
Wed Dec 2 21:29:16 CET 2015


From: Ferry Huberts <(spam-protected)>

Signed-off-by: Ferry Huberts <(spam-protected)>
---
 lib/jsoninfo/src/olsrd_plugin.c | 18 +-----------------
 1 file changed, 1 insertion(+), 17 deletions(-)

diff --git a/lib/jsoninfo/src/olsrd_plugin.c b/lib/jsoninfo/src/olsrd_plugin.c
index cfcae88..3e41854 100644
--- a/lib/jsoninfo/src/olsrd_plugin.c
+++ b/lib/jsoninfo/src/olsrd_plugin.c
@@ -88,23 +88,7 @@ static void my_init(void) {
   /* Print plugin info to stdout */
   printf("%s\n", MOD_DESC);
 
-  /* defaults for parameters */
-  config.ipc_port = 9090;
-  config.http_headers = true;
-  config.allow_localhost = false;
-  config.ipv6_only = false;
-
-  if (olsr_cnf->ip_version == AF_INET) {
-    config.accept_ip.v4.s_addr = htonl(INADDR_LOOPBACK);
-    config.listen_ip.v4.s_addr = htonl(INADDR_ANY);
-  } else {
-    config.accept_ip.v6 = in6addr_loopback;
-    config.listen_ip.v6 = in6addr_any;
-  }
-
-  /* highlite neighbours by default */
-  config.nompr = 0;
-
+  info_plugin_config_init(&config, 9090);
   memset(uuidfile, 0, sizeof(uuidfile));
 }
 
-- 
2.5.0




More information about the Olsr-dev mailing list