static void parse_options(int argc, char *argv[]);
static void usage(void) NO_RETURN;
+static const char *listen_vconn_name;
static struct datapath *dp;
static uint64_t dpid = UINT64_MAX;
static char *port_list;
}
error = dp_new(&dp, dpid, rconn_new(argv[optind], 128));
+ if (listen_vconn_name) {
+ struct vconn *listen_vconn;
+ int retval;
+
+ retval = vconn_open(listen_vconn_name, &listen_vconn);
+ if (retval && retval != EAGAIN) {
+ fatal(retval, "opening %s", listen_vconn_name);
+ }
+ if (!vconn_is_passive(listen_vconn)) {
+ fatal(0, "%s is not a passive vconn", listen_vconn_name);
+ }
+ dp_add_listen_vconn(dp, listen_vconn);
+ }
if (error) {
fatal(error, "could not create datapath");
}
static struct option long_options[] = {
{"interfaces", required_argument, 0, 'i'},
{"datapath-id", required_argument, 0, 'd'},
+ {"listen", required_argument, 0, 'l'},
{"verbose", optional_argument, 0, 'v'},
{"help", no_argument, 0, 'h'},
{"version", no_argument, 0, 'V'},
-#ifdef HAVE_OPENSSL
- {"private-key", required_argument, 0, 'p'},
- {"certificate", required_argument, 0, 'c'},
- {"ca-cert", required_argument, 0, 'C'},
-#endif
+ VCONN_SSL_LONG_OPTIONS
{0, 0, 0, 0},
};
char *short_options = long_options_to_short_options(long_options);
}
break;
-#ifdef HAVE_OPENSSL
- case 'p':
- vconn_ssl_set_private_key_file(optarg);
- break;
-
- case 'c':
- vconn_ssl_set_certificate_file(optarg);
+ case 'l':
+ if (listen_vconn_name) {
+ fatal(0, "-l or --listen may be only specified once");
+ }
+ listen_vconn_name = optarg;
break;
- case 'C':
- vconn_ssl_set_ca_cert_file(optarg);
- break;
-#endif
+ VCONN_SSL_OPTION_HANDLERS
case '?':
exit(EXIT_FAILURE);
"usage: %s [OPTIONS] CONTROLLER\n"
"where CONTROLLER is an active OpenFlow connection method.\n",
program_name, program_name);
- vconn_usage(true, false);
- printf("\nOptions:\n"
+ vconn_usage(true, true);
+ printf("\nConfiguration options:\n"
" -i, --interfaces=NETDEV[,NETDEV]...\n"
" add specified initial switch ports\n"
" -d, --datapath-id=ID Use ID as the OpenFlow switch ID\n"
" (ID must consist of 12 hex digits)\n"
+ " -l, --listen=METHOD allow management connections on METHOD\n"
+ " (a passive OpenFlow connection method)\n"
+ "\nOther options:\n"
" -v, --verbose set maximum verbosity level\n"
" -h, --help display this help message\n"
" -V, --version display version information\n");