}
static void
-dump_stats_transaction__(struct vconn *vconn, struct ofpbuf *request)
+dump_stats_transaction(struct vconn *vconn, struct ofpbuf *request)
{
const struct ofp_header *request_oh = request->data;
ovs_be32 send_xid = request_oh->xid;
}
static void
-dump_stats_transaction(const char *vconn_name, struct ofpbuf *request)
+dump_trivial_stats_transaction(const char *vconn_name, enum ofpraw raw)
{
+ struct ofpbuf *request;
struct vconn *vconn;
open_vconn(vconn_name, &vconn);
- dump_stats_transaction__(vconn, request);
+ request = ofpraw_alloc(raw, vconn_get_version(vconn), 0);
+ dump_stats_transaction(vconn, request);
vconn_close(vconn);
}
-static void
-dump_trivial_stats_transaction(const char *vconn_name, enum ofpraw raw)
-{
- struct ofpbuf *request;
-
- request = ofpraw_alloc(raw, OFP10_VERSION, 0);
- dump_stats_transaction(vconn_name, request);
-}
-
/* Sends 'request', which should be a request that only has a reply if an error
* occurs, and waits for it to succeed or fail. If an error does occur, prints
* it and exits with an error.
struct vconn *vconn;
vconn = prepare_dump_flows(argc, argv, aggregate, &request);
- dump_stats_transaction__(vconn, request);
+ dump_stats_transaction(vconn, request);
vconn_close(vconn);
}
{
struct ofp10_queue_stats_request *req;
struct ofpbuf *request;
+ struct vconn *vconn;
- request = ofpraw_alloc(OFPRAW_OFPST_QUEUE_REQUEST, OFP10_VERSION, 0);
+ open_vconn(argv[1], &vconn);
+ request = ofpraw_alloc(OFPRAW_OFPST_QUEUE_REQUEST,
+ vconn_get_version(vconn), 0);
req = ofpbuf_put_zeros(request, sizeof *req);
if (argc > 2 && argv[2][0] && strcasecmp(argv[2], "all")) {
memset(req->pad, 0, sizeof req->pad);
- dump_stats_transaction(argv[1], request);
+ dump_stats_transaction(vconn, request);
+ vconn_close(vconn);
}
static enum ofputil_protocol
msg = ofpbuf_new(0);
ofputil_append_flow_monitor_request(&fmr, msg);
- dump_stats_transaction__(vconn, msg);
+ dump_stats_transaction(vconn, msg);
} else {
ovs_fatal(0, "%s: unsupported \"monitor\" argument", arg);
}
{
struct ofp10_port_stats_request *req;
struct ofpbuf *request;
+ struct vconn *vconn;
uint16_t port;
- request = ofpraw_alloc(OFPRAW_OFPST_PORT_REQUEST, OFP10_VERSION, 0);
+ open_vconn(argv[1], &vconn);
+ request = ofpraw_alloc(OFPRAW_OFPST_PORT_REQUEST,
+ vconn_get_version(vconn), 0);
req = ofpbuf_put_zeros(request, sizeof *req);
port = argc > 2 ? str_to_port_no(argv[1], argv[2]) : OFPP_NONE;
req->port_no = htons(port);
- dump_stats_transaction(argv[1], request);
+ dump_stats_transaction(vconn, request);
+ vconn_close(vconn);
}
static void