print_sflow(struct ofpbuf *buf)
{
char *dgram_buf;
- int dgram_len = buf->size;
+ int dgram_len = ofpbuf_size(buf);
struct sflow_xdr xdrDatagram;
struct sflow_xdr *x = &xdrDatagram;
memset(x, 0, sizeof *x);
if (SFLOWXDR_try(x)) {
- SFLOWXDR_assert(x, (dgram_buf = ofpbuf_try_pull(buf, buf->size)));
+ SFLOWXDR_assert(x, (dgram_buf = ofpbuf_try_pull(buf, ofpbuf_size(buf))));
sflowxdr_init(x, dgram_buf, dgram_len);
SFLOWXDR_assert(x, dgram_len >= SFLOW_MIN_LEN);
process_datagram(x);
ofpbuf_clear(&buf);
do {
- retval = read(sock, buf.data, buf.allocated);
+ retval = read(sock, ofpbuf_data(&buf), buf.allocated);
} while (retval < 0 && errno == EINTR);
if (retval > 0) {
ofpbuf_put_uninit(&buf, retval);