On Fri, Jun 21, 2013 at 07:26:12PM +0200, Juliusz Chroboczek wrote:
> > Is it on purpose that there is no way to set -r, -h and -H from the
> > configuration file?
> 
> I guess I should allow -r.

Patch proposal attached.

> As to -h and -H -- either we dump them, or allow setting different
> defaults for wired and wireless interfaces.  That would mean
> maintaining three default sets (wireless defaults, wired defaults, and
> default defaults).

I think we should drop them, it's really too confusing.

If it really makes sense to provide a way to set different defaults for wired
and wireless interfaces, it should not be restricted to hello interval:
  default-wired ...
  default-wireless ...
This is probably overkill, though.

-- 
Gabriel
>From 826cfbcc7953372b78acaf86cc2dc39a7088291b Mon Sep 17 00:00:00 2001
From: Gabriel Kerneis <[email protected]>
Date: Fri, 21 Jun 2013 18:38:58 +0100
Subject: [PATCH] Add random-id option to config file.

---
 babeld.c        |    3 ++-
 babeld.h        |    1 +
 babeld.man      |    5 +++++
 configuration.c |    3 +++
 4 files changed, 11 insertions(+), 1 deletion(-)

diff --git a/babeld.c b/babeld.c
index c5f9421..fa1ede2 100644
--- a/babeld.c
+++ b/babeld.c
@@ -63,6 +63,7 @@ int all_wireless = 0;
 int default_wireless_hello_interval = -1;
 int default_wired_hello_interval = -1;
 int resend_delay = -1;
+int random_id = 0;
 int do_daemonise = 0;
 char *logfile = NULL,
     *pidfile = "/var/run/babeld.pid",
@@ -97,7 +98,7 @@ int
 main(int argc, char **argv)
 {
     struct sockaddr_in6 sin6;
-    int rc, fd, i, opt, random_id = 0;
+    int rc, fd, i, opt;
     time_t expiry_time, source_expiry_time, kernel_dump_time;
     char *config_file = NULL;
     void *vrc;
diff --git a/babeld.h b/babeld.h
index 0cc1435..04789df 100644
--- a/babeld.h
+++ b/babeld.h
@@ -85,6 +85,7 @@ extern int debug;
 extern time_t reboot_time;
 extern int default_wireless_hello_interval, default_wired_hello_interval;
 extern int resend_delay;
+extern int random_id;
 extern int do_daemonise;
 extern char *logfile, *pidfile, *state_file;
 extern int link_detect;
diff --git a/babeld.man b/babeld.man
index d4ff65f..c751016 100644
--- a/babeld.man
+++ b/babeld.man
@@ -175,6 +175,11 @@ This specifies whether to keep unfeasible (useless) routes, and is
 equivalent to the command-line option
 .BR \-u .
 .TP
+.BR random-id " {" true | false }
+This specifies whether to use a random router-id, and is
+equivalent to the command-line option
+.BR \-r .
+.TP
 .BI debug " level"
 This specifies the debugging level, and is equivalent to the command-line
 option
diff --git a/configuration.c b/configuration.c
index 672bf72..985f9c7 100644
--- a/configuration.c
+++ b/configuration.c
@@ -604,6 +604,7 @@ parse_option(int c, gnc_t gnc, void *closure, char *token)
             abort();
     } else if(strcmp(token, "keep-unfeasible") == 0 ||
               strcmp(token, "link-detect") == 0 ||
+              strcmp(token, "random-id") == 0 ||
               strcmp(token, "daemonise") == 0) {
         int b;
         c = getbool(c, &b, gnc, closure);
@@ -614,6 +615,8 @@ parse_option(int c, gnc_t gnc, void *closure, char *token)
             keep_unfeasible = b;
         else if(strcmp(token, "link-detect") == 0)
             link_detect = b;
+        else if(strcmp(token, "random-id") == 0)
+            random_id = b;
         else if(strcmp(token, "daemonise") == 0)
             do_daemonise = b;
         else
-- 
1.7.10.4

_______________________________________________
Babel-users mailing list
[email protected]
http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/babel-users

Reply via email to