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

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


From: Ferry Huberts <(spam-protected)>

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

diff --git a/lib/txtinfo/src/olsrd_plugin.c b/lib/txtinfo/src/olsrd_plugin.c
index 39c8461..b179a3d 100644
--- a/lib/txtinfo/src/olsrd_plugin.c
+++ b/lib/txtinfo/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 = 2006;
-  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, 2006);
   vtime = false;
 }
 
-- 
2.5.0




More information about the Olsr-dev mailing list