projects
/
openvswitch
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
vlog: Make the vlog module catalog program-specific.
[openvswitch]
/
extras
/
ezio
/
ovs-switchui.c
diff --git
a/extras/ezio/ovs-switchui.c
b/extras/ezio/ovs-switchui.c
index e087aa00e0b23c4a89d47cf610ccf24cc51dc4b4..6f433a3f63f1024c8618c56be74025aea650fdaf 100644
(file)
--- a/
extras/ezio/ovs-switchui.c
+++ b/
extras/ezio/ovs-switchui.c
@@
-35,6
+35,7
@@
#include "ezio.h"
#include "fatal-signal.h"
#include "netdev.h"
#include "ezio.h"
#include "fatal-signal.h"
#include "netdev.h"
+#include "ofp-util.h"
#include "ofpbuf.h"
#include "openflow/nicira-ext.h"
#include "openflow/openflow.h"
#include "ofpbuf.h"
#include "openflow/nicira-ext.h"
#include "openflow/openflow.h"
@@
-48,10
+49,10
@@
#include "timeval.h"
#include "util.h"
#include "vconn.h"
#include "timeval.h"
#include "util.h"
#include "vconn.h"
+#include "vlog.h"
#include "xtoxll.h"
#include "xtoxll.h"
-#define THIS_MODULE VLM_switchui
-#include "vlog.h"
+VLOG_DEFINE_THIS_MODULE(switchui)
static void parse_options(int argc, char *argv[]);
static void usage(void);
static void parse_options(int argc, char *argv[]);
static void usage(void);
@@
-144,12
+145,11
@@
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]);
set_program_name(argv[0]);
- time_init();
- vlog_init();
parse_options(argc, argv);
signal(SIGPIPE, SIG_IGN);
parse_options(argc, argv);
signal(SIGPIPE, SIG_IGN);
- vlog_set_levels(
VLM_ANY_MODULE
, VLF_CONSOLE, VLL_EMER);
+ vlog_set_levels(
NULL
, VLF_CONSOLE, VLL_EMER);
init_reboot_notifier();
argc -= optind;
init_reboot_notifier();
argc -= optind;
@@
-159,13
+159,14
@@
main(int argc, char *argv[])
"use --help for help");
}
"use --help for help");
}
- rconn = rconn_new(argv[0], 5, 5);
+ rconn = rconn_create(5, 5);
+ rconn_connect(rconn, argv[0], NULL);
die_if_already_running();
daemonize();
initialize_terminal();
die_if_already_running();
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;
@@
-241,7
+242,7
@@
main(int argc, char *argv[])
refresh();
poll_fd_wait(STDIN_FILENO, POLLIN);
refresh();
poll_fd_wait(STDIN_FILENO, POLLIN);
- poll_timer_wait
(timeout - time_msec()
);
+ poll_timer_wait
_until(timeout
);
poll_block();
} while (time_msec() < timeout);
age_messages();
poll_block();
} while (time_msec() < timeout);
age_messages();
@@
-867,7
+868,7
@@
fetch_status(struct rconn *rconn, struct dict *dict, long long timeout)
rconn_run_wait(rconn);
rconn_recv_wait(rconn);
rconn_run_wait(rconn);
rconn_recv_wait(rconn);
- poll_timer_wait
(timeout - time_msec()
);
+ poll_timer_wait
_until(timeout
);
poll_block();
}
}
poll_block();
}
}
@@
-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);
}
@@
-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. */
@@
-1708,7
+1714,7
@@
menu_show(const struct menu *menu, int start, bool select)
refresh();
if (pos < min || pos > max) {
refresh();
if (pos < min || pos > max) {
- poll_timer_wait
(adjust - time_msec()
);
+ poll_timer_wait
_until(adjust
);
}
poll_fd_wait(STDIN_FILENO, POLLIN);
poll_block();
}
poll_fd_wait(STDIN_FILENO, POLLIN);
poll_block();
@@
-1940,7
+1946,7
@@
static void
block_until(long long timeout)
{
while (timeout > time_msec()) {
block_until(long long timeout)
{
while (timeout > time_msec()) {
- poll_timer_wait
(timeout - time_msec()
);
+ poll_timer_wait
_until(timeout
);
poll_block();
}
drain_keyboard_buffer();
poll_block();
}
drain_keyboard_buffer();
@@
-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,7
+2484,7
@@
choose_netdevs(struct svec *choices)
continue;
}
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, NULL) == 0;
netdev_close(netdev);
if (!retval) {
bool exclude = netdev_get_in4(netdev, NULL, NULL) == 0;
netdev_close(netdev);