error = parse_ofp_flow_stats_request_str(&fsr, aggregate,
argc > 2 ? argv[2] : "",
- &usable_protocols,
- !(allowed_protocols
- & OFPUTIL_P_OF10_ANY));
+ &usable_protocols);
if (error) {
ovs_fatal(0, "%s", error);
}
char *error;
error = parse_ofp_flow_mod_file(argv[2], command, &fms, &n_fms,
- &usable_protocols,
- !(allowed_protocols & OFPUTIL_P_OF10_ANY));
+ &usable_protocols);
if (error) {
ovs_fatal(0, "%s", error);
}
enum ofputil_protocol usable_protocols;
error = parse_ofp_flow_mod_str(&fm, argc > 2 ? argv[2] : "", command,
- &usable_protocols,
- !(allowed_protocols
- & OFPUTIL_P_OF10_ANY));
+ &usable_protocols);
if (error) {
ovs_fatal(0, "%s", error);
}
length = ntohs(oh->length);
if (length < sizeof *oh) {
- ovs_fatal(0, "%s: %zu-byte message is too short for OpenFlow",
+ ovs_fatal(0, "%s: %"PRIuSIZE"-byte message is too short for OpenFlow",
filename, length);
}
payload = argc > 2 ? atoi(argv[2]) : 64;
if (payload > max_payload) {
- ovs_fatal(0, "payload must be between 0 and %zu bytes", max_payload);
+ ovs_fatal(0, "payload must be between 0 and %"PRIuSIZE" bytes", max_payload);
}
open_vconn(argv[1], &vconn);
printf("Reply:\n");
ofp_print(stdout, reply, reply->size, verbosity + 2);
}
- printf("%zu bytes from %s: xid=%08"PRIx32" time=%.1f ms\n",
+ printf("%"PRIuSIZE" bytes from %s: xid=%08"PRIx32" time=%.1f ms\n",
reply->size, argv[1], ntohl(rpy_hdr->xid),
(1000*(double)(end.tv_sec - start.tv_sec))
+ (.001*(end.tv_usec - start.tv_usec)));
payload_size = atoi(argv[2]);
if (payload_size > max_payload) {
- ovs_fatal(0, "payload must be between 0 and %zu bytes", max_payload);
+ ovs_fatal(0, "payload must be between 0 and %"PRIuSIZE" bytes", max_payload);
}
message_size = sizeof(struct ofp_header) + payload_size;
char *error;
enum ofputil_protocol usable;
- error = parse_ofp_str(&fm, OFPFC_ADD, ds_cstr(&s), &usable,
- !(allowed_protocols & OFPUTIL_P_OF10_ANY));
+ error = parse_ofp_str(&fm, OFPFC_ADD, ds_cstr(&s), &usable);
if (error) {
ovs_fatal(0, "%s:%d: %s", filename, line_number, error);
}
struct vconn *vconn;
struct fte *fte;
- classifier_init(&cls);
+ classifier_init(&cls, NULL);
usable_protocols = read_flows_from_file(argv[2], &cls, FILE_IDX);
protocol = open_vconn(argv[1], &vconn);
struct ds a_s, b_s;
struct fte *fte;
- classifier_init(&cls);
+ classifier_init(&cls, NULL);
read_flows_from_source(argv[1], &cls, 0);
read_flows_from_source(argv[2], &cls, 1);
struct ofputil_flow_mod fm;
char *error;
- error = parse_ofp_flow_mod_str(&fm, argv[1], OFPFC_ADD, &usable_protocols,
- !(allowed_protocols & OFPUTIL_P_OF10_ANY));
+ error = parse_ofp_flow_mod_str(&fm, argv[1], OFPFC_ADD, &usable_protocols);
if (error) {
ovs_fatal(0, "%s", error);
}
char *error;
error = parse_ofp_flow_mod_file(argv[1], OFPFC_ADD, &fms, &n_fms,
- &usable_protocols,
- !(allowed_protocols & OFPUTIL_P_OF10_ANY));
+ &usable_protocols);
if (error) {
ovs_fatal(0, "%s", error);
}
for (i = 0; i < MIN(a_len, b_len); i++) {
if (a[i] != b[i]) {
- printf("%s%2zu: %02"PRIx8" -> %02"PRIx8"\n",
+ printf("%s%2"PRIuSIZE": %02"PRIx8" -> %02"PRIx8"\n",
prefix, i, a[i], b[i]);
}
}
for (i = a_len; i < b_len; i++) {
- printf("%s%2zu: (none) -> %02"PRIx8"\n", prefix, i, b[i]);
+ printf("%s%2"PRIuSIZE": (none) -> %02"PRIx8"\n", prefix, i, b[i]);
}
for (i = b_len; i < a_len; i++) {
- printf("%s%2zu: %02"PRIx8" -> (none)\n", prefix, i, a[i]);
+ printf("%s%2"PRIuSIZE": %02"PRIx8" -> (none)\n", prefix, i, a[i]);
}
}
/* Convert to ofpacts. */
ofpbuf_init(&ofpacts, 0);
size = of10_in.size;
- error = ofpacts_pull_openflow10(&of10_in, of10_in.size, &ofpacts);
+ error = ofpacts_pull_openflow_actions(&of10_in, of10_in.size,
+ OFP10_VERSION, &ofpacts);
if (error) {
printf("bad OF1.1 actions: %s\n\n", ofperr_get_name(error));
ofpbuf_uninit(&ofpacts);
/* Convert back to ofp10 actions and print differences from input. */
ofpbuf_init(&of10_out, 0);
- ofpacts_put_openflow10(ofpacts.data, ofpacts.size, &of10_out);
+ ofpacts_put_openflow_actions(ofpacts.data, ofpacts.size, &of10_out,
+ OFP10_VERSION);
print_differences("", of10_in.data, of10_in.size,
of10_out.data, of10_out.size);
ovs_fatal(0, "Trailing garbage in hex data");
}
if (match_expout.size != sizeof(struct ofp10_match)) {
- ovs_fatal(0, "Input is %zu bytes, expected %zu",
+ ovs_fatal(0, "Input is %"PRIuSIZE" bytes, expected %"PRIuSIZE,
match_expout.size, sizeof(struct ofp10_match));
}
ovs_fatal(0, "Trailing garbage in hex data");
}
if (match_in.size != sizeof(struct ofp10_match)) {
- ovs_fatal(0, "Input is %zu bytes, expected %zu",
+ ovs_fatal(0, "Input is %"PRIuSIZE" bytes, expected %"PRIuSIZE,
match_in.size, sizeof(struct ofp10_match));
}
ovs_fatal(0, "Trailing garbage in hex data");
}
if (match_in.size != sizeof(struct ofp11_match)) {
- ovs_fatal(0, "Input is %zu bytes, expected %zu",
+ ovs_fatal(0, "Input is %"PRIuSIZE" bytes, expected %"PRIuSIZE,
match_in.size, sizeof(struct ofp11_match));
}
/* Convert to ofpacts. */
ofpbuf_init(&ofpacts, 0);
size = of11_in.size;
- error = ofpacts_pull_openflow11_actions(&of11_in, OFP11_VERSION,
- of11_in.size, &ofpacts);
+ error = ofpacts_pull_openflow_actions(&of11_in, of11_in.size,
+ OFP11_VERSION, &ofpacts);
if (error) {
printf("bad OF1.1 actions: %s\n\n", ofperr_get_name(error));
ofpbuf_uninit(&ofpacts);
/* Convert back to ofp11 actions and print differences from input. */
ofpbuf_init(&of11_out, 0);
- ofpacts_put_openflow11_actions(ofpacts.data, ofpacts.size, &of11_out);
+ ofpacts_put_openflow_actions(ofpacts.data, ofpacts.size, &of11_out,
+ OFP11_VERSION);
print_differences("", of11_in.data, of11_in.size,
of11_out.data, of11_out.size);
/* Convert to ofpacts. */
ofpbuf_init(&ofpacts, 0);
size = of11_in.size;
- error = ofpacts_pull_openflow11_instructions(&of11_in, OFP11_VERSION,
- of11_in.size, &ofpacts);
+ error = ofpacts_pull_openflow_instructions(&of11_in, of11_in.size,
+ OFP11_VERSION, &ofpacts);
if (!error) {
/* Verify actions, enforce consistency. */
struct flow flow;
memset(&flow, 0, sizeof flow);
- error = ofpacts_check(ofpacts.data, ofpacts.size, &flow, OFPP_MAX,
- table_id ? atoi(table_id) : 0, true);
+ error = ofpacts_check_consistency(ofpacts.data, ofpacts.size,
+ &flow, OFPP_MAX,
+ table_id ? atoi(table_id) : 0,
+ 255, OFPUTIL_P_OF11_STD);
}
if (error) {
printf("bad OF1.1 instructions: %s\n\n", ofperr_get_name(error));
/* Convert back to ofp11 instructions and print differences from
* input. */
ofpbuf_init(&of11_out, 0);
- ofpacts_put_openflow11_instructions(ofpacts.data, ofpacts.size,
- &of11_out);
+ ofpacts_put_openflow_instructions(ofpacts.data, ofpacts.size,
+ &of11_out, OFP13_VERSION);
print_differences("", of11_in.data, of11_in.size,
of11_out.data, of11_out.size);
string_s = match_to_string(&match, OFP_DEFAULT_PRIORITY);
printf("%s -> ", string_s);
fflush(stdout);
- error_s = parse_ofp_str(&fm, -1, string_s, &usable_protocols,
- !(allowed_protocols & OFPUTIL_P_OF10_ANY));
+ error_s = parse_ofp_str(&fm, -1, string_s, &usable_protocols);
if (error_s) {
ovs_fatal(0, "%s", error_s);
}