ofpbuf_use_stack(&options, options_stub, sizeof options_stub);
nl_msg_put_u16(&options, OVS_TUNNEL_ATTR_DST_PORT,
ntohs(tnl_cfg->dst_port));
- request.options = options.data;
- request.options_len = options.size;
+ request.options = ofpbuf_data(&options);
+ request.options_len = ofpbuf_size(&options);
}
request.port_no = *port_nop;
dpif_linux_flow_get_stats(&reply, stats);
}
if (actionsp) {
- buf->data = CONST_CAST(struct nlattr *, reply.actions);
- buf->size = reply.actions_len;
+ ofpbuf_set_data(buf, CONST_CAST(struct nlattr *, reply.actions));
+ ofpbuf_set_size(buf, reply.actions_len);
*actionsp = buf;
} else {
ofpbuf_delete(buf);
{
struct dpif_linux_flow_state *state = state_;
- return state->buffer.size ? false : true;
+ return ofpbuf_size(&state->buffer) ? false : true;
}
static int
size_t key_ofs;
ofpbuf_prealloc_tailroom(buf, (64
- + d_exec->packet->size
+ + ofpbuf_size(d_exec->packet)
+ ODP_KEY_METADATA_SIZE
+ d_exec->actions_len));
k_exec->dp_ifindex = dp_ifindex;
nl_msg_put_unspec(buf, OVS_PACKET_ATTR_PACKET,
- d_exec->packet->data, d_exec->packet->size);
+ ofpbuf_data(d_exec->packet),
+ ofpbuf_size(d_exec->packet));
key_ofs = nl_msg_start_nested(buf, OVS_PACKET_ATTR_KEY);
odp_key_from_pkt_metadata(buf, &d_exec->md);
struct ofpbuf b;
int type;
- ofpbuf_use_const(&b, buf->data, buf->size);
+ ofpbuf_use_const(&b, ofpbuf_data(buf), ofpbuf_size(buf));
nlmsg = ofpbuf_try_pull(&b, sizeof *nlmsg);
genl = ofpbuf_try_pull(&b, sizeof *genl);
nl_attr_get(a[OVS_PACKET_ATTR_PACKET])) - 1,
nl_attr_get_size(a[OVS_PACKET_ATTR_PACKET]) +
sizeof(struct nlattr));
- upcall->packet.data = (char *)upcall->packet.data + sizeof(struct nlattr);
- upcall->packet.size = nl_attr_get_size(a[OVS_PACKET_ATTR_PACKET]);
+ ofpbuf_set_data(&upcall->packet,
+ (char *)ofpbuf_data(&upcall->packet) + sizeof(struct nlattr));
+ ofpbuf_set_size(&upcall->packet, nl_attr_get_size(a[OVS_PACKET_ATTR_PACKET]));
*dp_ifindex = ovs_header->dp_ifindex;
dpif_linux_vport_init(vport);
- ofpbuf_use_const(&b, buf->data, buf->size);
+ ofpbuf_use_const(&b, ofpbuf_data(buf), ofpbuf_size(buf));
nlmsg = ofpbuf_try_pull(&b, sizeof *nlmsg);
genl = ofpbuf_try_pull(&b, sizeof *genl);
ovs_header = ofpbuf_try_pull(&b, sizeof *ovs_header);
dpif_linux_dp_init(dp);
- ofpbuf_use_const(&b, buf->data, buf->size);
+ ofpbuf_use_const(&b, ofpbuf_data(buf), ofpbuf_size(buf));
nlmsg = ofpbuf_try_pull(&b, sizeof *nlmsg);
genl = ofpbuf_try_pull(&b, sizeof *genl);
ovs_header = ofpbuf_try_pull(&b, sizeof *ovs_header);
dpif_linux_flow_init(flow);
- ofpbuf_use_const(&b, buf->data, buf->size);
+ ofpbuf_use_const(&b, ofpbuf_data(buf), ofpbuf_size(buf));
nlmsg = ofpbuf_try_pull(&b, sizeof *nlmsg);
genl = ofpbuf_try_pull(&b, sizeof *genl);
ovs_header = ofpbuf_try_pull(&b, sizeof *ovs_header);