X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=lib%2Fpcap-file.c;h=191e690e637815801269054bc286e9580a5cbbab;hb=a5ed8fe32cb3c996837c61af2e358fa34dc9936f;hp=b449eff8b54ff5bfe22bedd44ac909a8873fc26e;hpb=5a51b2cd3483c6c1719e5ef7091f558d49431351;p=sliver-openvswitch.git diff --git a/lib/pcap-file.c b/lib/pcap-file.c index b449eff8b..191e690e6 100644 --- a/lib/pcap-file.c +++ b/lib/pcap-file.c @@ -198,10 +198,10 @@ ovs_pcap_write(FILE *file, struct ofpbuf *buf) xgettimeofday(&tv); prh.ts_sec = tv.tv_sec; prh.ts_usec = tv.tv_usec; - prh.incl_len = buf->size; - prh.orig_len = buf->size; + prh.incl_len = ofpbuf_size(buf); + prh.orig_len = ofpbuf_size(buf); ignore(fwrite(&prh, sizeof prh, 1, file)); - ignore(fwrite(buf->data, buf->size, 1, file)); + ignore(fwrite(ofpbuf_data(buf), ofpbuf_size(buf), 1, file)); } struct tcp_key { @@ -310,7 +310,7 @@ tcp_reader_run(struct tcp_reader *r, const struct flow *flow, || !l7) { return NULL; } - tcp = packet->l4; + tcp = ofpbuf_l4(packet); flags = TCP_FLAGS(tcp->tcp_ctl); l7_length = (char *) ofpbuf_tail(packet) - l7; seq = ntohl(get_16aligned_be32(&tcp->tcp_seq)); @@ -346,7 +346,7 @@ tcp_reader_run(struct tcp_reader *r, const struct flow *flow, /* Shift all of the existing payload to the very beginning of the * allocated space, so that we reuse allocated space instead of * continually expanding it. */ - ofpbuf_shift(payload, (char *) payload->base - (char *) payload->data); + ofpbuf_shift(payload, (char *) ofpbuf_base(payload) - (char *) ofpbuf_data(payload)); ofpbuf_put(payload, l7, l7_length); stream->seq_no += l7_length;