* fail-open mode. */
static int max_idle = 15;
+/* --max-backoff: Maximum interval between controller connection attempts, in
+ * seconds. */
+static int max_backoff = 15;
+
static void parse_options(int argc, char *argv[]);
static void usage(void) NO_RETURN;
daemonize();
- controller_relay = relay_create(rconn_new(argv[optind], 1, 0, 0),
+ controller_relay = relay_create(rconn_new(argv[optind], 1, 0, max_backoff),
rconn_new(argv[optind + 1], 1,
- probe_interval, 0),
+ probe_interval, max_backoff),
false);
for (;;) {
struct relay *r, *n;
static void
parse_options(int argc, char *argv[])
{
- enum { OPT_INACTIVITY_PROBE = UCHAR_MAX + 1, OPT_MAX_IDLE };
+ enum {
+ OPT_INACTIVITY_PROBE = UCHAR_MAX + 1,
+ OPT_MAX_IDLE,
+ OPT_MAX_BACKOFF
+ };
static struct option long_options[] = {
{"fail", required_argument, 0, 'f'},
{"inactivity-probe", required_argument, 0, OPT_INACTIVITY_PROBE},
{"max-idle", required_argument, 0, OPT_MAX_IDLE},
+ {"max-backoff", required_argument, 0, OPT_MAX_BACKOFF},
{"listen", required_argument, 0, 'l'},
{"detach", no_argument, 0, 'D'},
{"pidfile", optional_argument, 0, 'P'},
}
break;
+ case OPT_MAX_BACKOFF:
+ max_backoff = atoi(optarg);
+ if (max_backoff < 1) {
+ fatal(0, "--max-backoff argument must be at least 1");
+ } else if (max_backoff > 3600) {
+ max_backoff = 3600;
+ }
+ break;
+
case 'D':
set_detach();
break;
" open (default): act as learning switch\n"
" --inactivity-probe=SECS time between inactivity probes\n"
" --max-idle=SECS max idle for flows set up by secchan\n"
+ " --max-backoff=SECS max time between controller connection\n"
+ " attempts (default: 15 seconds)\n"
" -l, --listen=METHOD allow management connections on METHOD\n"
" (a passive OpenFlow connection method)\n"
"\nOther options:\n"