summaryrefslogtreecommitdiff
path: root/utilities
diff options
context:
space:
mode:
authorBen Pfaff <blp@nicira.com>2011-03-15 09:46:39 -0700
committerBen Pfaff <blp@nicira.com>2011-03-16 14:57:56 -0700
commit195c8086244e33ec42fd9fc8354eaedfd849bbba (patch)
tree2b6abbef405fbc05c6db9f0c1ef4dd08ea67470c /utilities
parent9b45d7f5db91cdb41eb0a2124d92885d3b3edcc9 (diff)
downloadopenvswitch-195c8086244e33ec42fd9fc8354eaedfd849bbba.tar.gz
ofproto: Remove controller discovery support.
I've never heard of anyone actually using controller discovery. It adds a great deal of code to the source tree, and a little bit of complication to ofproto, so this commit removes it.
Diffstat (limited to 'utilities')
-rw-r--r--utilities/.gitignore2
-rw-r--r--utilities/automake.mk7
-rw-r--r--utilities/ovs-appctl.8.in3
-rw-r--r--utilities/ovs-discover.8.in118
-rw-r--r--utilities/ovs-discover.c403
-rw-r--r--utilities/ovs-openflowd.8.in122
-rw-r--r--utilities/ovs-openflowd.c45
7 files changed, 8 insertions, 692 deletions
diff --git a/utilities/.gitignore b/utilities/.gitignore
index 56b3e73b9..a2ef09b46 100644
--- a/utilities/.gitignore
+++ b/utilities/.gitignore
@@ -7,8 +7,6 @@
/ovs-cfg-mod.8
/ovs-controller
/ovs-controller.8
-/ovs-discover
-/ovs-discover.8
/ovs-dpctl
/ovs-dpctl.8
/ovs-ofctl
diff --git a/utilities/automake.mk b/utilities/automake.mk
index b267c02f1..1233762f2 100644
--- a/utilities/automake.mk
+++ b/utilities/automake.mk
@@ -1,7 +1,6 @@
bin_PROGRAMS += \
utilities/ovs-appctl \
utilities/ovs-controller \
- utilities/ovs-discover \
utilities/ovs-dpctl \
utilities/ovs-ofctl \
utilities/ovs-openflowd \
@@ -18,7 +17,6 @@ noinst_SCRIPTS += utilities/ovs-pki-cgi utilities/ovs-parse-leaks
EXTRA_DIST += \
utilities/ovs-appctl.8.in \
utilities/ovs-controller.8.in \
- utilities/ovs-discover.8.in \
utilities/ovs-dpctl.8.in \
utilities/ovs-ofctl.8.in \
utilities/ovs-openflowd.8.in \
@@ -40,7 +38,6 @@ EXTRA_DIST += \
DISTCLEANFILES += \
utilities/ovs-appctl.8 \
utilities/ovs-controller.8 \
- utilities/ovs-discover.8 \
utilities/ovs-dpctl.8 \
utilities/ovs-ofctl.8 \
utilities/ovs-openflowd.8 \
@@ -59,7 +56,6 @@ DISTCLEANFILES += \
man_MANS += \
utilities/ovs-appctl.8 \
utilities/ovs-controller.8 \
- utilities/ovs-discover.8 \
utilities/ovs-dpctl.8 \
utilities/ovs-ofctl.8 \
utilities/ovs-openflowd.8 \
@@ -77,9 +73,6 @@ utilities_ovs_appctl_LDADD = lib/libopenvswitch.a
utilities_ovs_controller_SOURCES = utilities/ovs-controller.c
utilities_ovs_controller_LDADD = lib/libopenvswitch.a $(SSL_LIBS)
-utilities_ovs_discover_SOURCES = utilities/ovs-discover.c
-utilities_ovs_discover_LDADD = lib/libopenvswitch.a
-
utilities_ovs_dpctl_SOURCES = utilities/ovs-dpctl.c
utilities_ovs_dpctl_LDADD = lib/libopenvswitch.a
diff --git a/utilities/ovs-appctl.8.in b/utilities/ovs-appctl.8.in
index b1f2ab6ee..86d5a8b05 100644
--- a/utilities/ovs-appctl.8.in
+++ b/utilities/ovs-appctl.8.in
@@ -168,5 +168,4 @@ white space.
.BR ovs\-vswitchd (8),
.BR ovs\-openflowd (8),
.BR ovs\-controller (8),
-.BR ovs\-brcompatd (8),
-.BR ovs\-discover (8).
+.BR ovs\-brcompatd (8).
diff --git a/utilities/ovs-discover.8.in b/utilities/ovs-discover.8.in
deleted file mode 100644
index c9bbbb554..000000000
--- a/utilities/ovs-discover.8.in
+++ /dev/null
@@ -1,118 +0,0 @@
-.TH ovs\-discover 8 "May 2008" "Open vSwitch" "Open vSwitch Manual"
-.ds PN ovs\-discover
-
-.SH NAME
-ovs\-discover \- controller discovery utility
-
-.SH SYNOPSIS
-.B ovs\-discover
-[\fIoptions\fR] \fInetdev\fR [\fInetdev\fR...]
-
-.SH DESCRIPTION
-The \fBovs\-discover\fR program attempts to discover the location of
-an OpenFlow controller on one of the network devices listed on the
-command line. It repeatedly broadcasts a DHCP request with vendor
-class identifier \fBOpenFlow\fR on each network device until it
-receives an acceptable DHCP response. It will accept any valid DHCP
-reply that has the same vendor class identifier and includes a
-vendor-specific option with code 1 whose contents are a string
-specifying the location of the controller in the same format used on
-the \fBovs\-openflowd\fR command line (e.g. \fBssl:192.168.0.1\fR).
-
-When \fBovs\-discover\fR receives an acceptable response, it prints
-the details of the response on \fBstdout\fR. Then, by default, it
-configures the network device on which the response was received with
-the received IP address, netmask, and default gateway, and detaches
-itself to the background.
-
-.SH OPTIONS
-.TP
-\fB\-\-accept\-vconn=\fIregex\fR
-With this option, only controllers whose names match POSIX extended
-regular expression \fIregex\fR will be accepted. Specifying
-\fBssl:.*\fR for \fIregex\fR, for example, would cause only SSL
-controller connections to be accepted.
-
-The \fIregex\fR is implicitly anchored at the beginning of the
-controller location string, as if it begins with \fB^\fR.
-
-When this option is not given, the default \fIregex\fR is
-\fBtcp:.*\fR.
-.TP
-\fB\-\-exit\-without\-bind\fR
-By default, \fBovs\-discover\fR binds the network device that receives
-the first acceptable response to the IP address received over DHCP.
-With this option, the configuration of the network device is not
-changed at all, except to bring it up if it is initially down, and
-\fBovs\-discover\fR will exit immediately after it receives an
-acceptable DHCP response.
-
-This option is mutually exclusive with \fB\-\-exit\-after\-bind\fR and
-\fB\-\-no\-detach\fR.
-
-.TP
-\fB\-\-exit\-after\-bind\fR
-By default, after it receives an acceptable DHCP response,
-\fBovs\-discover\fR detaches itself from the foreground session and
-runs in the background maintaining the DHCP lease as necessary. With
-this option, \fBovs\-discover\fR will exit immediately after it
-receives an acceptable DHCP response and configures the network device
-with the received IP address. The address obtained via DHCP could
-therefore be used past the expiration of its lease.
-
-This option is mutually exclusive with \fB\-\-exit\-without\-bind\fR and
-\fB\-\-no\-detach\fR.
-
-.TP
-\fB\-\-no\-detach\fR
-By default, \fBovs\-discover\fR runs in the foreground until it obtains
-an acceptable DHCP response, then it detaches itself from the
-foreground session and run as a background process. This option
-prevents \fBovs\-discover\fR from detaching, causing it to run in the
-foreground even after it obtains a DHCP response.
-
-This option is mutually exclusive with \fB\-\-exit\-without\-bind\fR and
-\fB\-\-exit\-after\-bind\fR.
-
-.TP
-\fB\-\-pidfile\fR[\fB=\fIpidfile\fR]
-Causes a file (by default, \fBovs\-discover.pid\fR) to be created indicating
-the PID of the running process. If \fIpidfile\fR is not specified, or
-if it does not begin with \fB/\fR, then it is created in
-\fB@RUNDIR@\fR.
-
-The \fIpidfile\fR is created when \fBovs\-discover\fR detaches, so
-this this option has no effect when one of \fB\-\-exit\-without\-bind\fR,
-\fB\-\-exit\-after\-bind\fR, or \fB\-\-no\-detach\fR is also given.
-
-.TP
-\fB\-\-overwrite\-pidfile\fR
-By default, when \fB\-\-pidfile\fR is specified and the specified pidfile
-already exists and is locked by a running process, \fBcontroller\fR refuses
-to start. Specify \fB\-\-overwrite\-pidfile\fR to cause it to instead
-overwrite the pidfile.
-
-When \fB\-\-pidfile\fR is not specified, this option has no effect.
-
-.so lib/vlog.man
-.so lib/common.man
-
-.SH BUGS
-
-If the network devices specified on the command line have been added
-to an Open vSwitch datapath with \fBovs\-dpctl add\-if\fR, then controller
-discovery will fail because \fBovs\-discover\fR will not be able to
-see DHCP responses, even though tools such as \fBtcpdump\fR(8) and
-\fBwireshark\fR(1) can see them on the wire. This is because of the
-structure of the Linux kernel networking stack, which hands packets
-first to programs that listen for all arriving packets, then to
-Open vSwitch, then to programs that listen for a specific kind of packet.
-Open vSwitch consumes all the packets handed to it, so tools like
-\fBtcpdump\fR that look at all packets will see packets arriving on
-Open vSwitch interfaces, but \fRovs\-discover\fR, which listens only for
-arriving IP packets, will not.
-
-.SH "SEE ALSO"
-
-.BR ovs\-openflowd (8),
-.BR ovs\-pki (8)
diff --git a/utilities/ovs-discover.c b/utilities/ovs-discover.c
deleted file mode 100644
index 534dd7747..000000000
--- a/utilities/ovs-discover.c
+++ /dev/null
@@ -1,403 +0,0 @@
-/*
- * Copyright (c) 2008, 2009, 2010, 2011 Nicira Networks.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at:
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#include <config.h>
-#include <getopt.h>
-#include <limits.h>
-#include <regex.h>
-#include <signal.h>
-#include <stdlib.h>
-#include <unistd.h>
-#include "command-line.h"
-#include "daemon.h"
-#include "dhcp-client.h"
-#include "dhcp.h"
-#include "dirs.h"
-#include "dynamic-string.h"
-#include "fatal-signal.h"
-#include "netdev.h"
-#include "poll-loop.h"
-#include "timeval.h"
-#include "unixctl.h"
-#include "util.h"
-#include "vlog.h"
-
-VLOG_DEFINE_THIS_MODULE(ovs_discover);
-
-struct iface {
- const char *name;
- struct dhclient *dhcp;
-};
-
-/* The interfaces that we serve. */
-static struct iface *ifaces;
-static int n_ifaces;
-
-/* --accept-vconn: Regular expression specifying the class of controller vconns
- * that we will accept during autodiscovery. */
-static const char *accept_controller_re = "tcp:.*";
-static regex_t accept_controller_regex;
-
-/* --exit-without-bind: Exit after discovering the controller, without binding
- * the network device to an IP address? */
-static bool exit_without_bind;
-
-/* --exit-after-bind: Exit after discovering the controller, after binding the
- * network device to an IP address? */
-static bool exit_after_bind;
-
-static bool iface_init(struct iface *, const char *netdev_name);
-static void release_ifaces(void *aux OVS_UNUSED);
-
-static void parse_options(int argc, char *argv[]);
-static void usage(void) NO_RETURN;
-
-static void modify_dhcp_request(struct dhcp_msg *, void *aux);
-static bool validate_dhcp_offer(const struct dhcp_msg *, void *aux);
-
-int
-main(int argc, char *argv[])
-{
- struct unixctl_server *unixctl;
- int retval;
- int i;
-
- proctitle_init(argc, argv);
- set_program_name(argv[0]);
- parse_options(argc, argv);
-
- argc -= optind;
- argv += optind;
- if (argc < 1) {
- ovs_fatal(0, "need at least one non-option argument; "
- "use --help for usage");
- }
-
- ifaces = xmalloc(argc * sizeof *ifaces);
- n_ifaces = 0;
- for (i = 0; i < argc; i++) {
- if (iface_init(&ifaces[n_ifaces], argv[i])) {
- n_ifaces++;
- }
- }
- if (!n_ifaces) {
- ovs_fatal(0, "failed to initialize any DHCP clients");
- }
-
- for (i = 0; i < n_ifaces; i++) {
- struct iface *iface = &ifaces[i];
- dhclient_init(iface->dhcp, 0);
- }
- fatal_signal_add_hook(release_ifaces, NULL, NULL, true);
-
- retval = regcomp(&accept_controller_regex, accept_controller_re,
- REG_NOSUB | REG_EXTENDED);
- if (retval) {
- size_t length = regerror(retval, &accept_controller_regex, NULL, 0);
- char *buffer = xmalloc(length);
- regerror(retval, &accept_controller_regex, buffer, length);
- ovs_fatal(0, "%s: %s", accept_controller_re, buffer);
- }
-
- retval = unixctl_server_create(NULL, &unixctl);
- if (retval) {
- exit(EXIT_FAILURE);
- }
-
- die_if_already_running();
-
- signal(SIGPIPE, SIG_IGN);
- for (;;) {
- for (i = 0; i < n_ifaces; i++) {
- struct iface *iface = &ifaces[i];
- dhclient_run(iface->dhcp);
- if (dhclient_changed(iface->dhcp)) {
- bool is_bound = dhclient_is_bound(iface->dhcp);
- int j;
-
- /* Configure network device. */
- if (!exit_without_bind) {
- dhclient_configure_netdev(iface->dhcp);
- dhclient_update_resolv_conf(iface->dhcp);
- }
-
- if (is_bound) {
- static bool detached = false;
- struct ds ds;
-
- /* Disable timeout, since discovery was successful. */
- time_alarm(0);
-
- /* Print discovered parameters. */
- ds_init(&ds);
- dhcp_msg_to_string(dhclient_get_config(iface->dhcp),
- true, &ds);
- fputs(ds_cstr(&ds), stdout);
- putchar('\n');
- fflush(stdout);
- ds_destroy(&ds);
-
- /* Exit if the user requested it. */
- if (exit_without_bind) {
- VLOG_DBG("exiting because of successful binding on %s "
- "and --exit-without-bind specified",
- iface->name);
- exit(0);
- }
- if (exit_after_bind) {
- VLOG_DBG("exiting because of successful binding on %s "
- "and --exit-after-bind specified",
- iface->name);
- exit(0);
- }
-
- /* Detach into background, if we haven't already. */
- if (!detached) {
- detached = true;
- daemonize();
- }
- }
-
- /* We only want an address on a single one of our interfaces.
- * So: if we have an address on this interface, stop looking
- * for one on the others; if we don't have an address on this
- * interface, start looking everywhere. */
- for (j = 0; j < n_ifaces; j++) {
- struct iface *if2 = &ifaces[j];
- if (iface != if2) {
- if (is_bound) {
- dhclient_release(if2->dhcp);
- } else {
- dhclient_init(if2->dhcp, 0);
- }
- }
- }
- }
- }
- unixctl_server_run(unixctl);
- for (i = 0; i < n_ifaces; i++) {
- struct iface *iface = &ifaces[i];
- dhclient_wait(iface->dhcp);
- }
- unixctl_server_wait(unixctl);
- poll_block();
- }
-
- return 0;
-}
-
-static bool
-iface_init(struct iface *iface, const char *netdev_name)
-{
- int retval;
-
- iface->name = netdev_name;
- iface->dhcp = NULL;
-
- if (exit_after_bind) {
- /* Bring this interface up permanently, so that the bound address
- * persists past program termination. */
- struct netdev *netdev;
-
- retval = netdev_open_default(iface->name, &netdev);
- if (retval) {
- ovs_error(retval, "Could not open %s device", iface->name);
- return false;
- }
- retval = netdev_turn_flags_on(netdev, NETDEV_UP, true);
- if (retval) {
- ovs_error(retval, "Could not bring %s device up", iface->name);
- return false;
- }
- netdev_close(netdev);
- }
-
- retval = dhclient_create(iface->name, modify_dhcp_request,
- validate_dhcp_offer, NULL, &iface->dhcp);
- if (retval) {
- ovs_error(retval, "%s: failed to initialize DHCP client", iface->name);
- return false;
- }
-
- return true;
-}
-
-static void
-release_ifaces(void *aux OVS_UNUSED)
-{
- int i;
-
- for (i = 0; i < n_ifaces; i++) {
- struct dhclient *dhcp = ifaces[i].dhcp;
- dhclient_release(dhcp);
- if (dhclient_changed(dhcp)) {
- dhclient_configure_netdev(dhcp);
- }
- }
-}
-
-static void
-modify_dhcp_request(struct dhcp_msg *msg, void *aux OVS_UNUSED)
-{
- dhcp_msg_put_string(msg, DHCP_CODE_VENDOR_CLASS, "OpenFlow");
-}
-
-static bool
-validate_dhcp_offer(const struct dhcp_msg *msg, void *aux OVS_UNUSED)
-{
- static struct vlog_rate_limit rl = VLOG_RATE_LIMIT_INIT(60, 60);
- char *vconn_name;
- bool accept;
-
- vconn_name = dhcp_msg_get_string(msg, DHCP_CODE_OFP_CONTROLLER_VCONN);
- if (!vconn_name) {
- VLOG_WARN_RL(&rl, "rejecting DHCP offer missing controller vconn");
- return false;
- }
- accept = !regexec(&accept_controller_regex, vconn_name, 0, NULL, 0);
- free(vconn_name);
- return accept;
-}
-
-static void
-parse_options(int argc, char *argv[])
-{
- enum {
- OPT_ACCEPT_VCONN = UCHAR_MAX + 1,
- OPT_EXIT_WITHOUT_BIND,
- OPT_EXIT_AFTER_BIND,
- OPT_NO_DETACH,
- VLOG_OPTION_ENUMS,
- DAEMON_OPTION_ENUMS
- };
- static struct option long_options[] = {
- {"accept-vconn", required_argument, 0, OPT_ACCEPT_VCONN},
- {"exit-without-bind", no_argument, 0, OPT_EXIT_WITHOUT_BIND},
- {"exit-after-bind", no_argument, 0, OPT_EXIT_AFTER_BIND},
- {"no-detach", no_argument, 0, OPT_NO_DETACH},
- {"timeout", required_argument, 0, 't'},
- {"pidfile", optional_argument, 0, OPT_PIDFILE},
- {"overwrite-pidfile", no_argument, 0, OPT_OVERWRITE_PIDFILE},
- {"help", no_argument, 0, 'h'},
- {"version", no_argument, 0, 'V'},
- VLOG_LONG_OPTIONS,
- {0, 0, 0, 0},
- };
- char *short_options = long_options_to_short_options(long_options);
- bool detach_after_bind = true;
-
- for (;;) {
- unsigned long int timeout;
- int c;
-
- c = getopt_long(argc, argv, short_options, long_options, NULL);
- if (c == -1) {
- break;
- }
-
- switch (c) {
- case OPT_ACCEPT_VCONN:
- accept_controller_re = (optarg[0] == '^'
- ? optarg
- : xasprintf("^%s", optarg));
- break;
-
- case OPT_EXIT_WITHOUT_BIND:
- exit_without_bind = true;
- break;
-
- case OPT_EXIT_AFTER_BIND:
- exit_after_bind = true;
- break;
-
- case OPT_NO_DETACH:
- detach_after_bind = false;
- break;
-
- case OPT_PIDFILE:
- set_pidfile(optarg);
- break;
-
- case OPT_OVERWRITE_PIDFILE:
- ignore_existing_pidfile();
- break;
-
- case 't':
- timeout = strtoul(optarg, NULL, 10);
- if (timeout <= 0) {
- ovs_fatal(0, "value %s on -t or --timeout is not at least 1",
- optarg);
- } else {
- time_alarm(timeout);
- }
- signal(SIGALRM, SIG_DFL);
- break;
-
- case 'h':
- usage();
-
- case 'V':
- OVS_PRINT_VERSION(0, 0);
- exit(EXIT_SUCCESS);
-
- VLOG_OPTION_HANDLERS
-
- case '?':
- exit(EXIT_FAILURE);
-
- default:
- abort();
- }
- }
- free(short_options);
-
- if ((exit_without_bind + exit_after_bind + !detach_after_bind) > 1) {
- ovs_fatal(0, "--exit-without-bind, --exit-after-bind, and --no-detach "
- "are mutually exclusive");
- }
- if (detach_after_bind) {
- set_detach();
- }
-}
-
-static void
-usage(void)
-{
- printf("%s: a tool for discovering OpenFlow controllers.\n"
- "usage: %s [OPTIONS] NETDEV [NETDEV...]\n"
- "where each NETDEV is a network device on which to perform\n"
- "controller discovery.\n"
- "\nOrdinarily, ovs-discover runs in the foreground until it\n"
- "obtains an IP address and discovers an OpenFlow controller via\n"
- "DHCP, then it prints information about the controller to stdout\n"
- "and detaches to the background to maintain the IP address lease.\n"
- "\nNetworking options:\n"
- " --accept-vconn=REGEX accept matching discovered controllers\n"
- " --exit-without-bind exit after discovery, without binding\n"
- " --exit-after-bind exit after discovery, after binding\n"
- " --no-detach do not detach after discovery\n",
- program_name, program_name);
- vlog_usage();
- printf("\nOther options:\n"
- " -t, --timeout=SECS give up discovery after SECS seconds\n"
- " --pidfile[=FILE] create pidfile (default: %s/%s.pid)\n"
- " --overwrite-pidfile with --pidfile, start even if already "
- "running\n"
- " -h, --help display this help message\n"
- " -V, --version display version information\n",
- ovs_rundir(), program_name);
- exit(EXIT_SUCCESS);
-}
diff --git a/utilities/ovs-openflowd.8.in b/utilities/ovs-openflowd.8.in
index 9dec805e0..c22ed9186 100644
--- a/utilities/ovs-openflowd.8.in
+++ b/utilities/ovs-openflowd.8.in
@@ -9,7 +9,7 @@ ovs\-openflowd \- OpenFlow switch implementation
.
.SH SYNOPSIS
.B ovs\-openflowd
-[\fIoptions\fR] \fIdatapath\fR [\fIcontroller\fR\&...]
+[\fIoptions\fR] \fIdatapath\fR \fIcontroller\fR\&...
.
.SH DESCRIPTION
The \fBovs\-openflowd\fR program implements an OpenFlow switch using a
@@ -46,9 +46,6 @@ switch, so more than one controller should be specified only if the
controllers are themselves designed to coordinate with each other.
(The Nicira-defined \fBNXT_ROLE\fR OpenFlow vendor extension may be
useful for this.)
-.PP
-If no \fIcontroller\fR is specified, \fBovs\-openflowd\fR attempts to
-discover the location of a controller automatically (see below).
.
.SS "Contacting Controllers"
The OpenFlow switch must be able to contact the OpenFlow controllers
@@ -75,82 +72,8 @@ independent networks.
.IP
In-band control is the default for \fBovs\-openflowd\fR, so no special
command-line option is required.
-.IP
-With in-band control, the location of the controller can be configured
-manually or discovered automatically:
-.
-.RS
-.IP "controller discovery"
-To make \fBovs\-openflowd\fR discover the location of the controller
-automatically, do not specify a controller on the \fBovs\-openflowd\fR
-command line.
-.IP
-In this mode, \fBovs\-openflowd\fR will broadcast a DHCP request with vendor
-class identifier \fBOpenFlow\fR across the network devices added to
-the datapath with \fBovs\-dpctl add\-if\fR. It will accept any valid DHCP
-reply that has the same vendor class identifier and includes a
-vendor-specific option with code 1 whose contents are a string
-specifying the location of the controller in the same format used on
-the \fBovs\-openflowd\fR command line (e.g. \fBssl:192.168.0.1\fR).
-.IP
-The DHCP reply may also, optionally, include a vendor-specific option
-with code 2 whose contents are a string specifying the URI to the base
-of the OpenFlow PKI (e.g. \fBhttp://192.168.0.1/openflow/pki\fR).
-This URI is used only for bootstrapping the OpenFlow PKI at initial
-switch setup; \fBovs\-openflowd\fR does not use it at all.
-.IP
-The following ISC DHCP server configuration file assigns the IP
-address range 192.168.0.20 through 192.168.0.30 to OpenFlow switches
-that follow the switch protocol and addresses 192.168.0.1 through
-192.168.0.10 to all other DHCP clients:
-.IP
-default\-lease\-time 600;
-.br
-max\-lease\-time 7200;
-.br
-option space openflow;
-.br
-option openflow.controller\-vconn code 1 = text;
-.br
-option openflow.pki\-uri code 2 = text;
-.br
-class "OpenFlow" {
-.br
- match if option vendor\-class\-identifier = "OpenFlow";
-.br
- vendor\-option\-space openflow;
-.br
- option openflow.controller\-vconn "tcp:192.168.0.10";
-.br
- option openflow.pki\-uri "http://192.168.0.10/openflow/pki";
-.br
- option vendor\-class\-identifier "OpenFlow";
-.br
-}
-.br
-subnet 192.168.0.0 netmask 255.255.255.0 {
-.br
- pool {
-.br
- allow members of "OpenFlow";
-.br
- range 192.168.0.20 192.168.0.30;
-.br
- }
-.br
- pool {
-.br
- deny members of "OpenFlow";
-.br
- range 192.168.0.1 192.168.0.10;
-.br
- }
-.br
-}
-.br
-.
-.IP "manual configuration"
-To configure in-band control manually, specify the location of the
+
+Specify the location of the
controller on the \fBovs\-openflowd\fR command line as the \fIcontroller\fR
argument. You must also configure the network device for the OpenFlow
``local port'' to allow \fBovs\-openflowd\fR to connect to that controller.
@@ -216,44 +139,6 @@ Set the description of the datapath to \fIdesc\fR, which may contain up to
purposes and is not guaranteed to be unique and should not be used as
the primary identifier of the datapath.
.
-.SS "Controller Discovery Options"
-.TP
-\fB\-\-accept\-vconn=\fIregex\fR
-When \fBovs\-openflowd\fR performs controller discovery (see \fBContacting
-the Controller\fR, above, for more information about controller
-discovery), it validates the controller location obtained via DHCP
-with a POSIX extended regular expression. Only controllers whose
-names match the regular expression will be accepted.
-.IP
-The default regular expression is \fBssl:.*\fR (meaning that only SSL
-controller connections will be accepted) when any of the SSL
-configuration options \fB\-\-private\-key\fR, \fB\-\-certificate\fR, or
-\fB\-\-ca\-cert\fR is specified. The default is \fB^tcp:.*\fR otherwise
-(meaning that only TCP controller connections will be accepted).
-.IP
-The \fIregex\fR is implicitly anchored at the beginning of the
-controller location string, as if it begins with \fB^\fR.
-.IP
-When controller discovery is not performed, this option has no effect.
-.
-.TP
-\fB\-\-no\-resolv\-conf\fR
-When \fBovs\-openflowd\fR performs controller discovery (see \fBContacting
-the Controller\fR, above, for more information about controller
-discovery), by default it overwrites the system's
-\fB/etc/resolv.conf\fR with domain information and DNS servers
-obtained via DHCP. If the location of the controller is specified
-using a hostname, rather than an IP address, and the network's DNS
-servers ever change, this behavior is essential. But because it also
-interferes with any administrator or process that manages
-\fB/etc/resolv.conf\fR, when this option is specified, \fBovs\-openflowd\fR
-will not modify \fB/etc/resolv.conf\fR.
-.IP
-\fBovs\-openflowd\fR will only modify \fBresolv.conf\fR if the DHCP response
-that it receives specifies one or more DNS servers.
-.IP
-When controller discovery is not performed, this option has no effect.
-.
.SS "Networking Options"
.TP
\fB\-\-datapath\-id=\fIdpid\fR
@@ -455,7 +340,6 @@ Causes \fBovs\-openflowd\fR to gracefully terminate.
.
.BR ovs\-appctl (8),
.BR ovs\-controller (8),
-.BR ovs\-discover (8),
.BR ovs\-dpctl (8),
.BR ovs\-ofctl (8),
.BR ovs\-pki (8)
diff --git a/utilities/ovs-openflowd.c b/utilities/ovs-openflowd.c
index 486eae288..d2e0336f3 100644
--- a/utilities/ovs-openflowd.c
+++ b/utilities/ovs-openflowd.c
@@ -216,8 +216,6 @@ parse_options(int argc, char *argv[], struct ofsettings *s)
OPT_SW_DESC,
OPT_SERIAL_DESC,
OPT_DP_DESC,
- OPT_ACCEPT_VCONN,
- OPT_NO_RESOLV_CONF,
OPT_BR_NAME,
OPT_FAIL_MODE,
OPT_INACTIVITY_PROBE,
@@ -244,8 +242,6 @@ parse_options(int argc, char *argv[], struct ofsettings *s)
{"sw-desc", required_argument, 0, OPT_SW_DESC},
{"serial-desc", required_argument, 0, OPT_SERIAL_DESC},
{"dp-desc", required_argument, 0, OPT_DP_DESC},
- {"accept-vconn", required_argument, 0, OPT_ACCEPT_VCONN},
- {"no-resolv-conf", no_argument, 0, OPT_NO_RESOLV_CONF},
{"config", required_argument, 0, 'F'},
{"br-name", required_argument, 0, OPT_BR_NAME},
{"fail", required_argument, 0, OPT_FAIL_MODE},
@@ -284,8 +280,6 @@ parse_options(int argc, char *argv[], struct ofsettings *s)
controller_opts.max_backoff = 8;
controller_opts.probe_interval = 5;
controller_opts.band = OFPROTO_IN_BAND;
- controller_opts.accept_re = NULL;
- controller_opts.update_resolv_conf = true;
controller_opts.rate_limit = 0;
controller_opts.burst_limit = 0;
s->unixctl_path = NULL;
@@ -337,14 +331,6 @@ parse_options(int argc, char *argv[], struct ofsettings *s)
s->dp_desc = optarg;
break;
- case OPT_ACCEPT_VCONN:
- controller_opts.accept_re = optarg;
- break;
-
- case OPT_NO_RESOLV_CONF:
- controller_opts.update_resolv_conf = false;
- break;
-
case OPT_FAIL_MODE:
if (!strcmp(optarg, "open") || !strcmp(optarg, "standalone")) {
s->fail_mode = OFPROTO_FAIL_STANDALONE;
@@ -467,17 +453,11 @@ parse_options(int argc, char *argv[], struct ofsettings *s)
argc -= optind;
argv += optind;
- if (argc < 1) {
- ovs_fatal(0, "need at least one non-option arguments; "
+ if (argc < 2) {
+ ovs_fatal(0, "need at least two non-option arguments; "
"use --help for usage");
}
- /* Set accept_controller_regex. */
- if (!controller_opts.accept_re) {
- controller_opts.accept_re
- = stream_ssl_is_configured() ? "^ssl:.*" : "^tcp:.*";
- }
-
/* Rate limiting. */
if (controller_opts.rate_limit && controller_opts.rate_limit < 100) {
VLOG_WARN("Rate limit set to unusually low value %d",
@@ -500,9 +480,6 @@ parse_options(int argc, char *argv[], struct ofsettings *s)
svec_add(&controllers, argv[i]);
}
}
- if (argc < 2) {
- svec_add(&controllers, "discover");
- }
/* Set up controllers. */
s->n_controllers = controllers.n;
@@ -511,27 +488,16 @@ parse_options(int argc, char *argv[], struct ofsettings *s)
s->controllers[i] = controller_opts;
s->controllers[i].target = controllers.names[i];
}
-
- /* Sanity check. */
- if (controller_opts.band == OFPROTO_OUT_OF_BAND) {
- for (i = 0; i < s->n_controllers; i++) {
- if (!strcmp(s->controllers[i].target, "discover")) {
- ovs_fatal(0, "Cannot perform discovery with out-of-band "
- "control");
- }
- }
- }
}
static void
usage(void)
{
printf("%s: an OpenFlow switch implementation.\n"
- "usage: %s [OPTIONS] [TYPE@]DATAPATH [CONTROLLER...]\n"
+ "usage: %s [OPTIONS] [TYPE@]DATAPATH CONTROLLER...\n"
"where DATAPATH is a local datapath (e.g. \"dp0\")\n"
"optionally with an explicit TYPE (default: \"system\").\n"
- "Each CONTROLLER is an active OpenFlow connection method. If\n"
- "none is given, ovs-openflowd performs controller discovery.\n",
+ "Each CONTROLLER is an active OpenFlow connection method.\n",
program_name, program_name);
vconn_usage(true, true, true);
printf("\nOpenFlow options:\n"
@@ -542,9 +508,6 @@ usage(void)
" --sw-desc=SW Identify software as SW\n"
" --serial-desc=SERIAL Identify serial number as SERIAL\n"
" --dp-desc=DP_DESC Identify dp description as DP_DESC\n"
- "\nController discovery options:\n"
- " --accept-vconn=REGEX accept matching discovered controllers\n"
- " --no-resolv-conf do not update /etc/resolv.conf\n"
"\nNetworking options:\n"
" --fail=open|closed when controller connection fails:\n"
" closed: drop all packets\n"