static void
ofctl_queue_stats(int argc, char *argv[])
{
- struct ofp_queue_stats_request *req;
+ struct ofp10_queue_stats_request *req;
struct ofpbuf *request;
request = ofpraw_alloc(OFPRAW_OFPST_QUEUE_REQUEST, OFP10_VERSION, 0);
return;
}
- msg = ofputil_encode_barrier_request();
+ msg = ofputil_encode_barrier_request(vconn_get_version(aux->vconn));
error = vconn_send_block(aux->vconn, msg);
if (error) {
ofpbuf_delete(msg);
static void
ofctl_dump_ports(int argc, char *argv[])
{
- struct ofp_port_stats_request *req;
+ struct ofp10_port_stats_request *req;
struct ofpbuf *request;
uint16_t port;
version->cookie = fm.new_cookie;
version->idle_timeout = fm.idle_timeout;
version->hard_timeout = fm.hard_timeout;
- version->flags = fm.flags & (OFPFF_SEND_FLOW_REM | OFPFF_EMERG);
+ version->flags = fm.flags & (OFPFF_SEND_FLOW_REM | OFPFF10_EMERG);
version->ofpacts = fm.ofpacts;
version->ofpacts_len = fm.ofpacts_len;
struct ofpbuf *reply = *replyp;
for (;;) {
- ovs_be16 flags;
int retval;
+ bool more;
/* Get a flow stats reply message, if we don't already have one. */
if (!reply) {
return true;
case EOF:
- flags = ((const struct ofp_stats_msg *) reply->l2)->flags;
+ more = ofpmp_more(reply->l2);
ofpbuf_delete(reply);
reply = NULL;
- if (!(flags & htons(OFPSF_REPLY_MORE))) {
+ if (!more) {
*replyp = NULL;
return false;
}
/* Convert string to nx_match. */
ofpbuf_init(&nx_match, 0);
- match_len = nx_match_from_string(ds_cstr(&in), &nx_match);
+ if (oxm) {
+ match_len = oxm_match_from_string(ds_cstr(&in), &nx_match);
+ } else {
+ match_len = nx_match_from_string(ds_cstr(&in), &nx_match);
+ }
/* Convert nx_match to cls_rule. */
if (strict) {
- error = nx_pull_match(&nx_match, match_len, 0, &rule,
- &cookie, &cookie_mask);
+ if (oxm) {
+ error = oxm_pull_match(&nx_match, 0, &rule);
+ } else {
+ error = nx_pull_match(&nx_match, match_len, 0, &rule,
+ &cookie, &cookie_mask);
+ }
} else {
- error = nx_pull_match_loose(&nx_match, match_len, 0, &rule,
- &cookie, &cookie_mask);
+ if (oxm) {
+ error = oxm_pull_match_loose(&nx_match, 0, &rule);
+ } else {
+ error = nx_pull_match_loose(&nx_match, match_len, 0, &rule,
+ &cookie, &cookie_mask);
+ }
}
+
if (!error) {
char *out;
/* Convert cls_rule back to nx_match. */
ofpbuf_uninit(&nx_match);
ofpbuf_init(&nx_match, 0);
- match_len = nx_put_match(&nx_match, oxm, &rule,
- cookie, cookie_mask);
+ if (oxm) {
+ match_len = oxm_put_match(&nx_match, &rule);
+ out = oxm_match_to_string(nx_match.data, match_len);
+ } else {
+ match_len = nx_put_match(&nx_match, &rule,
+ cookie, cookie_mask);
+ out = nx_match_to_string(nx_match.data, match_len);
+ }
- /* Convert nx_match to string. */
- out = nx_match_to_string(nx_match.data, match_len);
puts(out);
free(out);
} else {
/* Convert to and from NXM. */
ofpbuf_init(&nxm, 0);
- nxm_match_len = nx_put_match(&nxm, false, &rule, htonll(0), htonll(0));
+ nxm_match_len = nx_put_match(&nxm, &rule, htonll(0), htonll(0));
nxm_s = nx_match_to_string(nxm.data, nxm_match_len);
error = nx_pull_match(&nxm, nxm_match_len, 0, &nxm_rule, NULL, NULL);
printf("NXM: %s -> ", nxm_s);
/* Convert to and from OXM. */
ofpbuf_init(&nxm, 0);
- nxm_match_len = nx_put_match(&nxm, true, &rule, htonll(0), htonll(0));
- nxm_s = nx_match_to_string(nxm.data, nxm_match_len);
- error = nx_pull_match(&nxm, nxm_match_len, 0, &nxm_rule, NULL, NULL);
+ nxm_match_len = oxm_put_match(&nxm, &rule);
+ nxm_s = oxm_match_to_string(nxm.data, nxm_match_len);
+ error = oxm_pull_match(&nxm, 0, &nxm_rule);
printf("OXM: %s -> ", nxm_s);
if (error) {
printf("%s\n", ofperr_to_string(error));
}
for (version = 0; version <= UINT8_MAX; version++) {
- const struct ofperr_domain *domain;
-
- domain = ofperr_domain_from_version(version);
- if (!domain) {
+ const char *name = ofperr_domain_get_name(version);
+ if (!name) {
continue;
}
-
printf("%s: %d,%d\n",
- ofperr_domain_get_name(domain),
- ofperr_get_type(error, domain),
- ofperr_get_code(error, domain));
+ ofperr_domain_get_name(version),
+ ofperr_get_type(error, version),
+ ofperr_get_code(error, version));
}
}