#define THIS_MODULE VLM_switch
#include "vlog.h"
+
+/* Strings to describe the manufacturer, hardware, and software. This data
+ * is queriable through the version stats message. */
+char mfr_desc[VERSION_STR_LEN] = "Nicira Networks";
+char hw_desc[VERSION_STR_LEN] = "Reference User-Space Switch";
+char sw_desc[VERSION_STR_LEN] = VERSION;
+
static void parse_options(int argc, char *argv[]);
static void usage(void) NO_RETURN;
fatal(error, "could not listen for vlog connections");
}
+ die_if_already_running();
daemonize();
for (;;) {
parse_options(int argc, char *argv[])
{
enum {
- OPT_MAX_BACKOFF = UCHAR_MAX + 1
+ OPT_MAX_BACKOFF = UCHAR_MAX + 1,
+ OPT_MFR_DESC,
+ OPT_HW_DESC,
+ OPT_SW_DESC
};
static struct option long_options[] = {
{"listen", required_argument, 0, 'l'},
{"detach", no_argument, 0, 'D'},
{"pidfile", optional_argument, 0, 'P'},
+ {"force", no_argument, 0, 'f'},
{"verbose", optional_argument, 0, 'v'},
{"help", no_argument, 0, 'h'},
{"version", no_argument, 0, 'V'},
+ {"mfr-desc", required_argument, 0, OPT_MFR_DESC},
+ {"hw-desc", required_argument, 0, OPT_HW_DESC},
+ {"sw-desc", required_argument, 0, OPT_SW_DESC},
VCONN_SSL_LONG_OPTIONS
{0, 0, 0, 0},
};
set_pidfile(optarg);
break;
+ case 'f':
+ ignore_existing_pidfile();
+ break;
+
case 'v':
vlog_set_verbosity(optarg);
break;
}
break;
+ case OPT_MFR_DESC:
+ strncpy(mfr_desc, optarg, sizeof mfr_desc);
+ break;
+
+ case OPT_HW_DESC:
+ strncpy(hw_desc, optarg, sizeof hw_desc);
+ break;
+
+ case OPT_SW_DESC:
+ strncpy(sw_desc, optarg, sizeof sw_desc);
+ break;
+
case 'l':
if (listen_vconn_name) {
fatal(0, "-l or --listen may be only specified once");
"\nOther options:\n"
" -D, --detach run in background as daemon\n"
" -P, --pidfile[=FILE] create pidfile (default: %s/switch.pid)\n"
+ " -f, --force with -P, start even if already running\n"
" -v, --verbose=MODULE[:FACILITY[:LEVEL]] set logging levels\n"
" -v, --verbose set maximum verbosity level\n"
" -h, --help display this help message\n"