X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=extras%2Fezio%2Fovs-switchui.c;h=af74af56d5705f8006874f288c1b34e157c2342c;hb=4f484bb2245f077b195da1c560d75f0993491bab;hp=31e37f6869e9041ea687e8c539d303566dfb223c;hpb=40f0707cd9d105203c2b8b97a955b57aca426f13;p=openvswitch diff --git a/extras/ezio/ovs-switchui.c b/extras/ezio/ovs-switchui.c index 31e37f68..af74af56 100644 --- a/extras/ezio/ovs-switchui.c +++ b/extras/ezio/ovs-switchui.c @@ -160,7 +160,8 @@ main(int argc, char *argv[]) "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(); @@ -242,7 +243,7 @@ main(int argc, char *argv[]) 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(); @@ -868,7 +869,7 @@ fetch_status(struct rconn *rconn, struct dict *dict, long long timeout) rconn_run_wait(rconn); rconn_recv_wait(rconn); - poll_timer_wait(timeout - time_msec()); + poll_timer_wait_until(timeout); poll_block(); } } @@ -996,7 +997,7 @@ initialize_terminal(void) } static void -restore_terminal(void *aux UNUSED) +restore_terminal(void *aux OVS_UNUSED) { endwin(); } @@ -1105,6 +1106,7 @@ do_show_data_rates(void *rates_) } if (!rates->xid) { struct ofp_stats_request *rq; + struct ofp_port_stats_request *psr; struct ofpbuf *b; rates->xid = random_uint32(); @@ -1112,6 +1114,10 @@ do_show_data_rates(void *rates_) 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); } @@ -1445,7 +1451,7 @@ init_reboot_notifier(void) } static void -sigusr1_handler(int signr UNUSED) +sigusr1_handler(int signr OVS_UNUSED) { sigusr1_triggered = true; } @@ -1709,7 +1715,7 @@ menu_show(const struct menu *menu, int start, bool select) 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(); @@ -1875,7 +1881,7 @@ yesno(const char *title, bool def) } static void -cmd_show_version(const struct dict *dict UNUSED) +cmd_show_version(const struct dict *dict OVS_UNUSED) { show_string(VERSION BUILDNR); } @@ -1896,7 +1902,7 @@ cmd_browse_status(const struct dict *dict) } static void -cmd_shell(const struct dict *dict UNUSED) +cmd_shell(const struct dict *dict OVS_UNUSED) { const char *home; @@ -1920,7 +1926,7 @@ cmd_shell(const struct dict *dict UNUSED) } static void -cmd_show_motto(const struct dict *dict UNUSED) +cmd_show_motto(const struct dict *dict OVS_UNUSED) { show_string("\"Just Add Ice\""); } @@ -1941,7 +1947,7 @@ static void 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(); @@ -2458,7 +2464,7 @@ abbreviate_netdevs(const struct svec *netdevs, struct ds *abbrev) static void choose_netdevs(struct svec *choices) { - struct svec netdevs; + struct svec netdevs = SVEC_EMPTY_INITIALIZER; struct menu menu; size_t i; @@ -2548,7 +2554,7 @@ disconnected_string(int value) } 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; @@ -2890,7 +2896,7 @@ cmd_configure(const struct dict *dict UNUSED) } 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";