-/* Copyright (c) 2008, 2009 Nicira Networks, Inc.
+/* Copyright (c) 2008, 2009, 2010 Nicira Networks, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
static void show_flows(struct rconn *);
static void show_dpid_ip(struct rconn *, const struct dict *);
-static void show_secchan_state(const struct dict *);
+static void show_ofproto_state(const struct dict *);
static void show_fail_open_state(const struct dict *);
static void show_discovery_state(const struct dict *);
static void show_remote_state(const struct dict *);
long long int last_key_time = 0;
int repeat_count = 0;
+ proctitle_init(argc, argv);
set_program_name(argv[0]);
time_init();
vlog_init();
daemonize();
initialize_terminal();
- fatal_signal_add_hook(restore_terminal, NULL, true);
+ fatal_signal_add_hook(restore_terminal, NULL, NULL, true);
msg = NULL;
countdown = 0;
if (!show_reboot_state()) {
show_flows(rconn);
show_dpid_ip(rconn, dict);
- show_secchan_state(dict);
+ show_ofproto_state(dict);
show_fail_open_state(dict);
show_discovery_state(dict);
show_remote_state(dict);
const char *is_connected, *local_ip;
dict_lookup(dict, "local.is-connected", &is_connected);
- dict_lookup(dict, "in-band.local-ip", &local_ip);
+ dict_lookup(dict, "remote.local-ip", &local_ip);
if (!is_connected && !local_ip) {
/* If we're not connected to the datapath and don't have a local IP,
* then we won't have anything useful to show anyhow. */
}
static void
-show_secchan_state(const struct dict *dict)
+show_ofproto_state(const struct dict *dict)
{
static struct message *msg;
const char *is_connected;
static bool inited = false;
dict_lookup(dict, "local.is-connected", &is_connected);
- dict_lookup(dict, "in-band.local-ip", &local_ip);
+ dict_lookup(dict, "remote.local-ip", &local_ip);
if (!is_connected && !local_ip) {
/* If we're not connected to the datapath and don't have a local IP,
* then we won't have anything useful to show anyhow. */
{
if (!*msgp) {
/* Allocate and initialize message. */
- *msgp = xcalloc(1, sizeof **msgp);
+ *msgp = xzalloc(sizeof **msgp);
(*msgp)->index = n_messages;
/* Add to list of messages. */
static void cmd_shell(const struct dict *);
static void cmd_show_version(const struct dict *);
static void cmd_configure(const struct dict *);
-static void cmd_setup_pki(const struct dict *);
+static void cmd_set_up_pki(const struct dict *);
static void cmd_browse_status(const struct dict *);
static void cmd_show_motto(const struct dict *);
menu_add_item(&menu, "Exit");
menu_add_item(&menu, "Show Version")->f = cmd_show_version;
menu_add_item(&menu, "Configure")->f = cmd_configure;
- menu_add_item(&menu, "Setup PKI")->f = cmd_setup_pki;
+ menu_add_item(&menu, "Set up PKI")->f = cmd_set_up_pki;
if (debug_mode) {
menu_add_item(&menu, "Browse Status")->f = cmd_browse_status;
menu_add_item(&menu, "Shell")->f = cmd_shell;
}
svec_init(&argv);
- svec_add(&argv, "/usr/share/openvswitch/commands/reconfigure");
+ svec_add(&argv, "/usr/share/openvswitch-switchui/reconfigure");
svec_append(&argv, settings);
svec_terminate(&argv);
ok = run_and_report_failure(argv.names, "Save failed");
static void
choose_netdevs(struct svec *choices)
{
- struct svec netdevs;
+ struct svec netdevs = SVEC_EMPTY_INITIALIZER;
struct menu menu;
size_t i;
continue;
}
- retval = netdev_open(name, NETDEV_ETH_TYPE_NONE, &netdev);
+ retval = netdev_open_default(name, &netdev);
if (!retval) {
- bool exclude = netdev_get_in4(netdev, NULL);
+ bool exclude = netdev_get_in4(netdev, NULL, NULL) == 0;
netdev_close(netdev);
if (exclude) {
continue;
out = prompt("Ctlr rate limit:", in,
"^(Disabled|("NUM100_TO_99999_RE")/s)$");
free(in);
- config.rate_limit = isdigit(out[0]) ? atoi(out) : -1;
+ config.rate_limit
+ = isdigit((unsigned char)out[0]) ? atoi(out) : -1;
free(out);
break;
out = prompt("Activity probe:", in,
"^(Default|("NUM5_TO_99999_RE") s)$");
free(in);
- config.inactivity_probe = isdigit(out[0]) ? atoi(out) : -1;
+ config.inactivity_probe
+ = isdigit((unsigned char)out[0]) ? atoi(out) : -1;
free(out);
break;
out = prompt("Max backoff:", in,
"^(Default|("NUM1_TO_99999_RE") s)$");
free(in);
- config.max_backoff = isdigit(out[0]) ? atoi(out) : -1;
+ config.max_backoff
+ = isdigit((unsigned char)out[0]) ? atoi(out) : -1;
free(out);
break;
}
}
static void
-cmd_setup_pki(const struct dict *dict UNUSED)
+cmd_set_up_pki(const struct dict *dict UNUSED)
{
static const char def_privkey_file[]
= "/etc/openflow-switch/of0-privkey.pem";