Add the ability to disable the STP implementation.

This commit is contained in:
Ben Pfaff
2008-09-19 15:37:53 -07:00
parent 63791ba081
commit 55ecbead39
2 changed files with 23 additions and 3 deletions
+5
View File
@@ -325,6 +325,11 @@ Messages are copied to the monitoring connections on a best-effort
basis. In particular, if the socket buffer of the monitoring
connection fills up, some messages will be lost.
.TP
\fB--no-stp\fR
Disable implementation of IEEE 802.1D Spanning Tree Protocol at the
switch.
.TP
\fB-p\fR, \fB--private-key=\fIprivkey.pem\fR
Specifies a PEM file containing the private key used as the switch's
+18 -3
View File
@@ -110,6 +110,9 @@ struct settings {
regex_t accept_controller_regex; /* Controller vconns to accept. */
const char *accept_controller_re; /* String version of regex. */
bool update_resolv_conf; /* Update /etc/resolv.conf? */
/* Spanning tree protocol. */
bool enable_stp;
};
struct half {
@@ -288,7 +291,9 @@ main(int argc, char *argv[])
/* Set up hooks. */
hooks[n_hooks++] = port_watcher_create(local_rconn, remote_rconn, &pw);
hooks[n_hooks++] = stp_hook_create(&s, pw, local_rconn, remote_rconn);
if (s.enable_stp) {
hooks[n_hooks++] = stp_hook_create(&s, pw, local_rconn, remote_rconn);
}
if (s.in_band) {
hooks[n_hooks++] = in_band_hook_create(&s, switch_status,
remote_rconn);
@@ -1491,7 +1496,9 @@ fail_open_hook_create(const struct settings *s, struct switch_status *ss,
fail_open->remote_rconn = remote_rconn;
fail_open->lswitch = NULL;
fail_open->boot_deadline = time_now() + s->probe_interval * 3;
fail_open->boot_deadline += STP_EXTRA_BOOT_TIME;
if (s->enable_stp) {
fail_open->boot_deadline += STP_EXTRA_BOOT_TIME;
}
switch_status_register_category(ss, "fail-open",
fail_open_status_cb, fail_open);
return make_hook(fail_open_local_packet_cb, NULL,
@@ -2042,7 +2049,8 @@ parse_options(int argc, char *argv[], struct settings *s)
OPT_MAX_BACKOFF,
OPT_RATE_LIMIT,
OPT_BURST_LIMIT,
OPT_BOOTSTRAP_CA_CERT
OPT_BOOTSTRAP_CA_CERT,
OPT_NO_STP
};
static struct option long_options[] = {
{"accept-vconn", required_argument, 0, OPT_ACCEPT_VCONN},
@@ -2055,6 +2063,7 @@ parse_options(int argc, char *argv[], struct settings *s)
{"monitor", required_argument, 0, 'm'},
{"rate-limit", optional_argument, 0, OPT_RATE_LIMIT},
{"burst-limit", required_argument, 0, OPT_BURST_LIMIT},
{"no-stp", no_argument, 0, OPT_NO_STP},
{"detach", no_argument, 0, 'D'},
{"force", no_argument, 0, 'f'},
{"pidfile", optional_argument, 0, 'P'},
@@ -2081,6 +2090,7 @@ parse_options(int argc, char *argv[], struct settings *s)
s->update_resolv_conf = true;
s->rate_limit = 0;
s->burst_limit = 0;
s->enable_stp = true;
for (;;) {
int c;
@@ -2155,6 +2165,10 @@ parse_options(int argc, char *argv[], struct settings *s)
}
break;
case OPT_NO_STP:
s->enable_stp = false;
break;
case 'D':
set_detach();
break;
@@ -2309,6 +2323,7 @@ usage(void)
" (a passive OpenFlow connection method)\n"
" -m, --monitor=METHOD copy traffic to/from kernel to METHOD\n"
" (a passive OpenFlow connection method)\n"
" --no-stp disable 802.1D Spanning Tree Protocol\n"
"\nRate-limiting of \"packet-in\" messages to the controller:\n"
" --rate-limit[=PACKETS] max rate, in packets/s (default: 1000)\n"
" --burst-limit=BURST limit on packet credit for idle time\n"