l4_size = ofpbuf_get_l4_size(&buf);
if (flow.nw_proto == IPPROTO_TCP && l4_size >= TCP_HEADER_LEN) {
- struct tcp_header *th = buf.l4;
+ struct tcp_header *th = ofpbuf_get_l4(&buf);
ds_put_format(&ds, " tcp_csum:%"PRIx16, ntohs(th->tcp_csum));
} else if (flow.nw_proto == IPPROTO_UDP && l4_size >= UDP_HEADER_LEN) {
- struct udp_header *uh = buf.l4;
+ struct udp_header *uh = ofpbuf_get_l4(&buf);
ds_put_format(&ds, " udp_csum:%"PRIx16, ntohs(uh->udp_csum));
} else if (flow.nw_proto == IPPROTO_SCTP && l4_size >= SCTP_HEADER_LEN) {
- struct sctp_header *sh = buf.l4;
+ struct sctp_header *sh = ofpbuf_get_l4(&buf);
ds_put_format(&ds, " sctp_csum:%"PRIx32, ntohl(sh->sctp_csum));
}
ds_put_format(string, " %s\n", ofperr_get_name(error));
if (error == OFPERR_OFPHFC_INCOMPATIBLE || error == OFPERR_OFPHFC_EPERM) {
- ds_put_printable(string, payload.data, payload.size);
+ ds_put_printable(string, ofpbuf_data(&payload), ofpbuf_size(&payload));
} else {
- s = ofp_to_string(payload.data, payload.size, 1);
+ s = ofp_to_string(ofpbuf_data(&payload), ofpbuf_size(&payload), 1);
ds_put_cstr(string, s);
free(s);
}
ofpbuf_use_const(&b, oh, ntohs(oh->length));
ofpraw_pull_assert(&b);
- n = b.size / sizeof *ts;
+ n = ofpbuf_size(&b) / sizeof *ts;
ds_put_format(string, " %"PRIuSIZE" tables\n", n);
if (verbosity < 1) {
return;
ofpbuf_use_const(&b, oh, ntohs(oh->length));
ofpraw_pull_assert(&b);
- n = b.size / sizeof *ts;
+ n = ofpbuf_size(&b) / sizeof *ts;
ds_put_format(string, " %"PRIuSIZE" tables\n", n);
if (verbosity < 1) {
return;
ofpbuf_use_const(&b, oh, ntohs(oh->length));
ofpraw_pull_assert(&b);
- n = b.size / sizeof *ts;
+ n = ofpbuf_size(&b) / sizeof *ts;
ds_put_format(string, " %"PRIuSIZE" tables\n", n);
if (verbosity < 1) {
return;
ofpbuf_use_const(&b, oh, ntohs(oh->length));
ofpraw_pull_assert(&b);
- n = b.size / sizeof *ts;
+ n = ofpbuf_size(&b) / sizeof *ts;
ds_put_format(string, " %"PRIuSIZE" tables\n", n);
if (verbosity < 1) {
return;