projects
/
openvswitch
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
xenserver: Gracefully refresh network UUIDs on pool join or leave.
[openvswitch]
/
extras
/
ezio
/
ovs-switchui.c
diff --git
a/extras/ezio/ovs-switchui.c
b/extras/ezio/ovs-switchui.c
index e25d4e1af4585ac5bc05d066260f5a68a1d1591a..16a6903f5feba3a5983559c53ba9d47e57fdcee4 100644
(file)
--- a/
extras/ezio/ovs-switchui.c
+++ b/
extras/ezio/ovs-switchui.c
@@
-1,4
+1,4
@@
-/* 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.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@
-144,6
+144,7
@@
main(int argc, char *argv[])
long long int last_key_time = 0;
int repeat_count = 0;
long long int last_key_time = 0;
int repeat_count = 0;
+ proctitle_init(argc, argv);
set_program_name(argv[0]);
time_init();
vlog_init();
set_program_name(argv[0]);
time_init();
vlog_init();
@@
-165,7
+166,7
@@
main(int argc, char *argv[])
daemonize();
initialize_terminal();
daemonize();
initialize_terminal();
- fatal_signal_add_hook(restore_terminal, NULL, true);
+ fatal_signal_add_hook(restore_terminal, NULL,
NULL,
true);
msg = NULL;
countdown = 0;
msg = NULL;
countdown = 0;
@@
-549,7
+550,7
@@
show_dpid_ip(struct rconn *rconn, const struct dict *dict)
const char *is_connected, *local_ip;
dict_lookup(dict, "local.is-connected", &is_connected);
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. */
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. */
@@
-995,7
+996,7
@@
initialize_terminal(void)
}
static void
}
static void
-restore_terminal(void *aux UNUSED)
+restore_terminal(void *aux
OVS_
UNUSED)
{
endwin();
}
{
endwin();
}
@@
-1104,6
+1105,7
@@
do_show_data_rates(void *rates_)
}
if (!rates->xid) {
struct ofp_stats_request *rq;
}
if (!rates->xid) {
struct ofp_stats_request *rq;
+ struct ofp_port_stats_request *psr;
struct ofpbuf *b;
rates->xid = random_uint32();
struct ofpbuf *b;
rates->xid = random_uint32();
@@
-1111,6
+1113,10
@@
do_show_data_rates(void *rates_)
rates->xid, &b);
rq->type = htons(OFPST_PORT);
rq->flags = htons(0);
rates->xid, &b);
rq->type = htons(OFPST_PORT);
rq->flags = htons(0);
+ psr = ofpbuf_put_uninit(b, sizeof *psr);
+ memset(psr, 0, sizeof *psr);
+ psr->port_no = htons(OFPP_NONE);
+ update_openflow_length(b);
rconn_send_with_limit(rates->rconn, b, counter, 10);
}
rconn_send_with_limit(rates->rconn, b, counter, 10);
}
@@
-1209,7
+1215,7
@@
show_data_rates(struct rconn *rconn, const struct dict *dict)
static bool inited = false;
dict_lookup(dict, "local.is-connected", &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 (!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. */
@@
-1247,7
+1253,7
@@
allocate_message(struct message **msgp)
{
if (!*msgp) {
/* Allocate and initialize message. */
{
if (!*msgp) {
/* Allocate and initialize message. */
- *msgp = x
calloc(1,
sizeof **msgp);
+ *msgp = x
zalloc(
sizeof **msgp);
(*msgp)->index = n_messages;
/* Add to list of messages. */
(*msgp)->index = n_messages;
/* Add to list of messages. */
@@
-1444,7
+1450,7
@@
init_reboot_notifier(void)
}
static void
}
static void
-sigusr1_handler(int signr UNUSED)
+sigusr1_handler(int signr
OVS_
UNUSED)
{
sigusr1_triggered = true;
}
{
sigusr1_triggered = true;
}
@@
-1486,7
+1492,7
@@
static int menu_show(const struct menu *, int start, bool select);
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_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 *);
static void cmd_browse_status(const struct dict *);
static void cmd_show_motto(const struct dict *);
@@
-1542,7
+1548,7
@@
menu(const struct dict *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, "Exit");
menu_add_item(&menu, "Show Version")->f = cmd_show_version;
menu_add_item(&menu, "Configure")->f = cmd_configure;
- menu_add_item(&menu, "Set
up PKI")->f = cmd_set
up_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;
if (debug_mode) {
menu_add_item(&menu, "Browse Status")->f = cmd_browse_status;
menu_add_item(&menu, "Shell")->f = cmd_shell;
@@
-1874,7
+1880,7
@@
yesno(const char *title, bool def)
}
static void
}
static void
-cmd_show_version(const struct dict *dict UNUSED)
+cmd_show_version(const struct dict *dict
OVS_
UNUSED)
{
show_string(VERSION BUILDNR);
}
{
show_string(VERSION BUILDNR);
}
@@
-1895,7
+1901,7
@@
cmd_browse_status(const struct dict *dict)
}
static void
}
static void
-cmd_shell(const struct dict *dict UNUSED)
+cmd_shell(const struct dict *dict
OVS_
UNUSED)
{
const char *home;
{
const char *home;
@@
-1919,7
+1925,7
@@
cmd_shell(const struct dict *dict UNUSED)
}
static void
}
static void
-cmd_show_motto(const struct dict *dict UNUSED)
+cmd_show_motto(const struct dict *dict
OVS_
UNUSED)
{
show_string("\"Just Add Ice\"");
}
{
show_string("\"Just Add Ice\"");
}
@@
-2079,7
+2085,7
@@
save_config(const struct svec *settings)
}
svec_init(&argv);
}
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");
svec_append(&argv, settings);
svec_terminate(&argv);
ok = run_and_report_failure(argv.names, "Save failed");
@@
-2457,7
+2463,7
@@
abbreviate_netdevs(const struct svec *netdevs, struct ds *abbrev)
static void
choose_netdevs(struct svec *choices)
{
static void
choose_netdevs(struct svec *choices)
{
- struct svec netdevs;
+ struct svec netdevs
= SVEC_EMPTY_INITIALIZER
;
struct menu menu;
size_t i;
struct menu menu;
size_t i;
@@
-2478,9
+2484,9
@@
choose_netdevs(struct svec *choices)
continue;
}
continue;
}
- retval = netdev_open
(name, NETDEV_ETH_TYPE_NONE
, &netdev);
+ retval = netdev_open
_default(name
, &netdev);
if (!retval) {
if (!retval) {
- bool exclude = netdev_get_in4(netdev, NULL
)
;
+ bool exclude = netdev_get_in4(netdev, NULL
, NULL) == 0
;
netdev_close(netdev);
if (exclude) {
continue;
netdev_close(netdev);
if (exclude) {
continue;
@@
-2547,7
+2553,7
@@
disconnected_string(int value)
}
static void
}
static void
-cmd_configure(const struct dict *dict UNUSED)
+cmd_configure(const struct dict *dict
OVS_
UNUSED)
{
bool debug_mode = dict_get_bool(dict, "debug", false);
struct dict config_dict;
{
bool debug_mode = dict_get_bool(dict, "debug", false);
struct dict config_dict;
@@
-2801,7
+2807,8
@@
cmd_configure(const struct dict *dict UNUSED)
out = prompt("Ctlr rate limit:", in,
"^(Disabled|("NUM100_TO_99999_RE")/s)$");
free(in);
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;
free(out);
break;
@@
-2812,7
+2819,8
@@
cmd_configure(const struct dict *dict UNUSED)
out = prompt("Activity probe:", in,
"^(Default|("NUM5_TO_99999_RE") s)$");
free(in);
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;
free(out);
break;
@@
-2823,7
+2831,8
@@
cmd_configure(const struct dict *dict UNUSED)
out = prompt("Max backoff:", in,
"^(Default|("NUM1_TO_99999_RE") s)$");
free(in);
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;
}
free(out);
break;
}
@@
-2886,7
+2895,7
@@
cmd_configure(const struct dict *dict UNUSED)
}
static void
}
static void
-cmd_set
up_pki(const struct dict *dict
UNUSED)
+cmd_set
_up_pki(const struct dict *dict OVS_
UNUSED)
{
static const char def_privkey_file[]
= "/etc/openflow-switch/of0-privkey.pem";
{
static const char def_privkey_file[]
= "/etc/openflow-switch/of0-privkey.pem";