- Timestamp:
- 10/21/05 10:43:29 (17 years ago)
- 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:
- 0675ea1
- Parents:
- 194d49b
- Location:
- lib
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
lib/format_erf.c
rfe7b292 ref90843 647 647 // Flags. Can't do this 648 648 memset(&erfhdr.flags,1,1); 649 // Packet length 650 erfhdr.rlen = trace_get_capture_length(packet) ;649 // Packet length (rlen includes format overhead) 650 erfhdr.rlen = trace_get_capture_length(packet) + sizeof(dag_record_t); 651 651 // loss counter. Can't do this 652 652 erfhdr.lctr = 0; … … 747 747 dag_record_t *erfptr = 0; 748 748 erfptr = (dag_record_t *)packet->buffer; 749 return ntohs(erfptr->rlen);749 return (ntohs(erfptr->rlen) - sizeof(dag_record_t)); 750 750 } 751 751 -
lib/trace.c
rc95b923 ref90843 952 952 953 953 /* Get the size of the packet in the trace 954 * @param packet the packet opaque pointer954 * @param packet the packet opaque pointer 955 955 * @returns the size of the packet in the trace 956 956 * @author Perry Lorier 957 * @note The return size refers to the network-level payload of the packet and 958 * does not include any capture headers. For example, an Ethernet packet with 959 * an empty TCP packet will return sizeof(ethernet_header) + sizeof(ip_header) 960 * + sizeof(tcp_header). 957 961 * @note Due to this being a header capture, or anonymisation, this may not 958 962 * be the same size as the original packet. See trace_get_wire_length() for the 959 963 * original size of the packet. 960 964 * @note This can (and often is) different for different packets in a trace! 961 * @par 962 * This is sometimes called the "snaplen". 965 * @note This is sometimes called the "snaplen". 963 966 */ 964 967 int trace_get_capture_length(const struct libtrace_packet_t *packet) {
Note: See TracChangeset
for help on using the changeset viewer.