#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 "timeval.h"
#include "util.h"
#include "vconn.h"
+#include "vlog.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);
proctitle_init(argc, argv);
set_program_name(argv[0]);
- time_init();
- vlog_init();
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;
"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();
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();
rconn_run_wait(rconn);
rconn_recv_wait(rconn);
- poll_timer_wait(timeout - time_msec());
+ poll_timer_wait_until(timeout);
poll_block();
}
}
}
if (!rates->xid) {
struct ofp_stats_request *rq;
+ struct ofp_port_stats_request *psr;
struct ofpbuf *b;
rates->xid = random_uint32();
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);
}
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();
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();