Changeset bad6a93 for lib/format_erf.c


Ignore:
Timestamp:
09/20/06 16:42:52 (15 years ago)
Author:
Shane Alcock <salcock@…>
Branches:
4.0.1-hotfixes, cachetimestamps, develop, dpdk-ndag, etsilive, getfragoff, help, libtrace4, master, ndag_format, pfring, rc-4.0.1, rc-4.0.2, rc-4.0.3, rc-4.0.4, ringdecrementfix, ringperformance, ringtimestampfixes
Children:
e86124e
Parents:
d0aa87c
Message:

trace_get_vlan_payload_from_ethernet is now available to libtrace users.
Fixed error where erf wire length was having padding subtracted from it - wire length doesn't include padding.
erf can also attach padding to the end of packets - get_capture_length now returns the minimum of the record length - padding and the wire length.
Added support for RT_LOSTCONN - also other zero sized rt packets shouldn't cause TRACE_EVENT_TERMINATE anymore
rt header information is no longer stored statically when doing a non-blocking read
The packet->buffer for rt packets is now regarded as external, so now trace_destroy_packet shouldn't cause a segfault

File:
1 edited

Legend:

Unmodified
Added
Removed
  • lib/format_erf.c

    r959f88f rbad6a93  
    996996                /* loss counter. Can't do this */
    997997                erfhdr.lctr = 0;
    998                 /* Wire length, may contain the padding */
    999                 erfhdr.wlen = htons(trace_get_wire_length(packet)+pad);
     998                /* Wire length, does not include padding! */
     999                erfhdr.wlen = htons(trace_get_wire_length(packet));
    10001000
    10011001                /* Write it out */
     
    10351035static int erf_get_capture_length(const libtrace_packet_t *packet) {
    10361036        dag_record_t *erfptr = 0;
     1037        int caplen;
    10371038        if (packet->payload == NULL)
    10381039                return 0;
    10391040       
    10401041        erfptr = (dag_record_t *)packet->header;
     1042        caplen = ntohs(erfptr->rlen) - erf_get_framing_length(packet);
     1043        if (ntohs(erfptr->wlen) < caplen)
     1044                return ntohs(erfptr->wlen);
     1045
    10411046        return (ntohs(erfptr->rlen) - erf_get_framing_length(packet));
    10421047}
     
    10451050        dag_record_t *erfptr = 0;
    10461051        erfptr = (dag_record_t *)packet->header;
    1047         return ntohs(erfptr->wlen) - erf_get_padding(packet);
     1052        return ntohs(erfptr->wlen);
    10481053}
    10491054
Note: See TracChangeset for help on using the changeset viewer.