ofpbuf_use_stack(&key, &keybuf, sizeof keybuf);
odp_flow_key_from_flow(&key, &flow, NULL, 0, true);
- dpif_flow_hash(backer->dpif, ofpbuf_data(&key), ofpbuf_size(&key), &ufid);
+ dpif_flow_hash(backer->dpif, key.data, key.size, &ufid);
enable_ufid = dpif_probe_feature(backer->dpif, "UFID", &key, &ufid);
/* Execute the actions. On older datapaths this fails with ERANGE, on
* newer datapaths it succeeds. */
- execute.actions = ofpbuf_data(&actions);
- execute.actions_len = ofpbuf_size(&actions);
+ execute.actions = actions.data;
+ execute.actions_len = actions.size;
execute.packet = &packet;
execute.needs_help = false;
execute.probe = true;
/* Execute the actions. On older datapaths this fails with EINVAL, on
* newer datapaths it succeeds. */
- execute.actions = ofpbuf_data(&actions);
- execute.actions_len = ofpbuf_size(&actions);
+ execute.actions = actions.data;
+ execute.actions_len = actions.size;
execute.packet = &packet;
execute.needs_help = false;
execute.probe = true;
xin.resubmit_stats = &stats;
xlate_actions(&xin, &xout);
- execute.actions = ofpbuf_data(xout.odp_actions);
- execute.actions_len = ofpbuf_size(xout.odp_actions);
+ execute.actions = xout.odp_actions->data;
+ execute.actions_len = xout.odp_actions->size;
pkt_metadata_from_flow(&packet->md, flow);
execute.packet = packet;
ds_put_char_multiple(result, '\t', level);
ds_put_format(result, "%s: ", title);
- format_odp_actions(result, ofpbuf_data(odp_actions),
- ofpbuf_size(odp_actions));
+ format_odp_actions(result, odp_actions->data, odp_actions->size);
ds_put_char(result, '\n');
}
goto exit;
}
- if (odp_flow_key_to_flow(ofpbuf_data(&odp_key), ofpbuf_size(&odp_key),
- flow) == ODP_FIT_ERROR) {
+ if (odp_flow_key_to_flow(odp_key.data, odp_key.size, flow) == ODP_FIT_ERROR) {
error = "Failed to parse flow key";
goto exit;
}
goto exit;
}
if (enforce_consistency) {
- retval = ofpacts_check_consistency(ofpbuf_data(&ofpacts), ofpbuf_size(&ofpacts),
+ retval = ofpacts_check_consistency(ofpacts.data, ofpacts.size,
&flow, u16_to_ofp(ofproto->up.max_ports),
0, 0, usable_protocols);
} else {
- retval = ofpacts_check(ofpbuf_data(&ofpacts), ofpbuf_size(&ofpacts), &flow,
+ retval = ofpacts_check(ofpacts.data, ofpacts.size, &flow,
u16_to_ofp(ofproto->up.max_ports), 0, 0,
&usable_protocols);
}
}
ofproto_trace(ofproto, &flow, packet,
- ofpbuf_data(&ofpacts), ofpbuf_size(&ofpacts), &result);
+ ofpacts.data, ofpacts.size, &result);
unixctl_command_reply(conn, ds_cstr(&result));
exit:
trace_format_megaflow(ds, 0, "Megaflow", &trace);
ds_put_cstr(ds, "Datapath actions: ");
- format_odp_actions(ds, ofpbuf_data(trace.xout.odp_actions),
- ofpbuf_size(trace.xout.odp_actions));
+ format_odp_actions(ds, trace.xout.odp_actions->data,
+ trace.xout.odp_actions->size);
if (trace.xout.slow) {
enum slow_path_reason slow;
fm.buffer_id = 0;
fm.out_port = 0;
fm.flags = OFPUTIL_FF_HIDDEN_FIELDS | OFPUTIL_FF_NO_READONLY;
- fm.ofpacts = ofpbuf_data(ofpacts);
- fm.ofpacts_len = ofpbuf_size(ofpacts);
+ fm.ofpacts = ofpacts->data;
+ fm.ofpacts_len = ofpacts->size;
error = ofproto_flow_mod(&ofproto->up, &fm);
if (error) {